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 )
{
DragState* ds = &board->dragState;
XP_Bool found;
XP_Bool trayVisible;
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 );
#ifdef XWFEATURE_CROSSHAIRS
if ( !board->hideCrosshairs ) {
@ -105,9 +107,12 @@ ddStartBoard( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
ds->dtype = DT_TILE;
flipIf( board, col, row, &modelc, &modelr );
found = model_getTile( board->model, modelc, modelr, XP_TRUE,
board->selPlayer, &ds->tile, &ds->isBlank,
NULL, NULL );
#ifdef DEBUG
found =
#endif
model_getTile( board->model, modelc, modelr, XP_TRUE,
board->selPlayer, &ds->tile, &ds->isBlank,
NULL, NULL );
XP_ASSERT( found );
} else {
/* 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;
PendingTile* pt;
XP_S16 score = -1;
XP_Bool inLine, isHorizontal;
XP_Bool isHorizontal;
const Tile* newTilesP;
XP_U16 nTiles;
@ -1612,7 +1612,10 @@ commitTurn( ModelCtxt* model, XP_S16 turn, const TrayTileSet* newTiles,
if ( useStack ) {
MoveInfo moveInfo = {0};
inLine = tilesInLine( model, turn, &isHorizontal );
#ifdef DEBUG
XP_Bool inLine =
#endif
tilesInLine( model, turn, &isHorizontal );
XP_ASSERT( inLine );
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 );
success = XP_FALSE;
} else {
#ifdef DEBUG
XP_S8 prevIndex = -1;
#endif
for ( ; ii < playersInMsg; ++ii ) {
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
players there. */
callTurnChangeListener( server );
#ifdef DEBUG
XP_ASSERT( ii == 0 || prevIndex == clientIndex );
prevIndex = clientIndex;
#endif
}
}

View file

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

View file

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

View file

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

View file

@ -584,9 +584,15 @@ writeNoConnMsgs( CommonGlobals* cGlobals, int fd )
/* XP_U8 buf[siz]; */
/* stream_getBytes( stream, buf, 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) );
nwritten = write( fd, stream_getPtr( stream ), siz );
#ifdef DEBUG
nwritten =
#endif
write( fd, stream_getPtr( stream ), siz );
XP_ASSERT( nwritten == siz );
stream_destroy( stream );
}