mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
Mark params unused in compiles for standalone; remove unused param.
This commit is contained in:
parent
005694b0b1
commit
f3b8867518
5 changed files with 41 additions and 25 deletions
|
@ -225,4 +225,10 @@ typedef struct CommonPrefs {
|
|||
# define XP_UNUSED_KEYBOARD_NAV(x) UNUSED__ ## x __attribute__((unused))
|
||||
#endif
|
||||
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
# define XP_UNUSED_STANDALONE(x) x
|
||||
#else
|
||||
# define XP_UNUSED_STANDALONE(x) UNUSED__ ## x __attribute__((unused))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -73,8 +73,9 @@ void
|
|||
game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
|
||||
XW_UtilCtxt* util, DrawCtx* draw,
|
||||
XP_U16 gameID, CommonPrefs* cp,
|
||||
TransportSend sendproc, IF_CH( TransportReset resetproc )
|
||||
void* closure )
|
||||
TransportSend XP_UNUSED_STANDALONE(sendproc),
|
||||
IF_CH( TransportReset resetproc )
|
||||
void* XP_UNUSED_STANDALONE(closure) )
|
||||
{
|
||||
XP_U16 nPlayersHere, nPlayersTotal;
|
||||
|
||||
|
@ -111,9 +112,12 @@ game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
|
|||
} /* game_makeNewGame */
|
||||
|
||||
void
|
||||
game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XW_UtilCtxt* util,
|
||||
XP_U16 gameID, CommonPrefs* cp, TransportSend sendproc,
|
||||
IF_CH(TransportReset resetproc) void* closure )
|
||||
game_reset( MPFORMAL XWGame* game, CurGameInfo* gi,
|
||||
XW_UtilCtxt* XP_UNUSED_STANDALONE(util),
|
||||
XP_U16 gameID, CommonPrefs* cp,
|
||||
TransportSend XP_UNUSED_STANDALONE(sendproc),
|
||||
IF_CH(TransportReset resetproc)
|
||||
void* XP_UNUSED_STANDALONE(closure) )
|
||||
{
|
||||
XP_U16 i;
|
||||
XP_U16 nPlayersHere, nPlayersTotal;
|
||||
|
@ -163,8 +167,9 @@ XP_Bool
|
|||
game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game,
|
||||
CurGameInfo* gi, DictionaryCtxt* dict,
|
||||
XW_UtilCtxt* util, DrawCtx* draw, CommonPrefs* cp,
|
||||
TransportSend sendProc, IF_CH(TransportReset resetProc)
|
||||
void* closure )
|
||||
TransportSend XP_UNUSED_STANDALONE(sendProc),
|
||||
IF_CH(TransportReset resetProc)
|
||||
void* XP_UNUSED_STANDALONE(closure) )
|
||||
{
|
||||
XP_Bool success = XP_FALSE;
|
||||
XP_U8 strVersion;
|
||||
|
|
|
@ -207,7 +207,8 @@ cpToLP( NGValue value, const void* cbClosure )
|
|||
} /* cpToLP */
|
||||
|
||||
XP_Bool
|
||||
newg_store( NewGameCtx* ngc, CurGameInfo* gi, XP_Bool warn )
|
||||
newg_store( NewGameCtx* ngc, CurGameInfo* gi,
|
||||
XP_Bool XP_UNUSED_STANDALONE(warn) )
|
||||
{
|
||||
XP_U16 player;
|
||||
XP_Bool consistent = checkConsistent( ngc, warn );
|
||||
|
@ -467,6 +468,7 @@ adjustOneRow( NewGameCtx* ngc, XP_U16 player, XP_Bool force )
|
|||
* the most common case, which is playing again with the same players. In
|
||||
* that case changing role then back again should not lose/change data.
|
||||
*/
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
static void
|
||||
changeRole( NewGameCtx* ngc, DeviceRole newRole )
|
||||
{
|
||||
|
@ -488,6 +490,7 @@ changeRole( NewGameCtx* ngc, DeviceRole newRole )
|
|||
setRoleStrings( ngc );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
setRoleStrings( NewGameCtx* ngc )
|
||||
|
|
|
@ -666,8 +666,8 @@ ceSetTitleFromName( CEAppGlobals* globals )
|
|||
} /* ceSetTitleFromName */
|
||||
|
||||
static void
|
||||
ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, CeGamePrefs* gp,
|
||||
const CommsAddrRec* addr )
|
||||
ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame,
|
||||
const CommsAddrRec* XP_UNUSED_STANDALONE(addr) )
|
||||
{
|
||||
DictionaryCtxt* dict;
|
||||
XP_UCHAR* newDictName = globals->gameInfo.dictName;
|
||||
|
@ -709,11 +709,6 @@ ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, CeGamePrefs* gp,
|
|||
newGameID, &globals->appPrefs.cp, CE_SEND_PROC,
|
||||
CE_RESET_PROC globals );
|
||||
|
||||
if ( !!gp ) {
|
||||
globals->gameInfo.hintsNotAllowed = gp->hintsNotAllowed;
|
||||
globals->gameInfo.robotSmartness = gp->robotSmartness;
|
||||
}
|
||||
|
||||
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH
|
||||
if ( !!addr ) {
|
||||
XP_ASSERT( globals->game.comms != NULL );
|
||||
|
@ -1074,7 +1069,8 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
|
|||
hWnd = FindWindow( szWindowClass, szTitle);
|
||||
if ( hWnd ) {
|
||||
SetForegroundWindow( (HWND)((ULONG) hWnd | 0x00000001) );
|
||||
return FALSE;
|
||||
result = FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
(void)CreateDirectory( DEFAULT_DIR_NAME, 0 );
|
||||
|
@ -1110,8 +1106,9 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
|
|||
CW_USEDEFAULT, NULL, NULL, hInstance, globals);
|
||||
globals->hWnd = hWnd;
|
||||
|
||||
if (!hWnd) {
|
||||
return FALSE;
|
||||
if (!hWnd) {
|
||||
result = FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
|
@ -1148,7 +1145,8 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
|
|||
"http://xwords.sf.net." );
|
||||
messageBoxStream( globals, stream, L"Dictionary Not Found" );
|
||||
stream_destroy( stream );
|
||||
return FALSE;
|
||||
result = FALSE;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1189,9 +1187,10 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
|
|||
}
|
||||
#endif
|
||||
if ( result && !newDone ) {
|
||||
ceInitAndStartBoard( globals, !oldGameLoaded, NULL, NULL );
|
||||
ceInitAndStartBoard( globals, !oldGameLoaded, NULL );
|
||||
}
|
||||
|
||||
exit:
|
||||
return result;
|
||||
} /* InitInstance */
|
||||
|
||||
|
@ -1370,7 +1369,7 @@ ceDoNewGame( CEAppGlobals* globals )
|
|||
}
|
||||
#endif
|
||||
|
||||
ceInitAndStartBoard( globals, XP_TRUE, NULL, addr );
|
||||
ceInitAndStartBoard( globals, XP_TRUE, addr );
|
||||
changed = XP_TRUE;
|
||||
}
|
||||
|
||||
|
@ -1420,7 +1419,7 @@ ceChooseAndOpen( CEAppGlobals* globals )
|
|||
|
||||
globals->curGameName = name;
|
||||
if ( ceLoadSavedGame( globals ) ) {
|
||||
ceInitAndStartBoard( globals, XP_FALSE, NULL, NULL );
|
||||
ceInitAndStartBoard( globals, XP_FALSE, NULL );
|
||||
ceSetTitleFromName( globals );
|
||||
} else {
|
||||
XP_LOGF( "failed to open chosen game" );
|
||||
|
@ -2779,7 +2778,8 @@ ce_util_engineProgressCallback( XW_UtilCtxt* XP_UNUSED(uc) )
|
|||
|
||||
static void
|
||||
ce_util_setTimer( XW_UtilCtxt* uc, XWTimerReason why,
|
||||
XP_U16 when, XWTimerProc proc, void* closure )
|
||||
XP_U16 XP_UNUSED_STANDALONE(when), XWTimerProc proc,
|
||||
void* closure )
|
||||
{
|
||||
CEAppGlobals* globals = (CEAppGlobals*)uc->closure;
|
||||
XP_U32 timerID;
|
||||
|
|
|
@ -102,7 +102,8 @@ adjustForChoice( HWND hDlg, CePrefsDlgState* state )
|
|||
* committing should user cancel.
|
||||
*/
|
||||
void
|
||||
loadStateFromCurPrefs( CEAppGlobals* globals, const CEAppPrefs* appPrefs,
|
||||
loadStateFromCurPrefs( CEAppGlobals* XP_UNUSED_STANDALONE(globals),
|
||||
const CEAppPrefs* appPrefs,
|
||||
const CurGameInfo* gi, CePrefsPrefs* prefsPrefs )
|
||||
{
|
||||
prefsPrefs->gp.hintsNotAllowed = gi->hintsNotAllowed;
|
||||
|
@ -132,7 +133,8 @@ loadStateFromCurPrefs( CEAppGlobals* globals, const CEAppPrefs* appPrefs,
|
|||
} /* loadStateFromCurPrefs */
|
||||
|
||||
void
|
||||
loadCurPrefsFromState( CEAppGlobals* globals, CEAppPrefs* appPrefs,
|
||||
loadCurPrefsFromState( CEAppGlobals* XP_UNUSED_STANDALONE(globals),
|
||||
CEAppPrefs* appPrefs,
|
||||
CurGameInfo* gi, const CePrefsPrefs* prefsPrefs )
|
||||
{
|
||||
gi->hintsNotAllowed = prefsPrefs->gp.hintsNotAllowed;
|
||||
|
|
Loading…
Add table
Reference in a new issue