Browse Source

Use more appropriate casts

tags/json-c-0.13-20171207
James Myatt 10 years ago
parent
commit
18b3c49296
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      json_object.c
  2. +1
    -1
      linkhash.c

+ 3
- 3
json_object.c View File

@@ -409,7 +409,7 @@ void json_object_object_add(struct json_object* jso, const char *key,
lh_table_insert(jso->o.c_object, strdup(key), val);
return;
}
existing_value = (void *)existing_entry->v;
existing_value = (json_object *)existing_entry->v;
if (existing_value)
json_object_put(existing_value);
existing_entry->v = val;
@@ -661,8 +661,8 @@ struct json_object* json_object_new_double_s(double d, const char *ds)
int json_object_userdata_to_json_string(struct json_object *jso,
struct printbuf *pb, int level, int flags)
{
int userdata_len = strlen(jso->_userdata);
printbuf_memappend(pb, jso->_userdata, userdata_len);
int userdata_len = strlen((const char *)jso->_userdata);
printbuf_memappend(pb, (const char *)jso->_userdata, userdata_len);
return userdata_len;
}



+ 1
- 1
linkhash.c View File

@@ -415,7 +415,7 @@ unsigned long lh_char_hash(const void *k)
#if defined __GNUC__
__sync_val_compare_and_swap(&random_seed, -1, seed);
#elif defined _MSC_VER
InterlockedCompareExchange(&random_seed, seed, -1);
InterlockedCompareExchange((LONG *)&random_seed, seed, -1);
#else
#warning "racy random seed initializtion if used by multiple threads"
random_seed = seed; /* potentially racy */


Loading…
Cancel
Save