From 2436e41e635fe42aa3a96198b6c5e2a612485082 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 11 Aug 2014 09:17:56 +0200 Subject: [PATCH] Fixed warnings for comm tests. --- winpr/libwinpr/comm/test/TestCommConfig.c | 4 ++-- winpr/libwinpr/comm/test/TestControlSettings.c | 12 ++++++------ winpr/libwinpr/comm/test/TestGetCommState.c | 2 +- winpr/libwinpr/comm/test/TestHandflow.c | 2 +- winpr/libwinpr/comm/test/TestSerialChars.c | 10 +++++----- winpr/libwinpr/comm/test/TestSetCommState.c | 8 ++++---- winpr/libwinpr/comm/test/TestTimeouts.c | 10 +++++----- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/winpr/libwinpr/comm/test/TestCommConfig.c b/winpr/libwinpr/comm/test/TestCommConfig.c index b60abd885..4d667ee7e 100644 --- a/winpr/libwinpr/comm/test/TestCommConfig.c +++ b/winpr/libwinpr/comm/test/TestCommConfig.c @@ -78,7 +78,7 @@ int TestCommConfig(int argc, char* argv[]) if (!hComm || (hComm == INVALID_HANDLE_VALUE)) { - fprintf(stderr, "CreateFileA failure: %s GetLastError() = 0x%0.8x\n", lpFileName, GetLastError()); + fprintf(stderr, "CreateFileA failure: %s GetLastError() = 0x%08x\n", lpFileName, GetLastError()); return EXIT_FAILURE; } @@ -100,7 +100,7 @@ int TestCommConfig(int argc, char* argv[]) ZeroMemory(&commProp, sizeof(COMMPROP)); if (!GetCommProperties(hComm, &commProp)) { - fprintf(stderr, "GetCommProperties failure: GetLastError(): 0x%0.8x\n", GetLastError()); + fprintf(stderr, "GetCommProperties failure: GetLastError(): 0x%08x\n", GetLastError()); return EXIT_FAILURE; } diff --git a/winpr/libwinpr/comm/test/TestControlSettings.c b/winpr/libwinpr/comm/test/TestControlSettings.c index becdae2d0..07b70117f 100644 --- a/winpr/libwinpr/comm/test/TestControlSettings.c +++ b/winpr/libwinpr/comm/test/TestControlSettings.c @@ -61,7 +61,7 @@ int TestControlSettings(int argc, char* argv[]) dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) { - fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError()); + fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError()); return FALSE; } @@ -73,7 +73,7 @@ int TestControlSettings(int argc, char* argv[]) if (!SetCommState(hComm, &dcb)) { - fprintf(stderr, "SetCommState failure; GetLastError(): %0.8x\n", GetLastError()); + fprintf(stderr, "SetCommState failure; GetLastError(): %08x\n", GetLastError()); return FALSE; } @@ -81,7 +81,7 @@ int TestControlSettings(int argc, char* argv[]) dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) { - fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError()); + fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError()); return FALSE; } @@ -100,7 +100,7 @@ int TestControlSettings(int argc, char* argv[]) if (!SetCommState(hComm, &dcb)) { - fprintf(stderr, "SetCommState failure; GetLastError(): %0.8x\n", GetLastError()); + fprintf(stderr, "SetCommState failure; GetLastError(): %08x\n", GetLastError()); return FALSE; } @@ -108,7 +108,7 @@ int TestControlSettings(int argc, char* argv[]) dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) { - fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError()); + fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError()); return FALSE; } @@ -121,7 +121,7 @@ int TestControlSettings(int argc, char* argv[]) if (!CloseHandle(hComm)) { - fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError()); + fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); return EXIT_FAILURE; } diff --git a/winpr/libwinpr/comm/test/TestGetCommState.c b/winpr/libwinpr/comm/test/TestGetCommState.c index 3c9da67b5..2a80a5219 100644 --- a/winpr/libwinpr/comm/test/TestGetCommState.c +++ b/winpr/libwinpr/comm/test/TestGetCommState.c @@ -129,7 +129,7 @@ int TestGetCommState(int argc, char* argv[]) if (!CloseHandle(hComm)) { - fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError()); + fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); return EXIT_FAILURE; } diff --git a/winpr/libwinpr/comm/test/TestHandflow.c b/winpr/libwinpr/comm/test/TestHandflow.c index 6cdbfb673..10cb20a13 100644 --- a/winpr/libwinpr/comm/test/TestHandflow.c +++ b/winpr/libwinpr/comm/test/TestHandflow.c @@ -88,7 +88,7 @@ int TestHandflow(int argc, char* argv[]) if (!CloseHandle(hComm)) { - fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError()); + fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); return EXIT_FAILURE; } diff --git a/winpr/libwinpr/comm/test/TestSerialChars.c b/winpr/libwinpr/comm/test/TestSerialChars.c index d1a75c9c5..50912bb09 100644 --- a/winpr/libwinpr/comm/test/TestSerialChars.c +++ b/winpr/libwinpr/comm/test/TestSerialChars.c @@ -48,7 +48,7 @@ static BOOL test_SerCxSys(HANDLE hComm) dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) { - fprintf(stderr, "GetCommState failure, GetLastError(): 0x%0.8x\n", GetLastError()); + fprintf(stderr, "GetCommState failure, GetLastError(): 0x%08x\n", GetLastError()); return FALSE; } @@ -74,7 +74,7 @@ static BOOL test_SerCxSys(HANDLE hComm) dcb.XoffChar = XonChar; if (!SetCommState(hComm, &dcb)) { - fprintf(stderr, "SetCommState failure, GetLastError(): 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommState failure, GetLastError(): 0x%08x\n", GetLastError()); return FALSE; } @@ -82,7 +82,7 @@ static BOOL test_SerCxSys(HANDLE hComm) dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) { - fprintf(stderr, "GetCommState failure, GetLastError(): 0x%0.8x\n", GetLastError()); + fprintf(stderr, "GetCommState failure, GetLastError(): 0x%08x\n", GetLastError()); return FALSE; } @@ -117,7 +117,7 @@ static BOOL test_SerCx2Sys(HANDLE hComm) dcb.DCBlength = sizeof(DCB); if (!GetCommState(hComm, &dcb)) { - fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError()); + fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError()); return FALSE; } @@ -175,7 +175,7 @@ int TestSerialChars(int argc, char* argv[]) if (!CloseHandle(hComm)) { - fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError()); + fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); return EXIT_FAILURE; } diff --git a/winpr/libwinpr/comm/test/TestSetCommState.c b/winpr/libwinpr/comm/test/TestSetCommState.c index 63dbdfda8..b1e825a5a 100644 --- a/winpr/libwinpr/comm/test/TestSetCommState.c +++ b/winpr/libwinpr/comm/test/TestSetCommState.c @@ -137,7 +137,7 @@ static BOOL test_SerialSys(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08x\n", GetLastError()); return FALSE; } @@ -207,7 +207,7 @@ static BOOL test_SerCxSys(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08x\n", GetLastError()); return FALSE; } @@ -284,7 +284,7 @@ static BOOL test_generic(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08x\n", GetLastError()); return FALSE; } @@ -389,7 +389,7 @@ int TestSetCommState(int argc, char* argv[]) if (!CloseHandle(hComm)) { - fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError()); + fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); return EXIT_FAILURE; } diff --git a/winpr/libwinpr/comm/test/TestTimeouts.c b/winpr/libwinpr/comm/test/TestTimeouts.c index 652bd47be..0ddf2775a 100644 --- a/winpr/libwinpr/comm/test/TestTimeouts.c +++ b/winpr/libwinpr/comm/test/TestTimeouts.c @@ -41,14 +41,14 @@ static BOOL test_generic(HANDLE hComm) if (!SetCommTimeouts(hComm, &timeouts)) { - fprintf(stderr, "SetCommTimeouts failure, GetLastError: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommTimeouts failure, GetLastError: 0x%08x\n", GetLastError()); return FALSE; } ZeroMemory(&timeouts2, sizeof(COMMTIMEOUTS)); if (!GetCommTimeouts(hComm, &timeouts2)) { - fprintf(stderr, "GetCommTimeouts failure, GetLastError: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "GetCommTimeouts failure, GetLastError: 0x%08x\n", GetLastError()); return FALSE; } @@ -63,13 +63,13 @@ static BOOL test_generic(HANDLE hComm) timeouts.ReadTotalTimeoutConstant = MAXULONG; if (SetCommTimeouts(hComm, &timeouts)) { - fprintf(stderr, "SetCommTimeouts succeeded with ReadIntervalTimeout and ReadTotalTimeoutConstant set to MAXULONG. GetLastError: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommTimeouts succeeded with ReadIntervalTimeout and ReadTotalTimeoutConstant set to MAXULONG. GetLastError: 0x%08x\n", GetLastError()); return FALSE; } if (GetLastError() != ERROR_INVALID_PARAMETER) { - fprintf(stderr, "SetCommTimeouts failure, expected GetLastError to return ERROR_INVALID_PARAMETER and got: 0x%0.8x\n", GetLastError()); + fprintf(stderr, "SetCommTimeouts failure, expected GetLastError to return ERROR_INVALID_PARAMETER and got: 0x%08x\n", GetLastError()); return FALSE; } @@ -128,7 +128,7 @@ int TestTimeouts(int argc, char* argv[]) if (!CloseHandle(hComm)) { - fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError()); + fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError()); return EXIT_FAILURE; }