summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-18 18:53:59 +0000
committerDavid Robillard <d@drobilla.net>2011-09-18 18:53:59 +0000
commit6651d4dbf74dc4591fbaf5250bfd6f7d58ce0363 (patch)
tree04d1a6666c5d79aa9b2129392397b884a98049e4
parent4d2da91a500ce75f61fdf1f5d03abde795fb7770 (diff)
downloadzix-6651d4dbf74dc4591fbaf5250bfd6f7d58ce0363.tar.gz
zix-6651d4dbf74dc4591fbaf5250bfd6f7d58ce0363.tar.bz2
zix-6651d4dbf74dc4591fbaf5250bfd6f7d58ce0363.zip
Tidy.
git-svn-id: http://svn.drobilla.net/zix/trunk@14 df6676b4-ccc9-40e5-b5d6-7c4628a128e3
-rw-r--r--src/ring.c4
-rw-r--r--src/sorted_array.c8
-rw-r--r--src/tree.c6
-rw-r--r--zix/sorted_array.h8
4 files changed, 17 insertions, 9 deletions
diff --git a/src/ring.c b/src/ring.c
index 1553ba5..4dadcf2 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -23,8 +23,6 @@
# include <sys/mman.h>
#endif
-#include "zix/ring.h"
-
#if defined(__APPLE__)
# include <libkern/OSAtomic.h>
# define ZIX_FULL_BARRIER() OSMemoryBarrier()
@@ -39,6 +37,8 @@
#define ZIX_READ_BARRIER() ZIX_FULL_BARRIER()
#define ZIX_WRITE_BARRIER() ZIX_FULL_BARRIER()
+#include "zix/ring.h"
+
struct ZixRingImpl {
uint32_t write_head; ///< Read index into buf
uint32_t read_head; ///< Write index into buf
diff --git a/src/sorted_array.c b/src/sorted_array.c
index e41797d..e841380 100644
--- a/src/sorted_array.c
+++ b/src/sorted_array.c
@@ -81,7 +81,9 @@ zix_sorted_array_size(ZixSortedArray* a)
ZIX_API
ZixStatus
-zix_sorted_array_insert(ZixSortedArray* a, const void* e, ZixSortedArrayIter* ai)
+zix_sorted_array_insert(ZixSortedArray* a,
+ const void* e,
+ ZixSortedArrayIter* ai)
{
if (a->num_elems == 0) {
assert(!a->array);
@@ -140,7 +142,9 @@ zix_sorted_array_index(const ZixSortedArray* a, size_t index)
ZIX_API
ZixStatus
-zix_sorted_array_find(const ZixSortedArray* a, const void* e, ZixSortedArrayIter* ai)
+zix_sorted_array_find(const ZixSortedArray* a,
+ const void* e,
+ ZixSortedArrayIter* ai)
{
if (a->num_elems == 0) {
*ai = NULL;
diff --git a/src/tree.c b/src/tree.c
index 60f983e..b197306 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -554,9 +554,9 @@ ZixStatus
zix_tree_remove(ZixTree* t, ZixTreeIter ti)
{
ZixTreeNode* const n = ti;
- ZixTreeNode** pp = NULL; // parent pointer
- ZixTreeNode* to_balance = n->parent; // lowest node to start rebalace at
- int8_t d_balance = 0; // delta(balance) for n->parent
+ ZixTreeNode** pp = NULL; // parent pointer
+ ZixTreeNode* to_balance = n->parent; // lowest node to balance
+ int8_t d_balance = 0; // delta(balance) for n->parent
#ifdef ZIX_TREE_DUMP
printf("*** REMOVE %ld\n", (intptr_t)n->data);
diff --git a/zix/sorted_array.h b/zix/sorted_array.h
index 355bdf2..da3a1d4 100644
--- a/zix/sorted_array.h
+++ b/zix/sorted_array.h
@@ -65,7 +65,9 @@ zix_sorted_array_size(ZixSortedArray* a);
Insert the element @a e into @a a and point @a ai at the new element.
*/
ZixStatus
-zix_sorted_array_insert(ZixSortedArray* a, const void* e, ZixSortedArrayIter* ai);
+zix_sorted_array_insert(ZixSortedArray* a,
+ const void* e,
+ ZixSortedArrayIter* ai);
/**
Remove the item pointed at by @a ai from @a a.
@@ -78,7 +80,9 @@ zix_sorted_array_remove(ZixSortedArray* a, ZixSortedArrayIter ai);
If no such item exists, @a ai is set to NULL.
*/
ZixStatus
-zix_sorted_array_find(const ZixSortedArray* a, const void* e, ZixSortedArrayIter* ai);
+zix_sorted_array_find(const ZixSortedArray* a,
+ const void* e,
+ ZixSortedArrayIter* ai);
void*
zix_sorted_array_index(const ZixSortedArray* a, size_t index);