diff options
author | Martin Szulecki | 2014-05-20 17:46:06 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-05-20 17:46:06 +0200 |
commit | 993f65b3bda53e2b22ee9e94efd11cbddd7b73cb (patch) | |
tree | 0c9b436ae656e36a84a937adf5f6cbfae07f28f1 /libcnary/node_list.c | |
parent | 7b59a04d9406fde0847d1ce68c3bf2fde018c198 (diff) | |
download | libplist-993f65b3bda53e2b22ee9e94efd11cbddd7b73cb.tar.gz libplist-993f65b3bda53e2b22ee9e94efd11cbddd7b73cb.tar.bz2 |
Rename "index" variable as it shadows global declaration on older systems
Diffstat (limited to 'libcnary/node_list.c')
-rw-r--r-- | libcnary/node_list.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libcnary/node_list.c b/libcnary/node_list.c index 5b291e7..4b268e0 100644 --- a/libcnary/node_list.c +++ b/libcnary/node_list.c @@ -72,9 +72,9 @@ int node_list_add(node_list_t* list, node_t* node) { return 0; } -int node_list_insert(node_list_t* list, unsigned int index, node_t* node) { +int node_list_insert(node_list_t* list, unsigned int node_index, node_t* node) { if (!list || !node) return -1; - if (index >= list->count) { + if (node_index >= list->count) { return node_list_add(list, node); } @@ -84,8 +84,8 @@ int node_list_insert(node_list_t* list, unsigned int index, node_t* node) { unsigned int pos = 0; node_t* prev = NULL; - if (index > 0) { - while (pos < index) { + if (node_index > 0) { + while (pos < node_index) { prev = cur; cur = cur->next; pos++; @@ -124,7 +124,7 @@ int node_list_remove(node_list_t* list, node_t* node) { if (!list || !node) return -1; if (list->count == 0) return -1; - int index = 0; + int node_index = 0; node_t* n; for (n = list->begin; n; n = n->next) { if (node == n) { @@ -145,9 +145,9 @@ int node_list_remove(node_list_t* list, node_t* node) { list->begin = newnode; } list->count--; - return index; + return node_index; } - index++; + node_index++; } return -1; } |