summaryrefslogtreecommitdiffstats
path: root/libdimension/bvst.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-04-01 15:40:19 -0400
committerTavian Barnes <tavianator@gmail.com>2010-04-01 15:40:19 -0400
commitc8ab44d29c3384210cd8f27533abfd0fb2205cc5 (patch)
tree91e09bbe8841e808492dc8e5671a2622aba5a419 /libdimension/bvst.c
parente0313016725bc9f87243571e75b2e77f1cae265e (diff)
downloaddimension-c8ab44d29c3384210cd8f27533abfd0fb2205cc5.tar.xz
Set errno on failures.
Diffstat (limited to 'libdimension/bvst.c')
-rw-r--r--libdimension/bvst.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/libdimension/bvst.c b/libdimension/bvst.c
index 462d1f0..c3c8d9d 100644
--- a/libdimension/bvst.c
+++ b/libdimension/bvst.c
@@ -21,9 +21,6 @@
#include "dimension_impl.h"
#include <stdlib.h>
-static dmnsn_bvst_node *dmnsn_new_bvst_node();
-static void dmnsn_delete_bvst_node(dmnsn_bvst_node *node);
-
/* Return an empty tree */
dmnsn_bvst *
dmnsn_new_bvst()
@@ -37,6 +34,16 @@ dmnsn_new_bvst()
return tree;
}
+static dmnsn_bvst_node *
+dmnsn_new_bvst_node()
+{
+ dmnsn_bvst_node *node = malloc(sizeof(dmnsn_bvst_node));
+ if (!node) {
+ dmnsn_error(DMNSN_SEVERITY_HIGH, "BVST node allocation failed.");
+ }
+ return node;
+}
+
/* Recursively copy the nodes of a BVST */
static dmnsn_bvst_node *
dmnsn_bvst_copy_recursive(dmnsn_bvst_node *root)
@@ -66,8 +73,14 @@ dmnsn_copy_bvst(dmnsn_bvst *tree)
return copy;
}
+static void
+dmnsn_delete_bvst_node(dmnsn_bvst_node *node)
+{
+ free(node);
+}
+
/* Recursively free a BVST */
-void
+static void
dmnsn_delete_bvst_recursive(dmnsn_bvst_node *node)
{
if (node) {
@@ -443,19 +456,3 @@ dmnsn_ray_box_intersection(dmnsn_line line, dmnsn_vector min, dmnsn_vector max,
return 0;
}
-
-static dmnsn_bvst_node *
-dmnsn_new_bvst_node()
-{
- dmnsn_bvst_node *node = malloc(sizeof(dmnsn_bvst_node));
- if (!node) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "BVST node allocation failed.");
- }
- return node;
-}
-
-static void
-dmnsn_delete_bvst_node(dmnsn_bvst_node *node)
-{
- free(node);
-}