From cf70796196b2a12b5bf02d96acda35035bd5e7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sanjin=20Tro=C5=A1elj?= Date: Mon, 27 Jan 2014 18:22:40 +0100 Subject: [PATCH] VS2010 build: Prepare compat/jansson-2.5. Cherry-picked by veox. Not a big fan of modifying compat libraries, makes it harder to maintain later on. See if these changes are relevant upstream. --- compat/jansson-2.5/src/load.c | 2 +- compat/jansson-2.5/src/memory.c | 2 +- compat/jansson-2.5/src/strbuffer.c | 4 ++-- compat/jansson-2.5/src/value.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compat/jansson-2.5/src/load.c b/compat/jansson-2.5/src/load.c index c5536f58..41c766c2 100644 --- a/compat/jansson-2.5/src/load.c +++ b/compat/jansson-2.5/src/load.c @@ -365,7 +365,7 @@ static void lex_scan_string(lex_t *lex, json_error_t *error) - two \uXXXX escapes (length 12) forming an UTF-16 surrogate pair are converted to 4 bytes */ - lex->value.string = jsonp_malloc(lex->saved_text.length + 1); + lex->value.string = (char *)jsonp_malloc(lex->saved_text.length + 1); if(!lex->value.string) { /* this is not very nice, since TOKEN_INVALID is returned */ goto out; diff --git a/compat/jansson-2.5/src/memory.c b/compat/jansson-2.5/src/memory.c index eb6cec54..b1f6edc7 100644 --- a/compat/jansson-2.5/src/memory.c +++ b/compat/jansson-2.5/src/memory.c @@ -41,7 +41,7 @@ char *jsonp_strdup(const char *str) if(len == (size_t)-1) return NULL; - new_str = jsonp_malloc(len + 1); + new_str = (char *)jsonp_malloc(len + 1); if(!new_str) return NULL; diff --git a/compat/jansson-2.5/src/strbuffer.c b/compat/jansson-2.5/src/strbuffer.c index 2d6ff310..a863fa08 100644 --- a/compat/jansson-2.5/src/strbuffer.c +++ b/compat/jansson-2.5/src/strbuffer.c @@ -23,7 +23,7 @@ int strbuffer_init(strbuffer_t *strbuff) strbuff->size = STRBUFFER_MIN_SIZE; strbuff->length = 0; - strbuff->value = jsonp_malloc(strbuff->size); + strbuff->value = (char *)jsonp_malloc(strbuff->size); if(!strbuff->value) return -1; @@ -86,7 +86,7 @@ int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size) new_size = max(strbuff->size * STRBUFFER_FACTOR, strbuff->length + size + 1); - new_value = jsonp_malloc(new_size); + new_value = (char *)jsonp_malloc(new_size); if(!new_value) return -1; diff --git a/compat/jansson-2.5/src/value.c b/compat/jansson-2.5/src/value.c index 582849be..cc2e3f9d 100644 --- a/compat/jansson-2.5/src/value.c +++ b/compat/jansson-2.5/src/value.c @@ -229,7 +229,7 @@ const char *json_object_iter_key(void *iter) if(!iter) return NULL; - return hashtable_iter_key(iter); + return (char *)hashtable_iter_key(iter); } json_t *json_object_iter_value(void *iter)