Revision: 65577
          http://sourceforge.net/p/brlcad/code/65577
Author:   starseeker
Date:     2015-07-11 21:38:24 +0000 (Sat, 11 Jul 2015)
Log Message:
-----------
rtshot tests this hash table.  So far, not working.

Modified Paths:
--------------
    brlcad/trunk/src/librt/tree.c
    brlcad/trunk/src/rt/rtshot.c

Modified: brlcad/trunk/src/librt/tree.c
===================================================================
--- brlcad/trunk/src/librt/tree.c       2015-07-11 21:23:32 UTC (rev 65576)
+++ brlcad/trunk/src/librt/tree.c       2015-07-11 21:38:24 UTC (rev 65577)
@@ -233,7 +233,7 @@
        /* enter critical section */
        bu_semaphore_acquire(RT_SEM_RESULTS);
 
-       entry = bu_hash_tbl_add(tbl, (const unsigned char *)key, strlen(key), 
&newentry);
+       entry = bu_hash_tbl_add(tbl, (unsigned char *)key, strlen(key) + 1, 
&newentry);
        bu_set_hash_value(entry, (unsigned char *)inv_mat);
 
        /* leave critical section */

Modified: brlcad/trunk/src/rt/rtshot.c
===================================================================
--- brlcad/trunk/src/rt/rtshot.c        2015-07-11 21:23:32 UTC (rev 65576)
+++ brlcad/trunk/src/rt/rtshot.c        2015-07-11 21:38:24 UTC (rev 65577)
@@ -487,7 +487,8 @@
     }
     for (; pp != PartHeadp; pp = pp->pt_forw) {
        matp_t inv_mat;
-       Tcl_HashEntry *entry;
+       const char *key = (const char *)(size_t)pp->pt_regionp->reg_bit;
+       struct bu_hash_entry *entry;
 
        bu_log("\n--- Hit region %s (in %s, out %s) reg_bit = %d\n",
               pp->pt_regionp->reg_name,
@@ -495,12 +496,12 @@
               pp->pt_outseg->seg_stp->st_name,
               pp->pt_regionp->reg_bit);
 
-       entry = Tcl_FindHashEntry((Tcl_HashTable *)ap->a_rt_i->Orca_hash_tbl,
-                                 (const char 
*)(size_t)pp->pt_regionp->reg_bit);
+       entry = bu_hash_tbl_find((struct bu_hash_tbl 
*)ap->a_rt_i->Orca_hash_tbl,
+                                 (unsigned char *)key, strlen(key) + 1, NULL, 
NULL);
        if (!entry) {
            inv_mat = (matp_t)NULL;
        } else {
-           inv_mat = (matp_t)Tcl_GetHashValue(entry);
+           inv_mat = (matp_t)bu_get_hash_value(entry);
            bn_mat_print("inv_mat", inv_mat);
        }
 
@@ -642,19 +643,20 @@
        for (; pp != &pl->PartHeadp; pp = pp->pt_forw) {
            fastf_t out;
            matp_t inv_mat;
-           Tcl_HashEntry *entry;
+           const char *key = (const char *)(size_t)pp->pt_regionp->reg_bit;
+           struct bu_hash_entry *entry;
 
            bu_log("\n--- Hit region %s (in %s, out %s) reg_bit = %d\n",
                   pp->pt_regionp->reg_name, pp->pt_inseg->seg_stp->st_name,
                   pp->pt_outseg->seg_stp->st_name, pp->pt_regionp->reg_bit);
 
-           entry = Tcl_FindHashEntry(
-               (Tcl_HashTable *) pl->ap->a_rt_i->Orca_hash_tbl,
-               (const char *) (size_t) pp->pt_regionp->reg_bit);
+           entry = bu_hash_tbl_find((struct bu_hash_tbl 
*)pl->ap->a_rt_i->Orca_hash_tbl,
+                   (unsigned char *)key, strlen(key) + 1, NULL, NULL);
+
            if (!entry) {
                inv_mat = (matp_t) NULL;
            } else {
-               inv_mat = (matp_t) Tcl_GetHashValue(entry);
+               inv_mat = (matp_t)bu_get_hash_value(entry);
                bn_mat_print("inv_mat", inv_mat);
            }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to