]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Missing explicit casts from void* to specific pointers required. Added #define strcas... 29/head
authorMateusz Loskot <mateusz@loskot.net>
Tue, 22 May 2012 22:51:44 +0000 (23:51 +0100)
committerMateusz Loskot <mateusz@loskot.net>
Tue, 22 May 2012 22:51:44 +0000 (23:51 +0100)
json_object.c
tests/parse_flags.c
tests/test1.c

index 8e399deacf2d345f6647deaeab0ed8fbfad3c269..2258c02d2486672e34c921b66878b13b72659a1e 100644 (file)
@@ -538,7 +538,7 @@ struct json_object* json_object_new_string_len(const char *s, int len)
   if(!jso) return NULL;
   jso->_delete = &json_object_string_delete;
   jso->_to_json_string = &json_object_string_to_json_string;
-  jso->o.c_string.str = malloc(len);
+  jso->o.c_string.str = (char*)malloc(len);
   memcpy(jso->o.c_string.str, (void *)s, len);
   jso->o.c_string.len = len;
   return jso;
index fafabc8f37dfe90dccbf7b8e7c16045a596da606..e33ffee3b83436d161b0abf69663b41ab411f3c7 100644 (file)
@@ -1,9 +1,17 @@
+#include "config.h"
+
 #include <stdio.h>
 #include <string.h>
 
 #include "json.h"
 #include "parse_flags.h"
 
+#if !defined(HAVE_STRCASECMP) && defined(_MSC_VER)
+# define strcasecmp _stricmp
+#elif !defined(HAVE_STRCASECMP)
+# error You do not have strcasecmp on your system.
+#endif /* HAVE_STRNCASECMP */
+
 static struct {
        const char *arg;
        int flag;
index 9802eb10d305f73f549421b472483d21bc6b52d6..87d7ea47c3bac09d0158fe08dba9b412e41c6d4d 100644 (file)
@@ -12,8 +12,8 @@ static int sort_fn (const void *j1, const void *j2)
   json_object * const *jso1, * const *jso2;
   int i1, i2;
 
-  jso1 = j1;
-  jso2 = j2;
+  jso1 = (json_object* const*)j1;
+  jso2 = (json_object* const*)j2;
   if (!*jso1 && !*jso2) {
     return 0;
   }