Fix release-build warnings that new compiler flags.

This commit is contained in:
Eric House 2012-10-07 11:43:50 -07:00
parent fd9b9f85e2
commit 968340f665
7 changed files with 39 additions and 18 deletions

View file

@ -86,11 +86,13 @@ static XP_Bool
ddStartBoard( BoardCtxt* board, XP_U16 xx, XP_U16 yy ) ddStartBoard( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
{ {
DragState* ds = &board->dragState; DragState* ds = &board->dragState;
XP_Bool found;
XP_Bool trayVisible; XP_Bool trayVisible;
XP_U16 col, row; XP_U16 col, row;
found = coordToCell( board, xx, yy, &col, &row ); #ifdef DEBUG
XP_Bool found =
#endif
coordToCell( board, xx, yy, &col, &row );
XP_ASSERT( found ); XP_ASSERT( found );
#ifdef XWFEATURE_CROSSHAIRS #ifdef XWFEATURE_CROSSHAIRS
if ( !board->hideCrosshairs ) { if ( !board->hideCrosshairs ) {
@ -105,9 +107,12 @@ ddStartBoard( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
ds->dtype = DT_TILE; ds->dtype = DT_TILE;
flipIf( board, col, row, &modelc, &modelr ); flipIf( board, col, row, &modelc, &modelr );
found = model_getTile( board->model, modelc, modelr, XP_TRUE, #ifdef DEBUG
board->selPlayer, &ds->tile, &ds->isBlank, found =
NULL, NULL ); #endif
model_getTile( board->model, modelc, modelr, XP_TRUE,
board->selPlayer, &ds->tile, &ds->isBlank,
NULL, NULL );
XP_ASSERT( found ); XP_ASSERT( found );
} else { } else {
/* If we're not dragging a tile, we can either drag the board (scroll) /* If we're not dragging a tile, we can either drag the board (scroll)

View file

@ -1592,7 +1592,7 @@ commitTurn( ModelCtxt* model, XP_S16 turn, const TrayTileSet* newTiles,
PlayerCtxt* player; PlayerCtxt* player;
PendingTile* pt; PendingTile* pt;
XP_S16 score = -1; XP_S16 score = -1;
XP_Bool inLine, isHorizontal; XP_Bool isHorizontal;
const Tile* newTilesP; const Tile* newTilesP;
XP_U16 nTiles; XP_U16 nTiles;
@ -1612,7 +1612,10 @@ commitTurn( ModelCtxt* model, XP_S16 turn, const TrayTileSet* newTiles,
if ( useStack ) { if ( useStack ) {
MoveInfo moveInfo = {0}; MoveInfo moveInfo = {0};
inLine = tilesInLine( model, turn, &isHorizontal ); #ifdef DEBUG
XP_Bool inLine =
#endif
tilesInLine( model, turn, &isHorizontal );
XP_ASSERT( inLine ); XP_ASSERT( inLine );
normalizeMoves( model, turn, isHorizontal, &moveInfo ); normalizeMoves( model, turn, isHorizontal, &moveInfo );

View file

@ -692,7 +692,9 @@ handleRegistrationMsg( ServerCtxt* server, XWStreamCtxt* stream )
util_userError( server->vol.util, ERR_REG_UNEXPECTED_USER ); util_userError( server->vol.util, ERR_REG_UNEXPECTED_USER );
success = XP_FALSE; success = XP_FALSE;
} else { } else {
#ifdef DEBUG
XP_S8 prevIndex = -1; XP_S8 prevIndex = -1;
#endif
for ( ; ii < playersInMsg; ++ii ) { for ( ; ii < playersInMsg; ++ii ) {
clientIndex = registerRemotePlayer( server, stream ); clientIndex = registerRemotePlayer( server, stream );
@ -701,8 +703,10 @@ handleRegistrationMsg( ServerCtxt* server, XWStreamCtxt* stream )
need to let the board know to redraw the scoreboard with more need to let the board know to redraw the scoreboard with more
players there. */ players there. */
callTurnChangeListener( server ); callTurnChangeListener( server );
#ifdef DEBUG
XP_ASSERT( ii == 0 || prevIndex == clientIndex ); XP_ASSERT( ii == 0 || prevIndex == clientIndex );
prevIndex = clientIndex; prevIndex = clientIndex;
#endif
} }
} }

View file

@ -395,8 +395,9 @@ curses_util_notifyGameOver( XW_UtilCtxt* uc )
} /* curses_util_notifyGameOver */ } /* curses_util_notifyGameOver */
static void static void
curses_util_informNetDict( XW_UtilCtxt* uc, const XP_UCHAR* oldName, curses_util_informNetDict( XW_UtilCtxt* uc, const XP_UCHAR* XP_UNUSED_DBG(oldName),
const XP_UCHAR* newName, const XP_UCHAR* newSum, const XP_UCHAR* XP_UNUSED_DBG(newName),
const XP_UCHAR* XP_UNUSED_DBG(newSum),
XWPhoniesChoice phoniesAction ) XWPhoniesChoice phoniesAction )
{ {
XP_USE(uc); XP_USE(uc);

View file

@ -1290,13 +1290,14 @@ allocAndSet( GdkColormap* map, GdkColor* color, unsigned short red,
unsigned short green, unsigned short blue ) unsigned short green, unsigned short blue )
{ {
gboolean success;
color->red = red; color->red = red;
color->green = green; color->green = green;
color->blue = blue; color->blue = blue;
#ifdef DEBUG
success = gdk_colormap_alloc_color( map, gboolean success =
#endif
gdk_colormap_alloc_color( map,
color, color,
TRUE, /* writeable */ TRUE, /* writeable */
TRUE ); /* best-match */ TRUE ); /* best-match */

View file

@ -251,10 +251,11 @@ saveGame( CommonGlobals* cGlobals )
if ( doSave ) { if ( doSave ) {
XWStreamCtxt* outStream; XWStreamCtxt* outStream;
outStream = mem_stream_make_sized( cGlobals->params->util->mpool, outStream =
cGlobals->params->vtMgr, mem_stream_make_sized( MPPARM(cGlobals->params->util->mpool)
cGlobals->lastStreamSize, cGlobals->params->vtMgr,
cGlobals, 0, writeToFile ); cGlobals->lastStreamSize,
cGlobals, 0, writeToFile );
stream_open( outStream ); stream_open( outStream );
game_saveToStream( &cGlobals->game, game_saveToStream( &cGlobals->game,

View file

@ -584,9 +584,15 @@ writeNoConnMsgs( CommonGlobals* cGlobals, int fd )
/* XP_U8 buf[siz]; */ /* XP_U8 buf[siz]; */
/* stream_getBytes( stream, buf, siz ); */ /* stream_getBytes( stream, buf, siz ); */
XP_U16 tmp = XP_HTONS( siz ); XP_U16 tmp = XP_HTONS( siz );
ssize_t nwritten = write( fd, &tmp, sizeof(tmp) ); #ifdef DEBUG
ssize_t nwritten =
#endif
write( fd, &tmp, sizeof(tmp) );
XP_ASSERT( nwritten == sizeof(tmp) ); XP_ASSERT( nwritten == sizeof(tmp) );
nwritten = write( fd, stream_getPtr( stream ), siz ); #ifdef DEBUG
nwritten =
#endif
write( fd, stream_getPtr( stream ), siz );
XP_ASSERT( nwritten == siz ); XP_ASSERT( nwritten == siz );
stream_destroy( stream ); stream_destroy( stream );
} }