[brlcad-commits] SF.net SVN: brlcad:[36528] brlcad/trunk/src/libbu
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2009-11-18 18:23:36
|
Revision: 36528 http://brlcad.svn.sourceforge.net/brlcad/?rev=36528&view=rev Author: starseeker Date: 2009-11-18 18:23:29 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Sigh. Size differences on different archs are causing trouble - revert for now. Modified Paths: -------------- brlcad/trunk/src/libbu/malloc.c brlcad/trunk/src/libbu/parse.c brlcad/trunk/src/libbu/ptbl.c brlcad/trunk/src/libbu/rb_delete.c brlcad/trunk/src/libbu/rb_diag.c brlcad/trunk/src/libbu/rb_insert.c brlcad/trunk/src/libbu/rb_order_stats.c brlcad/trunk/src/libbu/rb_rotate.c brlcad/trunk/src/libbu/str.c Modified: brlcad/trunk/src/libbu/malloc.c =================================================================== --- brlcad/trunk/src/libbu/malloc.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/malloc.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -502,7 +502,7 @@ } } - fprintf(stderr, "%lu allocation entries\n", (unsigned long)count); + fprintf(stderr, "%lu allocation entries\n", count); } Modified: brlcad/trunk/src/libbu/parse.c =================================================================== --- brlcad/trunk/src/libbu/parse.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/parse.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -2184,7 +2184,7 @@ bu_vls_printf(logstr, "not enough values for \"%V\" argument: should be %ld", sdp->sp_name, - (long int)sdp->sp_count); + sdp->sp_count); return BRLCAD_ERROR; } Modified: brlcad/trunk/src/libbu/ptbl.c =================================================================== --- brlcad/trunk/src/libbu/ptbl.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/ptbl.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -30,7 +30,7 @@ bu_ptbl_init(struct bu_ptbl *b, int len, const char *str) { if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_init(%p, len=%d, %s)\n", (void *)b, len, str); + bu_log("bu_ptbl_init(%p, len=%d, %s)\n", b, len, str); BU_LIST_INIT(&b->l); b->l.magic = BU_PTBL_MAGIC; if (len <= 0) len = 64; @@ -45,7 +45,7 @@ { BU_CK_PTBL(b); if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_reset(%p)\n", (void *)b); + bu_log("bu_ptbl_reset(%p)\n", b); b->end = 0; memset((char *)b->buffer, 0, b->blen*sizeof(long *)); /* no peeking */ } @@ -59,7 +59,7 @@ BU_CK_PTBL(b); if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_ins(%p, %p)\n", (void *)b, (void *)p); + bu_log("bu_ptbl_ins(%p, %p)\n", b, p); if (b->blen == 0) bu_ptbl_init(b, 64, "bu_ptbl_ins() buffer"); if (b->end >= b->blen) { @@ -115,7 +115,7 @@ if (pp[k] == p) return (k); if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_ins_unique(%p, %p)\n", (void *)b, (void *)p); + bu_log("bu_ptbl_ins_unique(%p, %p)\n", b, p); if (b->blen <= 0 || b->end >= b->blen) { /* Table needs to grow */ @@ -152,7 +152,7 @@ } } if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_rm(%p, %p) ndel=%d\n", (void *)b, (void *)p, ndel); + bu_log("bu_ptbl_rm(%p, %p) ndel=%d\n", b, p, ndel); return ndel; } @@ -163,7 +163,7 @@ BU_CK_PTBL(dest); BU_CK_PTBL(src); if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_cat(%p, %p)\n", (void *)dest, (void *)src); + bu_log("bu_ptbl_cat(%p, %p)\n", dest, src); if ((dest->blen - dest->end) < src->end) { dest->blen = (dest->blen + src->end) * 2 + 8; @@ -184,7 +184,7 @@ BU_CK_PTBL(dest); BU_CK_PTBL(src); if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_cat_uniq(%p, %p)\n", (void *)dest, (void *)src); + bu_log("bu_ptbl_cat_uniq(%p, %p)\n", dest, src); /* Assume the worst, ensure sufficient space to add all 'src' items */ if ((dest->blen - dest->end) < src->end) { @@ -207,7 +207,7 @@ memset((char *)b, 0, sizeof(struct bu_ptbl)); /* sanity */ if (bu_debug & BU_DEBUG_PTBL) - bu_log("bu_ptbl_free(%p)\n", (void *)b); + bu_log("bu_ptbl_free(%p)\n", b); } @@ -239,7 +239,7 @@ return (0); } - bu_log("bu_ptbl(%p) Unknown table function %d\n", (void *)b, func); + bu_log("bu_ptbl(%p) Unknown table function %d\n", b, func); BU_CK_PTBL(b); /* this is here to keep lint happy */ @@ -263,10 +263,10 @@ lp <= (long **)BU_PTBL_LASTADDR(tbl); lp++ ) { if (*lp == 0) { - bu_log(" %p NULL entry\n", (void *)*lp); + bu_log(" %p NULL entry\n", *lp); continue; } - bu_log(" %p %s\n", (void *)*lp, bu_identify_magic(**lp)); + bu_log(" %p %s\n", *lp, bu_identify_magic(**lp)); } } Modified: brlcad/trunk/src/libbu/rb_delete.c =================================================================== --- brlcad/trunk/src/libbu/rb_delete.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/rb_delete.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -113,7 +113,7 @@ if (tree->rbt_debug & BU_RB_DEBUG_DELETE) bu_log("_rb_delete(%p, %p, %d): data=%p\n", - (void *)tree, (void *)node, order, (void *)rb_data(node, order)); + tree, node, order, rb_data(node, order)); if ((rb_left_child(node, order) == rb_null(tree)) || (rb_right_child(node, order) == rb_null(tree))) Modified: brlcad/trunk/src/libbu/rb_diag.c =================================================================== --- brlcad/trunk/src/libbu/rb_diag.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/rb_diag.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -57,13 +57,13 @@ package = (node->rbn_package)[d_order]; pp = tree->rbt_print; - bu_log("%*snode <%p>...\n", depth * 2, "", (void *)node); - bu_log("%*s tree: <%p>\n", depth * 2, "", (void *) node->rbn_tree); - bu_log("%*s parent: <%p>\n", depth * 2, "", (void *) rb_parent(node, d_order)); - bu_log("%*s left: <%p>\n", depth * 2, "", (void *)rb_left_child(node, d_order)); - bu_log("%*s right: <%p>\n", depth * 2, "", (void *)rb_right_child(node, d_order)); + bu_log("%*snode <%p>...\n", depth * 2, "", node); + bu_log("%*s tree: <%p>\n", depth * 2, "", node->rbn_tree); + bu_log("%*s parent: <%p>\n", depth * 2, "", rb_parent(node, d_order)); + bu_log("%*s left: <%p>\n", depth * 2, "", rb_left_child(node, d_order)); + bu_log("%*s right: <%p>\n", depth * 2, "", rb_right_child(node, d_order)); bu_log("%*s color: %s\n", depth * 2, "", (rb_get_color(node, d_order) == RB_RED) ? "RED" : (rb_get_color(node, d_order) == RB_BLK) ? "BLACK" : "Huh?"); - bu_log("%*s package: <%p> ", depth * 2, "", (void *)package); + bu_log("%*s package: <%p> ", depth * 2, "", package); if ((pp != 0) && (package != BU_RB_PKG_NULL)) (*pp)(package->rbp_data); @@ -78,11 +78,11 @@ BU_CKMAG(tree, BU_RB_TREE_MAGIC, "red-black tree"); RB_CKORDER(tree, order); - bu_log("-------- Red-black tree <%p> contents --------\n", (void *)tree); + bu_log("-------- Red-black tree <%p> contents --------\n", tree); bu_log("Description: '%s'\n", tree->rbt_description); bu_log("Order: %d of %d\n", order, tree->rbt_nm_orders); - bu_log("Current: <%p>\n", (void *) tree->rbt_current); - bu_log("Empty node: <%p>\n", (void *) tree->rbt_empty_node); + bu_log("Current: <%p>\n", tree->rbt_current); + bu_log("Empty node: <%p>\n", tree->rbt_empty_node); bu_log("Uniqueness: %d\n", rb_get_uniqueness(tree, order)); d_order = order; rb_walk(tree, order, _rb_describe_node, WALK_NODES, trav_type); @@ -96,23 +96,23 @@ BU_CKMAG(tree, BU_RB_TREE_MAGIC, "red-black tree"); - bu_log("-------- Red-black tree <%p> summary --------\n", (void *)tree); + bu_log("-------- Red-black tree <%p> summary --------\n", tree); bu_log("Description: '%s'\n", tree->rbt_description); - bu_log("Current: <%p>\n", (void *) tree->rbt_current); - bu_log("Empty node: <%p>\n", (void *) tree->rbt_empty_node); + bu_log("Current: <%p>\n", tree->rbt_current); + bu_log("Empty node: <%p>\n", tree->rbt_empty_node); bu_log("Size (in nodes): %d\n", tree->rbt_nm_nodes); bu_log("Number of orders: %d\n", tree->rbt_nm_orders); - bu_log("Debug bits: <%p>\n", (void *) tree->rbt_debug); + bu_log("Debug bits: <%p>\n", tree->rbt_debug); if ((tree->rbt_nm_orders > 0) && (tree->rbt_nm_nodes > 0)) { bu_log("i Order[i] Uniq[i] Root[i] Package[i] Data[i]\n"); for (i = 0; i < tree->rbt_nm_orders; ++i) { - bu_log("%-3d <%d> %c <%p> <%p> <%p>\n", + bu_log("%-3d <%p> %c <%p> <%p> <%p>\n", i, - (int) rb_order_func(tree, i), - (void *)rb_get_uniqueness(tree, i) ? 'Y' : 'N', - (void *) rb_root(tree, i), - (rb_root(tree, i) == BU_RB_NODE_NULL) ? 0 : (void *) (rb_root(tree, i)->rbn_package)[i], - (rb_root(tree, i) == BU_RB_NODE_NULL) ? 0 : (void *) rb_data(rb_root(tree, i), i)); + rb_order_func(tree, i), + rb_get_uniqueness(tree, i) ? 'Y' : 'N', + rb_root(tree, i), + (rb_root(tree, i) == BU_RB_NODE_NULL) ? 0 : (rb_root(tree, i)->rbn_package)[i], + (rb_root(tree, i) == BU_RB_NODE_NULL) ? 0 : rb_data(rb_root(tree, i), i)); } } bu_log("-------------------------------------------------\n"); Modified: brlcad/trunk/src/libbu/rb_insert.c =================================================================== --- brlcad/trunk/src/libbu/rb_insert.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/rb_insert.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -66,7 +66,7 @@ rb_size(new_node, order) = 1; if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("_rb_insert(%p): size(%p, %d)=%d\n", - (void *)new_node, (void *)new_node, order, rb_size(new_node, order)); + new_node, new_node, order, rb_size(new_node, order)); /* * Perform vanilla-flavored binary-tree insertion @@ -79,18 +79,18 @@ ++rb_size(parent, order); if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("_rb_insert(%p): size(%p, %d)=%d\n", - (void *)new_node, (void *)parent, order, rb_size(parent, order)); + new_node, parent, order, rb_size(parent, order)); comparison = (*compare)(rb_data(new_node, order), rb_data(node, order)); if (comparison < 0) { if (tree->rbt_debug & BU_RB_DEBUG_INSERT) bu_log("_rb_insert(%p): <_%d <%p>, going left\n", - (void *)new_node, order, (void *)node); + new_node, order, node); node = rb_left_child(node, order); } else { if (tree->rbt_debug & BU_RB_DEBUG_INSERT) bu_log("_rb_insert(%p): >=_%d <%p>, going right\n", - (void *)new_node, order, (void *)node); + new_node, order, node); node = rb_right_child(node, order); if (comparison == 0) result = 1; @@ -144,7 +144,7 @@ if (tree->rbt_debug & BU_RB_DEBUG_INSERT) bu_log("_rb_insert(%p): comparison = %d, returning %d\n", - (void *)new_node, comparison, result); + new_node, comparison, result); return (result); } @@ -178,7 +178,7 @@ { if (tree->rbt_debug & BU_RB_DEBUG_UNIQ) bu_log("bu_rb_insert(<%p>, <%p>, TBD) will return %d\n", - (void *)tree, data, -(order + 1)); + tree, data, -(order + 1)); return (-(order + 1)); } } @@ -261,7 +261,7 @@ rb_size(node, order) = 1; if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("bu_rb_insert(<%p>, <%p>, <%p>): size(%p, %d)=%d\n", - (void *)tree, data, (void *)node, (void *)node, order, rb_size(node, order)); + tree, data, node, node, order, rb_size(node, order)); } } else { /* Otherwise, insert the node into the tree */ @@ -269,7 +269,7 @@ result += _rb_insert(tree, order, node); if (tree->rbt_debug & BU_RB_DEBUG_UNIQ) bu_log("bu_rb_insert(<%p>, <%p>, <%p>) will return %d\n", - (void *)tree, data, (void *)node, result); + tree, data, node, result); } ++(tree->rbt_nm_nodes); Modified: brlcad/trunk/src/libbu/rb_order_stats.c =================================================================== --- brlcad/trunk/src/libbu/rb_order_stats.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/rb_order_stats.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -51,7 +51,7 @@ rank = rb_size(rb_left_child(root, order), order) + 1; if (root->rbn_tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("_rb_select(<%p>, %d, %d): rank=%d\n", - (void *)root, order, k, rank); + root, order, k, rank); if (rank == k) return (root); @@ -73,13 +73,13 @@ if ((k < 1) || (k > tree->rbt_nm_nodes)) { if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("bu_rb_select(<%p>, %d, %d): k out of bounds [1, %d]\n", - (void *)tree, order, k, tree->rbt_nm_nodes); + tree, order, k, tree->rbt_nm_nodes); rb_current(tree) = rb_null(tree); return (NULL); } if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("bu_rb_select(<%p>, %d, %d): root=<%p>\n", - (void *)tree, order, k, (void *)rb_root(tree, order)); + tree, order, k, rb_root(tree, order)); rb_current(tree) = node = _rb_select(rb_root(tree, order), order, k); Modified: brlcad/trunk/src/libbu/rb_rotate.c =================================================================== --- brlcad/trunk/src/libbu/rb_rotate.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/rb_rotate.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -46,7 +46,7 @@ y = rb_right_child(x, order); if (tree->rbt_debug & BU_RB_DEBUG_ROTATE) - bu_log("rb_rot_left(<%p>, %d)...\n", (void *)x, order); + bu_log("rb_rot_left(<%p>, %d)...\n", x, order); rb_right_child(x, order) = beta = rb_left_child(y, order); if (beta != rb_null(tree)) @@ -67,7 +67,7 @@ rb_size(rb_right_child(x, order), order) + 1; if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("After rotation, size(%p, %d)=%d, size(%p, %d)=%d\n", - (void *)x, order, rb_size(x, order), (void *)y, order, rb_size(y, order)); + x, order, rb_size(x, order), y, order, rb_size(y, order)); } @@ -87,7 +87,7 @@ x = rb_left_child(y, order); if (tree->rbt_debug & BU_RB_DEBUG_ROTATE) - bu_log("rb_rot_right(<%p>, %d)...\n", (void *)y, order); + bu_log("rb_rot_right(<%p>, %d)...\n", y, order); rb_left_child(y, order) = beta = rb_right_child(x, order); if (beta != rb_null(tree)) @@ -108,7 +108,7 @@ rb_size(rb_right_child(y, order), order) + 1; if (tree->rbt_debug & BU_RB_DEBUG_OS) bu_log("After rotation, size(%p, %d)=%d, size(%p, %d)=%d\n", - (void *)x, order, rb_size(x, order), (void *)y, order, rb_size(y, order)); + x, order, rb_size(x, order), y, order, rb_size(y, order)); } /** @} */ Modified: brlcad/trunk/src/libbu/str.c =================================================================== --- brlcad/trunk/src/libbu/str.c 2009-11-18 18:12:33 UTC (rev 36527) +++ brlcad/trunk/src/libbu/str.c 2009-11-18 18:23:29 UTC (rev 36528) @@ -36,7 +36,7 @@ if (!dst && label) { bu_semaphore_acquire(BU_SEM_SYSCALL); - fprintf(stderr, "WARNING: NULL destination string, size %ld [%s]\n", (unsigned long)size, label); + fprintf(stderr, "WARNING: NULL destination string, size %ld [%s]\n", size, label); bu_semaphore_release(BU_SEM_SYSCALL); } if (!dst || !src || size <= 0) { @@ -51,17 +51,17 @@ if (dstsize == size - 1) { bu_semaphore_acquire(BU_SEM_SYSCALL); - fprintf(stderr, "WARNING: [%s] concatenation string is already full at %ld chars\n", label, (unsigned long)size-1); + fprintf(stderr, "WARNING: [%s] concatenation string is already full at %ld chars\n", label, size-1); bu_semaphore_release(BU_SEM_SYSCALL); } else if (dstsize > size - 1) { /* probably missing null-termination or is not an initialized buffer */ bu_semaphore_acquire(BU_SEM_SYSCALL); - fprintf(stderr, "WARNING: [%s] concatenation string is already full, exceeds size (%ld > %ld)\n", label, (unsigned long)dstsize, (unsigned long)size-1); + fprintf(stderr, "WARNING: [%s] concatenation string is already full, exceeds size (%ld > %ld)\n", label, dstsize, size-1); bu_semaphore_release(BU_SEM_SYSCALL); } else if (srcsize >= size - dstsize) { if (bu_debug) { bu_semaphore_acquire(BU_SEM_SYSCALL); - fprintf(stderr, "WARNING: [%s] string truncation, exceeding %ld char max concatenating %ld chars (started with %ld)\n", label, (unsigned long)size-1, (unsigned long)srcsize, (unsigned long)dstsize); + fprintf(stderr, "WARNING: [%s] string truncation, exceeding %ld char max concatenating %ld chars (started with %ld)\n", label, size-1, srcsize, dstsize); bu_semaphore_release(BU_SEM_SYSCALL); } } @@ -92,7 +92,7 @@ if (!dst && label) { bu_semaphore_acquire(BU_SEM_SYSCALL); - fprintf(stderr, "WARNING: NULL destination string, size %ld [%s]\n", (unsigned long)size, label); + fprintf(stderr, "WARNING: NULL destination string, size %ld [%s]\n", size, label); bu_semaphore_release(BU_SEM_SYSCALL); } if (!dst || !src || size <= 0) { @@ -107,7 +107,7 @@ if (bu_debug) { if (srcsize >= size) { bu_semaphore_acquire(BU_SEM_SYSCALL); - fprintf(stderr, "WARNING: [%s] string truncation, exceeding %ld char max copying %ld chars\n", label, (unsigned long)size-1, (unsigned long)srcsize); + fprintf(stderr, "WARNING: [%s] string truncation, exceeding %ld char max copying %ld chars\n", label, size-1, srcsize); bu_semaphore_release(BU_SEM_SYSCALL); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |