From aaccd9f5db68611bc45e5e7356fee207d486cdf3 Mon Sep 17 00:00:00 2001 From: William Wong Date: Thu, 3 Apr 2014 15:09:32 +0800 Subject: [PATCH 1/2] Fix compile errors with mingw64 Fix two errors: win32.c:36:9: error: format '%s' expects argument of type 'char *', but argument 5 has type 'void **' [-Werror=format=] LOGE("%s: %s", s, msg); ^ and win32.c:47:9: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Werror=format=] LOGE("ioctlsocket failed with error: %ld\n", iResult); ^ --- src/win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/win32.c b/src/win32.c index 539a5033..c00f5f9e 100644 --- a/src/win32.c +++ b/src/win32.c @@ -33,7 +33,7 @@ void ss_error(const char *s) MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &msg, 0, NULL); if (msg != NULL) { - LOGE("%s: %s", s, msg); + LOGE("%s: %s", s, (char *)msg); LocalFree(msg); } } @@ -41,7 +41,7 @@ void ss_error(const char *s) int setnonblocking(int fd) { u_long iMode = 0; - int iResult; + long int iResult; iResult = ioctlsocket(fd, FIONBIO, &iMode); if (iResult != NO_ERROR) { LOGE("ioctlsocket failed with error: %ld\n", iResult); From 1948330bc26428aba15874448dedd08aac02728c Mon Sep 17 00:00:00 2001 From: William Wong Date: Thu, 3 Apr 2014 15:11:31 +0800 Subject: [PATCH 2/2] Fix a compile error with mingw64 Fix an error below. json.c:135:42: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] (state, values_size + ((unsigned long) value->u.object.values), 0)) ) ^ --- src/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json.c b/src/json.c index 5ab52c5b..e2cf057d 100644 --- a/src/json.c +++ b/src/json.c @@ -132,7 +132,7 @@ static int new_value values_size = sizeof (*value->u.object.values) * value->u.object.length; if (! ((*(void **) &value->u.object.values) = json_alloc - (state, values_size + ((unsigned long) value->u.object.values), 0)) ) + (state, values_size + ((unsigned long long) value->u.object.values), 0)) ) { return 0; }