summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2020-05-25 04:10:11 +0000
committerEric Haszlakiewicz <erh+git@nimenees.com>2020-05-25 04:10:11 +0000
commit0351bb55c85ab8db545327af3d872fb63e2838b1 (patch)
tree3fbbaf308d651fedbc1a126d9b7c5289b39bf7d5
parentd1f83bf5eab331e3014f04e856bcb3662da1199f (diff)
downloadjson-c-0351bb55c85ab8db545327af3d872fb63e2838b1.tar.gz
Declare variables earlier, to appease Visual Studio 2010.
-rw-r--r--json_object.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/json_object.c b/json_object.c
index b2d8d18..f648c5c 100644
--- a/json_object.c
+++ b/json_object.c
@@ -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_base *jso_base;
+ struct json_object_object *jso;
jso_base = JSON_OBJECT_NEW(object, &json_object_object_delete);
if (!jso_base)
return NULL;
- struct json_object_object *jso = (struct json_object_object *)jso_base;
+ jso = (struct json_object_object *)jso_base;
jso->c_object =
lh_kchar_table_new(JSON_OBJECT_DEF_HASH_ENTRIES, &json_object_lh_entry_free);
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_base *jso_base;
+ struct json_object_boolean *jso;
jso_base = JSON_OBJECT_NEW(boolean, &json_object_generic_delete);
if (!jso_base)
return NULL;
- struct json_object_boolean *jso = (struct json_object_boolean *)jso_base;
+ jso = (struct json_object_boolean *)jso_base;
jso->c_boolean = b;
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_base *jso_base;
+ struct json_object_array *jso;
jso_base = JSON_OBJECT_NEW(array, &json_object_array_delete);
if (!jso_base)
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);
if (jso->c_array == NULL)
{