mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
strutils macro change; tweak so compiles non-DEBUG and without Bluetooth
This commit is contained in:
parent
a292e33c03
commit
63afad6482
4 changed files with 18 additions and 13 deletions
|
@ -91,12 +91,17 @@ typedef struct PalmBTStuff {
|
||||||
|
|
||||||
} PalmBTStuff;
|
} PalmBTStuff;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static void palm_bt_log( const char* btfunc, const char* func, Err err );
|
||||||
#define LOG_ERR(f,e) palm_bt_log( #f, __FUNCTION__, e )
|
#define LOG_ERR(f,e) palm_bt_log( #f, __FUNCTION__, e )
|
||||||
#define CALL_ERR(e,f,...) \
|
#define CALL_ERR(e,f,...) \
|
||||||
XP_LOGF( "%s: calling %s", __FUNCTION__, #f ); \
|
XP_LOGF( "%s: calling %s", __FUNCTION__, #f ); \
|
||||||
e = f(__VA_ARGS__); \
|
e = f(__VA_ARGS__); \
|
||||||
LOG_ERR(f,e); \
|
LOG_ERR(f,e); \
|
||||||
if ( e == btLibErrFailed ) { XP_WARNF( "%s=>btLibErrFailed", #f ); }
|
if ( e == btLibErrFailed ) { XP_WARNF( "%s=>btLibErrFailed", #f ); }
|
||||||
|
#else
|
||||||
|
#define CALL_ERR(e,f,...) e = f(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* WHAT SHOULD THIS BE? Copied from Whiteboard.... PENDING */
|
/* WHAT SHOULD THIS BE? Copied from Whiteboard.... PENDING */
|
||||||
static const BtLibSdpUuidType XWORDS_UUID = {
|
static const BtLibSdpUuidType XWORDS_UUID = {
|
||||||
|
@ -105,7 +110,6 @@ static const BtLibSdpUuidType XWORDS_UUID = {
|
||||||
0x83, 0xe0, 0x7b, 0x3d, 0xe6, 0xa1, 0xc3, 0x3b } };
|
0x83, 0xe0, 0x7b, 0x3d, 0xe6, 0xa1, 0xc3, 0x3b } };
|
||||||
|
|
||||||
static PalmBTStuff* pbt_checkInit( PalmAppGlobals* globals );
|
static PalmBTStuff* pbt_checkInit( PalmAppGlobals* globals );
|
||||||
static void palm_bt_log( const char* btfunc, const char* func, Err err );
|
|
||||||
static Err bpd_discover( PalmBTStuff* btStuff, BtLibDeviceAddressType* addr );
|
static Err bpd_discover( PalmBTStuff* btStuff, BtLibDeviceAddressType* addr );
|
||||||
static void pbt_setup_slave( PalmBTStuff* btStuff, const CommsAddrRec* addr );
|
static void pbt_setup_slave( PalmBTStuff* btStuff, const CommsAddrRec* addr );
|
||||||
static void pbt_takedown_slave( PalmBTStuff* btStuff );
|
static void pbt_takedown_slave( PalmBTStuff* btStuff );
|
||||||
|
@ -136,6 +140,8 @@ static const char* connEnumToStr( BtLibAccessibleModeEnum mode );
|
||||||
# define btEvtToStr( evt ) ""
|
# define btEvtToStr( evt ) ""
|
||||||
# define mgmtEvtToStr( evt ) ""
|
# define mgmtEvtToStr( evt ) ""
|
||||||
# define actToStr(act) ""
|
# define actToStr(act) ""
|
||||||
|
# define stateToStr(st) ""
|
||||||
|
# define connEnumToStr(mode) ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
|
@ -228,13 +234,13 @@ XP_Bool
|
||||||
palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
||||||
XP_UCHAR* out, XP_U16 len )
|
XP_UCHAR* out, XP_U16 len )
|
||||||
{
|
{
|
||||||
Err err;
|
XP_Bool success = XP_FALSE;
|
||||||
PalmBTStuff* btStuff;
|
PalmBTStuff* btStuff;
|
||||||
|
|
||||||
btStuff = pbt_checkInit( globals );
|
btStuff = pbt_checkInit( globals );
|
||||||
if ( NULL != btStuff ) {
|
if ( NULL != btStuff ) {
|
||||||
BtLibDeviceAddressType addr;
|
BtLibDeviceAddressType addr;
|
||||||
err = bpd_discover( btStuff, &addr );
|
Err err = bpd_discover( btStuff, &addr );
|
||||||
|
|
||||||
if ( errNone == err ) {
|
if ( errNone == err ) {
|
||||||
UInt16 index;
|
UInt16 index;
|
||||||
|
@ -257,10 +263,9 @@ palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
||||||
/* &btStuff->u.slave.masterAddr, */
|
/* &btStuff->u.slave.masterAddr, */
|
||||||
/* out, len ); */
|
/* out, len ); */
|
||||||
}
|
}
|
||||||
} else {
|
success = errNone == err;
|
||||||
XP_LOGF( "%s: err = %s", __FUNCTION__, btErrToStr(err) );
|
|
||||||
}
|
}
|
||||||
return errNone == err;
|
return success;
|
||||||
} /* palm_bt_browse_device */
|
} /* palm_bt_browse_device */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -48,7 +48,5 @@ XP_S16 palm_bt_send( const XP_U8* buf, XP_U16 len, const CommsAddrRec* addr,
|
||||||
XP_Bool palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
XP_Bool palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
||||||
XP_UCHAR* out,XP_U16 len );
|
XP_UCHAR* out,XP_U16 len );
|
||||||
|
|
||||||
#else
|
|
||||||
* define palm_bt_appendWaitTicks( g, r )
|
|
||||||
#endif /* XWFEATURE_BLUETOOTH */
|
#endif /* XWFEATURE_BLUETOOTH */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1204,7 +1204,7 @@ startApplication( PalmAppGlobals** globalsP )
|
||||||
globals->isNewGame = true;
|
globals->isNewGame = true;
|
||||||
|
|
||||||
getNthDict( globals->dictList, 0, &dlep );
|
getNthDict( globals->dictList, 0, &dlep );
|
||||||
globals->gameInfo.dictName = copyString( MPPARM(globals->mpool)
|
globals->gameInfo.dictName = copyString( globals->mpool,
|
||||||
dlep->baseName );
|
dlep->baseName );
|
||||||
|
|
||||||
gameID = TimGetSeconds();
|
gameID = TimGetSeconds();
|
||||||
|
@ -1579,8 +1579,10 @@ handleNilEvent( PalmAppGlobals* globals )
|
||||||
} else if ( timeForTimer( globals, &why, &when )
|
} else if ( timeForTimer( globals, &why, &when )
|
||||||
&& (when <= TimGetTicks()) ) {
|
&& (when <= TimGetTicks()) ) {
|
||||||
palmFireTimer( globals, why );
|
palmFireTimer( globals, why );
|
||||||
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
} else if ( palm_bt_doWork( globals ) ) {
|
} else if ( palm_bt_doWork( globals ) ) {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
|
#endif
|
||||||
} else if ( globals->timeRequested ) {
|
} else if ( globals->timeRequested ) {
|
||||||
globals->timeRequested = false;
|
globals->timeRequested = false;
|
||||||
if ( globals->msgReceivedDraw ) {
|
if ( globals->msgReceivedDraw ) {
|
||||||
|
@ -1873,15 +1875,15 @@ initAndStartBoard( PalmAppGlobals* globals, XP_Bool newGame )
|
||||||
dict_destroy( dict );
|
dict_destroy( dict );
|
||||||
dict = NULL;
|
dict = NULL;
|
||||||
} else {
|
} else {
|
||||||
replaceStringIfDifferent( MEMPOOL &globals->gameInfo.dictName,
|
replaceStringIfDifferent( globals->mpool,
|
||||||
dictName );
|
&globals->gameInfo.dictName, dictName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !dict ) {
|
if ( !dict ) {
|
||||||
XP_ASSERT( !!newDictName );
|
XP_ASSERT( !!newDictName );
|
||||||
dict = palm_dictionary_make( MPPARM(globals->mpool) globals,
|
dict = palm_dictionary_make( MPPARM(globals->mpool) globals,
|
||||||
copyString( MEMPOOL newDictName ),
|
copyString( globals->mpool, newDictName ),
|
||||||
globals->dictList );
|
globals->dictList );
|
||||||
XP_ASSERT( !!dict );
|
XP_ASSERT( !!dict );
|
||||||
model_setDictionary( globals->game.model, dict );
|
model_setDictionary( globals->game.model, dict );
|
||||||
|
|
|
@ -405,7 +405,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* versioning stuff */
|
/* versioning stuff */
|
||||||
#define XW_PALM_VERSION_STRING "4.1.5b1"
|
#define XW_PALM_VERSION_STRING "4.2a1"
|
||||||
#define CUR_PREFS_VERS 0x0405
|
#define CUR_PREFS_VERS 0x0405
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue