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