From 650ea8662fa85d7e35755f1dcf75d9dcb6075dbc Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 16 Jun 2012 11:57:18 +0400 Subject: [PATCH] cord tests: Suppress GCC warnings in 'de' app * cord/tests/de.c (retrieve_line): Change type of "eol" local variable from int to size_t (to prevent "comparison between signed and unsigned" compiler warning). * cord/tests/de_win.c (WinMain): Cast GetLastError() result to unsigned int (to match printf format specifier). * cord/tests/de_win.c (AboutBoxCallback): Suppress "unused parameter" compiler warning for "lParam" (by casting the later to void). --- cord/tests/de.c | 2 +- cord/tests/de_win.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cord/tests/de.c b/cord/tests/de.c index f08167bc..068848c4 100644 --- a/cord/tests/de.c +++ b/cord/tests/de.c @@ -242,7 +242,7 @@ CORD retrieve_line(CORD s, size_t pos, unsigned column) { CORD candidate = CORD_substr(s, pos, column + COLS); /* avoids scanning very long lines */ - int eol = CORD_chr(candidate, 0, '\n'); + size_t eol = CORD_chr(candidate, 0, '\n'); int len; if (eol == CORD_NOT_FOUND) eol = CORD_len(candidate); diff --git a/cord/tests/de_win.c b/cord/tests/de_win.c index a49f8179..1179b8f7 100644 --- a/cord/tests/de_win.c +++ b/cord/tests/de_win.c @@ -69,7 +69,8 @@ int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, if (RegisterClass (&wndclass) == 0) { char buf[50]; - sprintf(buf, "RegisterClass: error code: 0x%X", GetLastError()); + sprintf(buf, "RegisterClass: error code: 0x%X", + (unsigned)GetLastError()); de_error(buf); return(0); } @@ -104,7 +105,8 @@ int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, if (hwnd == NULL) { char buf[50]; - sprintf(buf, "CreateWindow: error code: 0x%X", GetLastError()); + sprintf(buf, "CreateWindow: error code: 0x%X", + (unsigned)GetLastError()); de_error(buf); return(0); } @@ -179,6 +181,7 @@ void update_cursor(void); INT_PTR CALLBACK AboutBoxCallback( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { + (void)lParam; switch( message ) { case WM_INITDIALOG: -- 2.40.0