diff options
author | Jonathan Beck | 2009-02-09 20:39:14 +0100 |
---|---|---|
committer | Jonathan Beck | 2009-02-09 21:02:56 +0100 |
commit | fa4a22dde897c0e2a8cc89b7479f0513c9455d37 (patch) | |
tree | 877b0140a133fb34c821ff70bde1a4a8c6ef5ab1 /src/plist.c | |
parent | ff1fa73f33e9223e69cbb71e70b084e3482dce3f (diff) | |
download | libplist-fa4a22dde897c0e2a8cc89b7479f0513c9455d37.tar.gz libplist-fa4a22dde897c0e2a8cc89b7479f0513c9455d37.tar.bz2 |
Make it compile on MSVC 2005.
Diffstat (limited to 'src/plist.c')
-rw-r--r-- | src/plist.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/plist.c b/src/plist.c index 758fe53..87a1de5 100644 --- a/src/plist.c +++ b/src/plist.c @@ -77,15 +77,17 @@ static plist_t plist_add_sub_element(plist_t node, plist_type type, const void * if (node_type == PLIST_DICT || node_type == PLIST_ARRAY) { //only structured types are allowed to have nulll value if (value || (!value && (type == PLIST_DICT || type == PLIST_ARRAY))) { - //now handle value - plist_data_t data = plist_new_plist_data(); - data->type = type; - data->length = length; glong len = 0; glong items_read = 0; glong items_written = 0; GError *error = NULL; + plist_t subnode = NULL; + + //now handle value + plist_data_t data = plist_new_plist_data(); + data->type = type; + data->length = length; switch (type) { case PLIST_BOOLEAN: @@ -119,7 +121,7 @@ static plist_t plist_add_sub_element(plist_t node, plist_type type, const void * break; } - plist_t subnode = plist_new_node(data); + subnode = plist_new_node(data); if (node) g_node_append(node, subnode); return subnode; @@ -185,10 +187,11 @@ static char compare_node_value(plist_type type, plist_data_t data, const void *v static plist_t plist_find_node(plist_t plist, plist_type type, const void *value, uint64_t length) { + plist_t current = NULL; + if (!plist) return NULL; - plist_t current = NULL; for (current = plist_get_first_child(plist); current; current = plist_get_next_sibling(current)) { plist_data_t data = plist_get_data(current); @@ -217,16 +220,17 @@ plist_t plist_find_node_by_string(plist_t plist, const char *value) static void plist_get_type_and_value(plist_t node, plist_type * type, void *value, uint64_t * length) { - if (!node) - return; - //for unicode glong len = 0; glong items_read = 0; glong items_written = 0; GError *error = NULL; + plist_data_t data = NULL; + + if (!node) + return; - plist_data_t data = plist_get_data(node); + data = plist_get_data(node); *type = data->type; *length = data->length; |