diff options
| -rw-r--r-- | include/plist/plist.h | 2 | ||||
| -rw-r--r-- | src/plist.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index 484203b..bfd934f 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h | |||
| @@ -64,7 +64,7 @@ extern "C" { | |||
| 64 | /** | 64 | /** |
| 65 | * The plist dictionary iterator. | 65 | * The plist dictionary iterator. |
| 66 | */ | 66 | */ |
| 67 | typedef uint32_t *plist_dict_iter; | 67 | typedef void *plist_dict_iter; |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | * The enumeration of plist node types. | 70 | * The enumeration of plist node types. |
diff --git a/src/plist.c b/src/plist.c index 116c7ec..b723517 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -264,24 +264,24 @@ void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) | |||
| 264 | { | 264 | { |
| 265 | if (iter && *iter == NULL) { | 265 | if (iter && *iter == NULL) { |
| 266 | *iter = malloc(sizeof(uint32_t)); | 266 | *iter = malloc(sizeof(uint32_t)); |
| 267 | **iter = 0; | 267 | *(uint32_t*)*iter = 0; |
| 268 | } | 268 | } |
| 269 | return; | 269 | return; |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) | 272 | void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val) |
| 273 | { | 273 | { |
| 274 | if (node && PLIST_DICT == plist_get_node_type(node) && *iter < g_node_n_children(node) / 2) { | 274 | if (node && PLIST_DICT == plist_get_node_type(node) && *(uint32_t*)iter < g_node_n_children(node) / 2) { |
| 275 | 275 | ||
| 276 | if (key) { | 276 | if (key) { |
| 277 | plist_get_key_val((plist_t)g_node_nth_child(node, 2 * (*iter)), key); | 277 | plist_get_key_val((plist_t)g_node_nth_child(node, 2 * (*(uint32_t*)iter)), key); |
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | if (val) { | 280 | if (val) { |
| 281 | *val = (plist_t) g_node_nth_child(node, 2 * (*iter) + 1); | 281 | *val = (plist_t) g_node_nth_child(node, 2 * (*(uint32_t*)iter) + 1); |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | *iter += 2; | 284 | *(uint32_t*)iter += 2; |
| 285 | } | 285 | } |
| 286 | return; | 286 | return; |
| 287 | } | 287 | } |
