mirror of
https://github.com/json-c/json-c.git
synced 2026-04-08 23:09:07 +08:00
Use more appropriate casts
This commit is contained in:
@@ -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);
|
lh_table_insert(jso->o.c_object, strdup(key), val);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
existing_value = (void *)existing_entry->v;
|
existing_value = (json_object *)existing_entry->v;
|
||||||
if (existing_value)
|
if (existing_value)
|
||||||
json_object_put(existing_value);
|
json_object_put(existing_value);
|
||||||
existing_entry->v = val;
|
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,
|
int json_object_userdata_to_json_string(struct json_object *jso,
|
||||||
struct printbuf *pb, int level, int flags)
|
struct printbuf *pb, int level, int flags)
|
||||||
{
|
{
|
||||||
int userdata_len = strlen(jso->_userdata);
|
int userdata_len = strlen((const char *)jso->_userdata);
|
||||||
printbuf_memappend(pb, jso->_userdata, userdata_len);
|
printbuf_memappend(pb, (const char *)jso->_userdata, userdata_len);
|
||||||
return userdata_len;
|
return userdata_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ unsigned long lh_char_hash(const void *k)
|
|||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
__sync_val_compare_and_swap(&random_seed, -1, seed);
|
__sync_val_compare_and_swap(&random_seed, -1, seed);
|
||||||
#elif defined _MSC_VER
|
#elif defined _MSC_VER
|
||||||
InterlockedCompareExchange(&random_seed, seed, -1);
|
InterlockedCompareExchange((LONG *)&random_seed, seed, -1);
|
||||||
#else
|
#else
|
||||||
#warning "racy random seed initializtion if used by multiple threads"
|
#warning "racy random seed initializtion if used by multiple threads"
|
||||||
random_seed = seed; /* potentially racy */
|
random_seed = seed; /* potentially racy */
|
||||||
|
|||||||
Reference in New Issue
Block a user