summaryrefslogtreecommitdiffstats
path: root/src/oplist.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-02-06 18:28:28 +0100
committerGravatar Nikias Bassen2023-02-06 18:28:28 +0100
commitd3908006349f38bcfc0151daebd98b6873a2dbfc (patch)
tree238072fa5380039ad29af87c0d6e618ab37d4d5b /src/oplist.c
parent52826a6c229ed3e353d4dae711a6c52a96d99764 (diff)
downloadlibplist-d3908006349f38bcfc0151daebd98b6873a2dbfc.tar.gz
libplist-d3908006349f38bcfc0151daebd98b6873a2dbfc.tar.bz2
libcnary: Updated typedefs of node_t and node_list_t to contain pointer
This makes the code more readable. Obviously all the code that uses it is also updated.
Diffstat (limited to 'src/oplist.c')
-rw-r--r--src/oplist.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/oplist.c b/src/oplist.c
index 420cbd6..287d5a2 100644
--- a/src/oplist.c
+++ b/src/oplist.c
@@ -34,7 +34,6 @@
#include <limits.h>
#include <node.h>
-#include <node_list.h>
#include "plist.h"
#include "strbuf.h"
@@ -130,7 +129,7 @@ static int str_needs_quotes(const char* str, size_t len)
return 0;
}
-static int node_to_openstep(node_t* node, bytearray_t **outbuf, uint32_t depth, int prettify)
+static int node_to_openstep(node_t node, bytearray_t **outbuf, uint32_t depth, int prettify)
{
plist_data_t node_data = NULL;
@@ -209,7 +208,7 @@ static int node_to_openstep(node_t* node, bytearray_t **outbuf, uint32_t depth,
case PLIST_ARRAY: {
str_buf_append(*outbuf, "(", 1);
- node_t *ch;
+ node_t ch;
uint32_t cnt = 0;
for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) {
if (cnt > 0) {
@@ -237,7 +236,7 @@ static int node_to_openstep(node_t* node, bytearray_t **outbuf, uint32_t depth,
} break;
case PLIST_DICT: {
str_buf_append(*outbuf, "{", 1);
- node_t *ch;
+ node_t ch;
uint32_t cnt = 0;
for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) {
if (cnt > 0 && cnt % 2 == 0) {
@@ -346,7 +345,7 @@ static int num_digits_u(uint64_t i)
return n;
}
-static int node_estimate_size(node_t *node, uint64_t *size, uint32_t depth, int prettify)
+static int node_estimate_size(node_t node, uint64_t *size, uint32_t depth, int prettify)
{
plist_data_t data;
if (!node) {
@@ -354,7 +353,7 @@ static int node_estimate_size(node_t *node, uint64_t *size, uint32_t depth, int
}
data = plist_get_data(node);
if (node->children) {
- node_t *ch;
+ node_t ch;
unsigned int n_children = node_n_children(node);
for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) {
int res = node_estimate_size(ch, size, depth + 1, prettify);