projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new fortune.
[feisty_meow.git]
/
nucleus
/
library
/
nodes
/
packable_tree.cpp
diff --git
a/nucleus/library/nodes/packable_tree.cpp
b/nucleus/library/nodes/packable_tree.cpp
index a38f88ad86837f98d7fd8b6879636daa0e067e7b..168e3500429e80d68dd91b7a156c20b29d0c3e92 100644
(file)
--- a/
nucleus/library/nodes/packable_tree.cpp
+++ b/
nucleus/library/nodes/packable_tree.cpp
@@
-23,7
+23,7
@@
using namespace basis;
using namespace structures;
using namespace basis;
using namespace structures;
-
//
#define DEBUG_PACKABLE_TREE
+#define DEBUG_PACKABLE_TREE
// uncomment for noisy debugging.
#undef LOG
// uncomment for noisy debugging.
#undef LOG
@@
-92,8
+92,8
@@
LOG(a_sprintf("len A %d", size_accumulator));
void packable_tree::packit(byte_array &packed_form, const packable_tree *current_node)
{
void packable_tree::packit(byte_array &packed_form, const packable_tree *current_node)
{
-LOG(a_sprintf("packing node %x", current_node));
-LOG(a_sprintf("size A %d", packed_form.length()));
+
//
LOG(a_sprintf("packing node %x", current_node));
+
//
LOG(a_sprintf("size A %d", packed_form.length()));
FUNCDEF("packit");
if (!current_node) throw_error(static_class_name(), func, "current node is nil");
FUNCDEF("packit");
if (!current_node) throw_error(static_class_name(), func, "current node is nil");
@@
-119,9
+119,9
@@
throw_error(current_node->class_name(), func, "failure calculating size");
}
// stuff the command unit.
command.pack(packed_form);
}
// stuff the command unit.
command.pack(packed_form);
-LOG(a_sprintf("size B %d", packed_form.length()));
+
//
LOG(a_sprintf("size B %d", packed_form.length()));
packed_form += temp_store; // main chunk is not packed, just added.
packed_form += temp_store; // main chunk is not packed, just added.
-LOG(a_sprintf("size C %d", packed_form.length()));
+
//
LOG(a_sprintf("size C %d", packed_form.length()));
}
int packable_tree::recursive_packed_size() const
}
int packable_tree::recursive_packed_size() const
@@
-157,7
+157,7
@@
packable_tree *packable_tree::recursive_unpack(byte_array &packed_form,
// get the first command out of the package.
if (!cmd.unpack(packed_form)) {
//complain.
// get the first command out of the package.
if (!cmd.unpack(packed_form)) {
//complain.
- return
false
;
+ return
NIL
;
}
packable_tree *new_branch = NIL;
}
packable_tree *new_branch = NIL;