Turn on -Wall for compilers, and fix warnings that result. Got 'em

all for win32 build, but some remain for wince that I'm unable to fix.
This commit is contained in:
ehouse 2006-05-12 07:17:35 +00:00
parent 543df9f681
commit 73b244e11f
6 changed files with 16 additions and 36 deletions

View file

@ -55,6 +55,8 @@ endif
CFLAGS += -DARM -I$(MINGW_INC_PATH) -I./ -I../common -I../relay
CFLAGS += -Wall
# warn upgrading users of new dict location
CFLAGS += -DDICTS_MOVED_ALERT

View file

@ -20,6 +20,7 @@
#include "ceaskpwd.h"
#include "cemain.h"
#include "ceutil.h"
#include <stdio.h> /* swprintf */
static void
nameToLabel( HWND hDlg, const XP_UCHAR* name, XP_U16 labelID )

View file

@ -19,6 +19,9 @@
#ifndef STUBBED_DICT
#include <stdio.h> /* _snwprintf */
#include <string.h> /* _snwprintf */
#include "stdafx.h"
#include <commdlg.h>
#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 );

View file

@ -18,6 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdio.h> /* 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;

View file

@ -24,6 +24,7 @@
#include <commctrl.h>
#include <commdlg.h>
#include <stdio.h>
#include <time.h> /* time() */
#include <winuser.h>
#ifdef _WIN32_WCE
# include <aygshell.h>
@ -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:

View file

@ -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 );