From 63afad648261226d04bc09d6e2fe5fa53cab6d76 Mon Sep 17 00:00:00 2001 From: ehouse Date: Fri, 15 Sep 2006 07:42:10 +0000 Subject: [PATCH] strutils macro change; tweak so compiles non-DEBUG and without Bluetooth --- xwords4/palm/palmbt.c | 17 +++++++++++------ xwords4/palm/palmbt.h | 2 -- xwords4/palm/palmmain.c | 10 ++++++---- xwords4/palm/xwords4defines.h | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/xwords4/palm/palmbt.c b/xwords4/palm/palmbt.c index 34c716ed2..700bfbd14 100644 --- a/xwords4/palm/palmbt.c +++ b/xwords4/palm/palmbt.c @@ -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 diff --git a/xwords4/palm/palmbt.h b/xwords4/palm/palmbt.h index c49c1e8bd..39b9827ca 100644 --- a/xwords4/palm/palmbt.h +++ b/xwords4/palm/palmbt.h @@ -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 diff --git a/xwords4/palm/palmmain.c b/xwords4/palm/palmmain.c index 8b0e321bb..2dada3f64 100644 --- a/xwords4/palm/palmmain.c +++ b/xwords4/palm/palmmain.c @@ -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 ); diff --git a/xwords4/palm/xwords4defines.h b/xwords4/palm/xwords4defines.h index 136e532ef..90346168d 100644 --- a/xwords4/palm/xwords4defines.h +++ b/xwords4/palm/xwords4defines.h @@ -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