diff options
Diffstat (limited to 'libdimension/bvst.c')
-rw-r--r-- | libdimension/bvst.c | 37 |
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); -} |