summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2009-10-10 23:09:29 +0200
committerGravatar Jonathan Beck2009-10-10 23:09:29 +0200
commitf8ba9f02e363e01b34381d945987b6cbefecfe97 (patch)
treee6223ce93d4c29611bf954cbb03a5f0a4eb3e2b8
parent97f7caeecdfe233c30cec02ac1c4b5634a4f2bce (diff)
downloadlibplist-f8ba9f02e363e01b34381d945987b6cbefecfe97.tar.gz
libplist-f8ba9f02e363e01b34381d945987b6cbefecfe97.tar.bz2
Abstract iter base type.
-rw-r--r--include/plist/plist.h2
-rw-r--r--src/plist.c10
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" {
/**
* The plist dictionary iterator.
*/
- typedef uint32_t *plist_dict_iter;
+ typedef void *plist_dict_iter;
/**
* 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)
{
if (iter && *iter == NULL) {
*iter = malloc(sizeof(uint32_t));
- **iter = 0;
+ *(uint32_t*)*iter = 0;
}
return;
}
void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val)
{
- if (node && PLIST_DICT == plist_get_node_type(node) && *iter < g_node_n_children(node) / 2) {
+ if (node && PLIST_DICT == plist_get_node_type(node) && *(uint32_t*)iter < g_node_n_children(node) / 2) {
if (key) {
- plist_get_key_val((plist_t)g_node_nth_child(node, 2 * (*iter)), key);
+ plist_get_key_val((plist_t)g_node_nth_child(node, 2 * (*(uint32_t*)iter)), key);
}
if (val) {
- *val = (plist_t) g_node_nth_child(node, 2 * (*iter) + 1);
+ *val = (plist_t) g_node_nth_child(node, 2 * (*(uint32_t*)iter) + 1);
}
- *iter += 2;
+ *(uint32_t*)iter += 2;
}
return;
}