Revision: 45851
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45851&view=rev
Author:   brlcad
Date:     2011-08-09 18:47:52 +0000 (Tue, 09 Aug 2011)

Log Message:
-----------
use size_t for hit table indexing

Modified Paths:
--------------
    brlcad/trunk/include/raytrace.h
    brlcad/trunk/src/librt/htbl.c

Modified: brlcad/trunk/include/raytrace.h
===================================================================
--- brlcad/trunk/include/raytrace.h     2011-08-09 17:45:30 UTC (rev 45850)
+++ brlcad/trunk/include/raytrace.h     2011-08-09 18:47:52 UTC (rev 45851)
@@ -1402,8 +1402,8 @@
  */
 struct rt_htbl {
     struct bu_list     l;      /**< @brief  linked list for caller's use */
-    int                        end;    /**< @brief  index of first available 
location */
-    int                        blen;   /**< @brief  # of struct's of storage 
at *hits */
+    size_t             end;    /**< @brief  index of first available location 
*/
+    size_t             blen;   /**< @brief  # of struct's of storage at *hits 
*/
     struct hit *       hits;   /**< @brief  hits[blen] data storage area */
 };
 #define RT_CK_HTBL(_p) BU_CKMAG(_p, RT_HTBL_MAGIC, "rt_htbl")
@@ -3661,9 +3661,7 @@
                                       struct rt_curve *crv);
 
 /* htbl.c */
-RT_EXPORT extern void rt_htbl_init(struct rt_htbl *b,
-                                  int len,
-                                  const char *str);
+RT_EXPORT extern void rt_htbl_init(struct rt_htbl *b, size_t len, const char 
*str);
 RT_EXPORT extern void rt_htbl_reset(struct rt_htbl *b);
 RT_EXPORT extern void rt_htbl_free(struct rt_htbl *b);
 RT_EXPORT extern struct hit *rt_htbl_get(struct rt_htbl *b);

Modified: brlcad/trunk/src/librt/htbl.c
===================================================================
--- brlcad/trunk/src/librt/htbl.c       2011-08-09 17:45:30 UTC (rev 45850)
+++ brlcad/trunk/src/librt/htbl.c       2011-08-09 18:47:52 UTC (rev 45851)
@@ -41,7 +41,7 @@
  *                     R T _ H T B L _ I N I T
  */
 void
-rt_htbl_init(struct rt_htbl *b, int len, const char *str)
+rt_htbl_init(struct rt_htbl *b, size_t len, const char *str)
 
     /* initial len. */
 
@@ -50,7 +50,7 @@
        bu_log("rt_htbl_init(%8x, len=%d, %s)\n", b, len, str);
     BU_LIST_INIT(&b->l);
     b->l.magic = RT_HTBL_MAGIC;
-    if ( len <= 0 )  len = 64;
+    if ( len == 0 )  len = 64;
     b->blen = len;
     b->hits = (struct hit *)bu_calloc(b->blen, sizeof(struct hit), str);
     b->end = 0;


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

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to