Browse Source

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.
nfactor-troky
Sanjin Trošelj 11 years ago committed by Noel Maersk
parent
commit
cf70796196
  1. 2
      compat/jansson-2.5/src/load.c
  2. 2
      compat/jansson-2.5/src/memory.c
  3. 4
      compat/jansson-2.5/src/strbuffer.c
  4. 2
      compat/jansson-2.5/src/value.c

2
compat/jansson-2.5/src/load.c

@ -365,7 +365,7 @@ static void lex_scan_string(lex_t *lex, json_error_t *error) @@ -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;

2
compat/jansson-2.5/src/memory.c

@ -41,7 +41,7 @@ char *jsonp_strdup(const char *str) @@ -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;

4
compat/jansson-2.5/src/strbuffer.c

@ -23,7 +23,7 @@ int strbuffer_init(strbuffer_t *strbuff) @@ -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) @@ -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;

2
compat/jansson-2.5/src/value.c

@ -229,7 +229,7 @@ const char *json_object_iter_key(void *iter) @@ -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)

Loading…
Cancel
Save