diff --git a/xwords4/wince/Makefile b/xwords4/wince/Makefile index 1599cddfe..35d348821 100644 --- a/xwords4/wince/Makefile +++ b/xwords4/wince/Makefile @@ -53,7 +53,9 @@ CFLAGS += -DCANT_DO_CMDBAR -DBEYOND_IR -DDRAW_LINK_DIRECT endif endif -CFLAGS += -DARM -I$(MINGW_INC_PATH) -I./ -I../common -I../relay +CFLAGS += -DARM -I$(MINGW_INC_PATH) -I./ -I../common -I../relay + +CFLAGS += -Wall # warn upgrading users of new dict location CFLAGS += -DDICTS_MOVED_ALERT diff --git a/xwords4/wince/ceaskpwd.c b/xwords4/wince/ceaskpwd.c index 0c9d28b73..d4eda9b25 100755 --- a/xwords4/wince/ceaskpwd.c +++ b/xwords4/wince/ceaskpwd.c @@ -20,6 +20,7 @@ #include "ceaskpwd.h" #include "cemain.h" #include "ceutil.h" +#include /* swprintf */ static void nameToLabel( HWND hDlg, const XP_UCHAR* name, XP_U16 labelID ) diff --git a/xwords4/wince/cedict.c b/xwords4/wince/cedict.c index b76596716..893eaf80a 100755 --- a/xwords4/wince/cedict.c +++ b/xwords4/wince/cedict.c @@ -19,6 +19,9 @@ #ifndef STUBBED_DICT +#include /* _snwprintf */ +#include /* _snwprintf */ + #include "stdafx.h" #include #include "dictnryp.h" @@ -432,10 +435,10 @@ openMappedFile( MPFORMAL const wchar_t* name, HANDLE* mappedFileP, HANDLE* hFileP, XP_U32* sizep ) { XP_U8* ptr = NULL; - HANDLE mappedFile = NULL; HANDLE hFile; -#if defined TARGET_OS_WINCE +#if defined _WIN32_WCE + HANDLE mappedFile = NULL; hFile = CreateFileForMapping( name, GENERIC_READ, FILE_SHARE_READ, /* (was 0: no sharing) */ @@ -608,8 +611,6 @@ locateOneDir( MPFORMAL wchar_t* path, OnePathCB cb, void* ctxt, XP_U16 nSought, } } else if ( checkIfDictAndLegal( MPPARM(mpool) path, startLen, data.cFileName ) ) { - XP_U16 len; - XP_UCHAR buf[CE_MAX_PATH_LEN+1]; XP_ASSERT( *nFoundP < nSought ); lstrcpy( path+startLen, data.cFileName ); @@ -812,8 +813,6 @@ static XP_Bool findAlternateDict( CEAppGlobals* globals, wchar_t* path ) { wchar_t shortPath[CE_MAX_PATH_LEN+1]; - wchar_t* shortName; - XP_U16 nFound; FindOneData data; XP_MEMSET( &data, 0, sizeof(data) ); @@ -862,7 +861,6 @@ bname( XP_UCHAR* in ) wchar_t* wbname( wchar_t* buf, XP_U16 buflen, const wchar_t* in ) { - int len; wchar_t* result; _snwprintf( buf, buflen, L"%s", in ); diff --git a/xwords4/wince/ceginfo.c b/xwords4/wince/ceginfo.c index bd4ade20e..7ad01b904 100755 --- a/xwords4/wince/ceginfo.c +++ b/xwords4/wince/ceginfo.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include /* swprintf */ #include "ceginfo.h" #include "cemain.h" #include "ceutil.h" @@ -175,7 +176,6 @@ loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState ) #ifndef XWFEATURE_STANDALONE_ONLY wchar_t* roles[] = { L"Standalone", L"Host", L"Guest" }; #endif - XP_UCHAR* str; giState->curServerHilite = gi->serverRole; diff --git a/xwords4/wince/cemain.c b/xwords4/wince/cemain.c index fe5770433..86f35464f 100755 --- a/xwords4/wince/cemain.c +++ b/xwords4/wince/cemain.c @@ -24,6 +24,7 @@ #include #include #include +#include /* time() */ #include #ifdef _WIN32_WCE # include @@ -135,7 +136,6 @@ static void ce_util_engineStarting( XW_UtilCtxt* uc ); static void ce_util_engineStopping( XW_UtilCtxt* uc ); #endif -static void notImpl( CEAppGlobals* globals ); static void messageBoxChar( CEAppGlobals* globals, XP_UCHAR* str, wchar_t* title ); static XP_Bool queryBoxChar( CEAppGlobals* globals, XP_UCHAR* msg ); @@ -435,7 +435,7 @@ figureBoardParms( CEAppGlobals* globals, XP_U16 nRows, CEBoardParms* bparms ) XP_U16 scrnWidth, scrnHeight; XP_U16 trayVScale, boardLeft, scoreWidth, scoreHeight; XP_U16 boardHt, boardWidth, hScale, vScale, nVisibleRows; - XP_U16 boardHtLimit, trayTop, boardTop; + XP_U16 trayTop, boardTop; XP_Bool horiz; XP_U16 trayWidth; XP_U16 scrollWidth = 0; @@ -702,7 +702,7 @@ logLastError( const char* comment ) XP_U16 len; XP_U16 lenSoFar; - sprintf( msg, "%s (err: %d): ", comment, lastErr ); + sprintf( msg, "%s (err: %ld): ", comment, lastErr ); lenSoFar = strlen( msg ); FormatMessage( @@ -1604,10 +1604,10 @@ ceConfirmAndSave( CEAppGlobals* globals ) return confirmed; } /* ceConfirmAndSave */ +#ifdef _WIN32_WCE static HWND makeCommandBar( HWND hwnd, HINSTANCE hInst ) { -#ifdef _WIN32_WCE SHMENUBARINFO mbi; XP_MEMSET( &mbi, 0, sizeof(mbi) ); @@ -1623,10 +1623,8 @@ makeCommandBar( HWND hwnd, HINSTANCE hInst ) } return mbi.hwndMB; -#else - return NULL; -#endif } /* makeCommandBar */ +#endif #ifdef CEFEATURE_CANSCROLL static XP_Bool @@ -2018,12 +2016,6 @@ About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } /* About */ -static void -notImpl( CEAppGlobals* globals ) -{ - messageBoxChar( globals, "feature not implemented", NULL ); -} /* notImpl */ - static XP_Bool ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream, wchar_t* title, XP_Bool isQuery, XP_Bool destroy ) @@ -2103,15 +2095,6 @@ queryBoxChar( CEAppGlobals* globals, XP_UCHAR* msg ) return answer == IDOK || answer == IDYES; } /* queryBoxChar */ -static XP_Bool -queryBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream ) -{ - XP_UCHAR* buf = ceStreamToStrBuf( MPPARM(globals->mpool) stream ); - XP_Bool result = queryBoxChar( globals, buf ); - XP_FREE( globals->mpool, buf ); - return result; -} /* queryBoxStream */ - static XP_Bool ceQueryFromStream( CEAppGlobals* globals, XWStreamCtxt* stream ) { @@ -2154,7 +2137,6 @@ wince_debugf(XP_UCHAR* format, ...) { #ifdef BEYOND_IR static HANDLE s_logMutex = NULL; - DWORD wres; #endif XP_UCHAR buf[256]; XP_UCHAR timeStamp[32]; @@ -2345,10 +2327,7 @@ static XP_Bool ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream ) { char* query = NULL; - char* info = NULL; CEAppGlobals* globals = (CEAppGlobals*)uc->closure; - XP_Bool answer = XP_FALSE; - XP_Bool queryWithStream = XP_FALSE; switch( id ) { case QUERY_COMMIT_TURN: diff --git a/xwords4/wince/ceprefs.c b/xwords4/wince/ceprefs.c index 7b12d0cde..1306e56ce 100755 --- a/xwords4/wince/ceprefs.c +++ b/xwords4/wince/ceprefs.c @@ -190,7 +190,7 @@ loadControlsFromState( HWND hDlg, CePrefsDlgState* pState ) ceSetChecked( hDlg, IDC_CHECKHINTSLIMITS, prefsPrefs->gp.allowHintRect ); #endif /* timer */ - sprintf( numBuf, "%d", prefsPrefs->gp.gameSeconds / 60 ); + snprintf( numBuf, sizeof(numBuf), "%d", prefsPrefs->gp.gameSeconds / 60 ); ceSetDlgItemText( hDlg, TIMER_EDIT, numBuf ); setTimerCtls( hDlg, prefsPrefs->gp.timerEnabled );