From c956b0858a2c92eb3ba41f95abe0c9e319d648ce Mon Sep 17 00:00:00 2001 From: ehouse Date: Sun, 11 Jun 2006 20:12:20 +0000 Subject: [PATCH] cleanup; fix compile of non-debug win32 version --- common/nwgamest.c | 6 ++---- common/nwgamest.h | 2 -- wince/ceginfo.c | 10 ++++------ wince/cemain.c | 3 +++ wince/cestrbx.c | 2 ++ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/common/nwgamest.c b/common/nwgamest.c index 4e4e74e39..1ec12a352 100644 --- a/common/nwgamest.c +++ b/common/nwgamest.c @@ -27,6 +27,8 @@ extern "C" { #endif +#define NG_NUM_COLS ((XP_U16)(NG_COL_PASSWD+1)) + struct NewGameCtx { NewGameEnableColProc enableColProc; NewGameEnableAttrProc enableAttrProc; @@ -156,8 +158,6 @@ cpToGI( NGValue value, const void* cbClosure ) case NG_COL_ROBOT: pl->isRobot = value.ng_bool; break; - default: - XP_ASSERT(0); } if ( !!strAddr ) { @@ -259,8 +259,6 @@ deepCopy( NGValue value, const void* closure ) case NG_COL_PASSWD: dvp->value.ng_cp = copyString( MPPARM(dvp->mpool) value.ng_cp ); break; - default: - XP_ASSERT(0); } } diff --git a/common/nwgamest.h b/common/nwgamest.h index 1d8265325..52ed71977 100644 --- a/common/nwgamest.h +++ b/common/nwgamest.h @@ -48,7 +48,6 @@ typedef enum { NG_COL_NAME ,NG_COL_ROBOT ,NG_COL_PASSWD - ,NG_NUM_COLS } NewGameColumn; typedef enum { @@ -58,7 +57,6 @@ typedef enum { #endif NG_ATTR_NPLAYERS ,NG_ATTR_NPLAYHEADER - ,NG_ATTR_CANJUGGLE } NewGameAttr; typedef enum { NGEnableHidden, diff --git a/wince/ceginfo.c b/wince/ceginfo.c index b98fe9d80..c9e99d985 100755 --- a/wince/ceginfo.c +++ b/wince/ceginfo.c @@ -278,7 +278,7 @@ handleConnOptionsButton( HWND hDlg, CEAppGlobals* globals, static XP_U16 resIDForCol( XP_U16 player, NewGameColumn col ) { - XP_U16 resID; + XP_U16 resID = 0; switch ( col ) { #ifndef XWFEATURE_STANDALONE_ONLY case NG_COL_REMOTE: @@ -294,16 +294,15 @@ resIDForCol( XP_U16 player, NewGameColumn col ) case NG_COL_PASSWD: resID = PASS_EDIT1; break; - default: - XP_ASSERT( 0 ); } + XP_ASSERT( resID != 0 ); return resID + ( player * NUM_COLS ); } /* resIDForCol */ static XP_U16 resIDForAttr( NewGameAttr attr ) { - XP_U16 resID; + XP_U16 resID = 0; switch( attr ) { case NG_ATTR_NPLAYERS: resID = IDC_NPLAYERSCOMBO; @@ -319,9 +318,8 @@ resIDForAttr( NewGameAttr attr ) case NG_ATTR_NPLAYHEADER: resID = IDC_TOTAL_LABEL; break; - default: - XP_ASSERT(0); } + XP_ASSERT( resID != 0 ); return resID; } /* resIDForAttr */ diff --git a/wince/cemain.c b/wince/cemain.c index e4e00b8f4..7b41e8343 100755 --- a/wince/cemain.c +++ b/wince/cemain.c @@ -510,6 +510,8 @@ figureBoardParms( CEAppGlobals* globals, XP_U16 nRows, CEBoardParms* bparms ) rc.right = rc.left + FORCE_WIDTH; rc.bottom = rc.top + FORCE_HEIGHT; #else +#if defined DEBUG + if ( g_dbWidth != 0 ) { rc.right = rc.left + g_dbWidth; } @@ -517,6 +519,7 @@ figureBoardParms( CEAppGlobals* globals, XP_U16 nRows, CEBoardParms* bparms ) rc.bottom = rc.top + g_dbHeight; } #endif +#endif #endif scrnWidth = (XP_U16)(rc.right - rc.left); diff --git a/wince/cestrbx.c b/wince/cestrbx.c index 79639a3b5..9811a08a6 100755 --- a/wince/cestrbx.c +++ b/wince/cestrbx.c @@ -28,7 +28,9 @@ stuffTextInField( HWND hDlg, StrBoxInit* init ) XP_U16 len, crlen; XP_UCHAR* sbuf; wchar_t* wbuf; +#ifdef MEM_DEBUG CEAppGlobals* globals = init->globals; +#endif sbuf = XP_MALLOC( globals->mpool, nBytes + 1 ); stream_getBytes( init->stream, sbuf, nBytes );