From 9b1fe83b6165c280c50d2cf654b32ad8da0aac90 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 21 Dec 2022 10:27:12 -0800 Subject: [PATCH] fix to compile without DEBUG set --- xwords4/android/jni/xwjni.c | 1 + xwords4/common/comms.c | 2 +- xwords4/common/device.c | 6 +++++- xwords4/linux/gtkboard.c | 4 ++-- xwords4/linux/lindutil.c | 4 +++- xwords4/linux/linuxmain.c | 1 + 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/xwords4/android/jni/xwjni.c b/xwords4/android/jni/xwjni.c index 25be44abd..db156c675 100644 --- a/xwords4/android/jni/xwjni.c +++ b/xwords4/android/jni/xwjni.c @@ -708,6 +708,7 @@ msgAndTopicProc( void* closure, const XP_UCHAR* topic, size_t siz = XP_SNPRINTF( (char*)ptr, VSIZE(mtp->storage) - mtp->offset, "%s", topic ); XP_ASSERT( siz < VSIZE(mtp->storage) - mtp->offset ); + XP_USE( siz ); mtp->offset += 1 + XP_STRLEN(ptr); mtp->jPackets[mtp->count] = makeByteArray( env, msgLen, (const jbyte*)msgBuf ); diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 06b07df4b..093209290 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -1627,7 +1627,7 @@ comms_invite( CommsCtxt* comms, XWEnv xwe, const NetLaunchInfo* nli, void comms_getInvited( const CommsCtxt* comms, /*XWEnv xwe, */ - XP_U16* nInvites, CommsAddrRec* inviteRecs ) + XP_U16* nInvites, CommsAddrRec* XP_UNUSED(inviteRecs) ) { XP_U16 count = 0; diff --git a/xwords4/common/device.c b/xwords4/common/device.c index 876324014..6d3d79562 100644 --- a/xwords4/common/device.c +++ b/xwords4/common/device.c @@ -193,7 +193,7 @@ logPtrs( const char* func, int nTopics, char* topics[] ) void dvc_getMQTTSubTopics( XW_DUtilCtxt* dutil, XWEnv xwe, - XP_UCHAR* storage, XP_U16 storageLen, + XP_UCHAR* storage, XP_U16 XP_UNUSED_DBG(storageLen), XP_U16* nTopics, XP_UCHAR* topics[] ) { LOG_FUNC(); @@ -216,6 +216,7 @@ dvc_getMQTTSubTopics( XW_DUtilCtxt* dutil, XWEnv xwe, XP_UCHAR buf2[64]; size_t siz = XP_SNPRINTF( buf2, VSIZE(buf2), "%s/+", buf ); XP_ASSERT( siz < VSIZE(buf) ); + XP_USE(siz); topics[count++] = appendToStorage( storage, &offset, buf2 ); #endif @@ -322,6 +323,7 @@ dvc_makeMQTTInvites( XW_DUtilCtxt* dutil, XWEnv xwe, size_t siz = XP_SNPRINTF( gameTopic, VSIZE(gameTopic), "%s/%X", devTopic, nli->gameID ); XP_ASSERT( siz < VSIZE(gameTopic) ); + XP_USE(siz); callProc( proc, closure, devTopic, stream ); #endif @@ -371,6 +373,7 @@ dvc_makeMQTTMessages( XW_DUtilCtxt* dutil, XWEnv xwe, size_t siz = XP_SNPRINTF( gameTopic, VSIZE(gameTopic), "%s/%X", devTopic, gameID ); XP_ASSERT( siz < VSIZE(gameTopic) ); + XP_USE(siz); callProc( proc, closure, gameTopic, stream ); stream_destroy( stream, xwe ); @@ -399,6 +402,7 @@ dvc_makeMQTTNoSuchGames( XW_DUtilCtxt* dutil, XWEnv xwe, size_t siz = XP_SNPRINTF( gameTopic, VSIZE(gameTopic), "%s/%X", devTopic, gameID ); XP_ASSERT( siz < VSIZE(gameTopic) ); + XP_USE(siz); callProc( proc, closure, gameTopic, stream ); #endif diff --git a/xwords4/linux/gtkboard.c b/xwords4/linux/gtkboard.c index cd290baeb..871fc40f5 100644 --- a/xwords4/linux/gtkboard.c +++ b/xwords4/linux/gtkboard.c @@ -839,8 +839,8 @@ new_game_impl( GtkGameGlobals* globals, XP_Bool fireConnDlg ) success = gtkNewGameDialog( globals, gi, &cGlobals->selfAddr, XP_TRUE, fireConnDlg ); if ( success ) { - XP_Bool isClient = gi->serverRole == SERVER_ISCLIENT; - XP_ASSERT( !isClient ); /* Doesn't make sense! Send invitation. */ + /* Doesn't make sense! Send invitation. */ + XP_ASSERT( gi->serverRole != SERVER_ISCLIENT ); (void)game_reset( MEMPOOL &cGlobals->game, NULL_XWE, gi, &cGlobals->selfAddr, NULL, cGlobals->util, diff --git a/xwords4/linux/lindutil.c b/xwords4/linux/lindutil.c index d53627e7e..51741082e 100644 --- a/xwords4/linux/lindutil.c +++ b/xwords4/linux/lindutil.c @@ -137,11 +137,13 @@ linux_dutil_onMessageReceived( XW_DUtilCtxt* duc, XWEnv XP_UNUSED(xwe), } static void -linux_dutil_onCtrlReceived( XW_DUtilCtxt* duc, XWEnv xwe, const XP_U8* buf, XP_U16 len ) +linux_dutil_onCtrlReceived( XW_DUtilCtxt* duc, XWEnv xwe, + const XP_U8* buf, XP_U16 len ) { XP_USE(duc); XP_USE(xwe); XP_USE(buf); + XP_USE(len); XP_LOGFF( "got msg len %d", len ); } diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index 3c67985ed..3b7ce7930 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -2510,6 +2510,7 @@ testStreams( LaunchParams* params ) for ( int ii = 0; ii < VSIZE(nums); ++ii ) { XP_U32 num = stream_getU32VL( stream ); + XP_USE(num); XP_LOGFF( "compariing num[%d]: %d with %d", ii, nums[ii], num ); XP_ASSERT( num == nums[ii] ); }