mirror of
https://github.com/json-c/json-c.git
synced 2026-04-08 23:09:07 +08:00
Declare variables earlier, to appease Visual Studio 2010.
This commit is contained in:
@@ -665,10 +665,11 @@ static void json_object_object_delete(struct json_object_base *jso_base)
|
|||||||
struct json_object *json_object_new_object(void)
|
struct json_object *json_object_new_object(void)
|
||||||
{
|
{
|
||||||
struct json_object_base *jso_base;
|
struct json_object_base *jso_base;
|
||||||
|
struct json_object_object *jso;
|
||||||
jso_base = JSON_OBJECT_NEW(object, &json_object_object_delete);
|
jso_base = JSON_OBJECT_NEW(object, &json_object_object_delete);
|
||||||
if (!jso_base)
|
if (!jso_base)
|
||||||
return NULL;
|
return NULL;
|
||||||
struct json_object_object *jso = (struct json_object_object *)jso_base;
|
jso = (struct json_object_object *)jso_base;
|
||||||
jso->c_object =
|
jso->c_object =
|
||||||
lh_kchar_table_new(JSON_OBJECT_DEF_HASH_ENTRIES, &json_object_lh_entry_free);
|
lh_kchar_table_new(JSON_OBJECT_DEF_HASH_ENTRIES, &json_object_lh_entry_free);
|
||||||
if (!jso->c_object)
|
if (!jso->c_object)
|
||||||
@@ -805,10 +806,11 @@ static int json_object_boolean_to_json_string(struct json_object *jso, struct pr
|
|||||||
struct json_object *json_object_new_boolean(json_bool b)
|
struct json_object *json_object_new_boolean(json_bool b)
|
||||||
{
|
{
|
||||||
struct json_object_base *jso_base;
|
struct json_object_base *jso_base;
|
||||||
|
struct json_object_boolean *jso;
|
||||||
jso_base = JSON_OBJECT_NEW(boolean, &json_object_generic_delete);
|
jso_base = JSON_OBJECT_NEW(boolean, &json_object_generic_delete);
|
||||||
if (!jso_base)
|
if (!jso_base)
|
||||||
return NULL;
|
return NULL;
|
||||||
struct json_object_boolean *jso = (struct json_object_boolean *)jso_base;
|
jso = (struct json_object_boolean *)jso_base;
|
||||||
jso->c_boolean = b;
|
jso->c_boolean = b;
|
||||||
return PUBLIC(jso_base);
|
return PUBLIC(jso_base);
|
||||||
}
|
}
|
||||||
@@ -1549,10 +1551,11 @@ static void json_object_array_delete(struct json_object *jso)
|
|||||||
struct json_object *json_object_new_array(void)
|
struct json_object *json_object_new_array(void)
|
||||||
{
|
{
|
||||||
struct json_object_base *jso_base;
|
struct json_object_base *jso_base;
|
||||||
|
struct json_object_array *jso;
|
||||||
jso_base = JSON_OBJECT_NEW(array, &json_object_array_delete);
|
jso_base = JSON_OBJECT_NEW(array, &json_object_array_delete);
|
||||||
if (!jso_base)
|
if (!jso_base)
|
||||||
return NULL;
|
return NULL;
|
||||||
struct json_object_array *jso = (struct json_object_array *)jso_base;
|
jso = (struct json_object_array *)jso_base;
|
||||||
jso->c_array = array_list_new(&json_object_array_entry_free);
|
jso->c_array = array_list_new(&json_object_array_entry_free);
|
||||||
if (jso->c_array == NULL)
|
if (jso->c_array == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user