mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +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;
|
||||
|
||||
#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 CALL_ERR(e,f,...) \
|
||||
XP_LOGF( "%s: calling %s", __FUNCTION__, #f ); \
|
||||
e = f(__VA_ARGS__); \
|
||||
LOG_ERR(f,e); \
|
||||
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 */
|
||||
static const BtLibSdpUuidType XWORDS_UUID = {
|
||||
|
@ -105,7 +110,6 @@ static const BtLibSdpUuidType XWORDS_UUID = {
|
|||
0x83, 0xe0, 0x7b, 0x3d, 0xe6, 0xa1, 0xc3, 0x3b } };
|
||||
|
||||
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 void pbt_setup_slave( PalmBTStuff* btStuff, const CommsAddrRec* addr );
|
||||
static void pbt_takedown_slave( PalmBTStuff* btStuff );
|
||||
|
@ -136,6 +140,8 @@ static const char* connEnumToStr( BtLibAccessibleModeEnum mode );
|
|||
# define btEvtToStr( evt ) ""
|
||||
# define mgmtEvtToStr( evt ) ""
|
||||
# define actToStr(act) ""
|
||||
# define stateToStr(st) ""
|
||||
# define connEnumToStr(mode) ""
|
||||
#endif
|
||||
|
||||
/* callbacks */
|
||||
|
@ -228,13 +234,13 @@ XP_Bool
|
|||
palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
||||
XP_UCHAR* out, XP_U16 len )
|
||||
{
|
||||
Err err;
|
||||
XP_Bool success = XP_FALSE;
|
||||
PalmBTStuff* btStuff;
|
||||
|
||||
btStuff = pbt_checkInit( globals );
|
||||
if ( NULL != btStuff ) {
|
||||
BtLibDeviceAddressType addr;
|
||||
err = bpd_discover( btStuff, &addr );
|
||||
Err err = bpd_discover( btStuff, &addr );
|
||||
|
||||
if ( errNone == err ) {
|
||||
UInt16 index;
|
||||
|
@ -257,10 +263,9 @@ palm_bt_browse_device( PalmAppGlobals* globals, XP_BtAddr* btAddr,
|
|||
/* &btStuff->u.slave.masterAddr, */
|
||||
/* out, len ); */
|
||||
}
|
||||
} else {
|
||||
XP_LOGF( "%s: err = %s", __FUNCTION__, btErrToStr(err) );
|
||||
success = errNone == err;
|
||||
}
|
||||
return errNone == err;
|
||||
return success;
|
||||
} /* palm_bt_browse_device */
|
||||
|
||||
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_UCHAR* out,XP_U16 len );
|
||||
|
||||
#else
|
||||
* define palm_bt_appendWaitTicks( g, r )
|
||||
#endif /* XWFEATURE_BLUETOOTH */
|
||||
#endif
|
||||
|
|
|
@ -1204,7 +1204,7 @@ startApplication( PalmAppGlobals** globalsP )
|
|||
globals->isNewGame = true;
|
||||
|
||||
getNthDict( globals->dictList, 0, &dlep );
|
||||
globals->gameInfo.dictName = copyString( MPPARM(globals->mpool)
|
||||
globals->gameInfo.dictName = copyString( globals->mpool,
|
||||
dlep->baseName );
|
||||
|
||||
gameID = TimGetSeconds();
|
||||
|
@ -1579,8 +1579,10 @@ handleNilEvent( PalmAppGlobals* globals )
|
|||
} else if ( timeForTimer( globals, &why, &when )
|
||||
&& (when <= TimGetTicks()) ) {
|
||||
palmFireTimer( globals, why );
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
} else if ( palm_bt_doWork( globals ) ) {
|
||||
/* nothing to do */
|
||||
#endif
|
||||
} else if ( globals->timeRequested ) {
|
||||
globals->timeRequested = false;
|
||||
if ( globals->msgReceivedDraw ) {
|
||||
|
@ -1873,15 +1875,15 @@ initAndStartBoard( PalmAppGlobals* globals, XP_Bool newGame )
|
|||
dict_destroy( dict );
|
||||
dict = NULL;
|
||||
} else {
|
||||
replaceStringIfDifferent( MEMPOOL &globals->gameInfo.dictName,
|
||||
dictName );
|
||||
replaceStringIfDifferent( globals->mpool,
|
||||
&globals->gameInfo.dictName, dictName );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !dict ) {
|
||||
XP_ASSERT( !!newDictName );
|
||||
dict = palm_dictionary_make( MPPARM(globals->mpool) globals,
|
||||
copyString( MEMPOOL newDictName ),
|
||||
copyString( globals->mpool, newDictName ),
|
||||
globals->dictList );
|
||||
XP_ASSERT( !!dict );
|
||||
model_setDictionary( globals->game.model, dict );
|
||||
|
|
|
@ -405,7 +405,7 @@
|
|||
#endif
|
||||
|
||||
/* versioning stuff */
|
||||
#define XW_PALM_VERSION_STRING "4.1.5b1"
|
||||
#define XW_PALM_VERSION_STRING "4.2a1"
|
||||
#define CUR_PREFS_VERS 0x0405
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue