add __attribute__ format and fix resulting compile warnings; add a few

new WM_ strings for debugging.
This commit is contained in:
ehouse 2008-03-15 14:14:39 +00:00
parent 4beb818de3
commit 439dd4d84a
4 changed files with 17 additions and 7 deletions

View file

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

View file

@ -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 = "<unknown>";
}

View file

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

View file

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