From 08326c6146c51e948bce46b940cbb01a28d61a76 Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 15 Mar 2008 14:14:39 +0000 Subject: [PATCH] add __attribute__ format and fix resulting compile warnings; add a few new WM_ strings for debugging. --- wince/ceclrsel.c | 4 ++-- wince/cedebug.c | 9 +++++++++ wince/cedict.c | 8 ++++---- wince/xptypes.h | 3 ++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/wince/ceclrsel.c b/wince/ceclrsel.c index badd7da26..02b45910a 100644 --- a/wince/ceclrsel.c +++ b/wince/ceclrsel.c @@ -161,7 +161,7 @@ EditColorsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) } wchar_t buf[64]; swprintf( buf, L"Edit color for %s", label ); - SendMessage( hDlg, WM_SETTEXT, 0, buf ); + SendMessage( hDlg, WM_SETTEXT, 0, (LPARAM)buf ); return TRUE; } else { @@ -314,9 +314,9 @@ static void wrapChooseColor( ColorsDlgState* cState, HWND parent, XP_U16 button ) { XP_U16 index = button-FIRST_BUTTON; - XP_U16 labelID = button + CLRSEL_LABEL_OFFSET; #ifdef MY_COLOR_SEL + XP_U16 labelID = button + CLRSEL_LABEL_OFFSET; COLORREF clrref = cState->colors[index]; if ( myChooseColor( cState->globals, parent, labelID, &clrref ) ) { diff --git a/wince/cedebug.c b/wince/cedebug.c index 0ee50a1c7..73d4763c6 100644 --- a/wince/cedebug.c +++ b/wince/cedebug.c @@ -62,6 +62,15 @@ messageToStr( UINT message ) CASE_STR( WM_WINDOWPOSCHANGING ); CASE_STR( WM_SETFOCUS ); CASE_STR( WM_NCPAINT ); + CASE_STR( WM_NCCALCSIZE ); + CASE_STR( WM_SETTEXT ); + CASE_STR( WM_CTLCOLORDLG ); + CASE_STR( WM_MOUSEACTIVATE ); + CASE_STR( WM_SETCURSOR ); + CASE_STR( WM_CTLCOLORLISTBOX ); + CASE_STR( WM_CTLCOLOREDIT ); + CASE_STR( WM_NCDESTROY ); + CASE_STR( WM_NOTIFY ); default: str = ""; } diff --git a/wince/cedict.c b/wince/cedict.c index 7637aac07..8a8a9a156 100755 --- a/wince/cedict.c +++ b/wince/cedict.c @@ -117,7 +117,7 @@ ce_dictionary_make( CEAppGlobals* globals, XP_UCHAR* dictName ) ctxt->super.destructor = ce_dict_destroy; ctxt->super.func_dict_getShortName = ce_dict_getShortName; - XP_DEBUGF( "ptr starting at 0x%lx", ptr ); + XP_DEBUGF( "ptr starting at 0x%p", ptr ); numFaces = (XP_U16)(*ptr++); ctxt->super.nFaces = (XP_U8)numFaces; @@ -142,12 +142,12 @@ ce_dictionary_make( CEAppGlobals* globals, XP_UCHAR* dictName ) (XP_U8*)XP_MALLOC(globals->mpool, numFaces*2); ptr += 2; /* skip xloc header */ - XP_DEBUGF( "pre values: ptr now 0x%lx", ptr ); + XP_DEBUGF( "pre values: ptr now 0x%p", ptr ); for ( i = 0; i < numFaces*2; i += 2 ) { ctxt->super.countsAndValues[i] = *ptr++; ctxt->super.countsAndValues[i+1] = *ptr++; } - XP_DEBUGF( "post values: ptr now 0x%lx", ptr ); + XP_DEBUGF( "post values: ptr now 0x%p", ptr ); ceLoadSpecialData( ctxt, &ptr ); @@ -487,7 +487,7 @@ openMappedFile( MPFORMAL const wchar_t* name, HANDLE* mappedFileP, if ( hFile != INVALID_HANDLE_VALUE ) { DWORD size = GetFileSize( hFile, NULL ); - XP_LOGF( "file size: %d", size ); + XP_LOGF( "file size: %ld", size ); ptr = XP_MALLOC( mpool, size ); if ( ptr != NULL ) { diff --git a/wince/xptypes.h b/wince/xptypes.h index 2b12d5eef..3251783cb 100755 --- a/wince/xptypes.h +++ b/wince/xptypes.h @@ -107,7 +107,8 @@ extern "C" { #endif void wince_assert(XP_UCHAR* s, int line, char* fileName ); -void wince_debugf(XP_UCHAR*, ...); +void wince_debugf(const XP_UCHAR*, ...) + __attribute__ ((format (printf, 1, 2))); void p_ignore(XP_UCHAR*, ...); XP_U16 wince_snprintf( XP_UCHAR* buf, XP_U16 len, const XP_UCHAR* format, ... );