Revision: 52645
          http://brlcad.svn.sourceforge.net/brlcad/?rev=52645&view=rev
Author:   brlcad
Date:     2012-10-01 23:06:04 +0000 (Mon, 01 Oct 2012)
Log Message:
-----------
looks like there's a few other places we were blindly using potentially empty 
sketches

Modified Paths:
--------------
    brlcad/trunk/src/librt/primitives/revolve/revolve.c

Modified: brlcad/trunk/src/librt/primitives/revolve/revolve.c
===================================================================
--- brlcad/trunk/src/librt/primitives/revolve/revolve.c 2012-10-01 22:51:27 UTC 
(rev 52644)
+++ brlcad/trunk/src/librt/primitives/revolve/revolve.c 2012-10-01 23:06:04 UTC 
(rev 52645)
@@ -79,9 +79,8 @@
      * if even, the point is ok
      * if odd, the point is at the end of a path
      */
-    endcount = (int *)bu_calloc(rip->skt->vert_count, sizeof(int), "endcount");
-    for (i=0; i<rip->skt->vert_count; i++)
-       endcount[i] = 0;
+    if (rip->skt->vert_count)
+       endcount = (int *)bu_calloc(rip->skt->vert_count, sizeof(int), 
"endcount");
     nseg = rip->skt->curve.count;
 
     for (i=0; i<nseg; i++) {
@@ -139,7 +138,8 @@
            j++;
        }
     }
-    while (j < rip->skt->vert_count) endcount[j++] = -1;
+    while (j < rip->skt->vert_count)
+       endcount[j++] = -1;
 
     VMOVE(zUnit, rip->axis3d);
     VUNITIZE(zUnit);
@@ -158,7 +158,8 @@
     (*min)[Z] = center[Z] - radius;
     (*max)[Z] = center[Z] + radius;
 
-    bu_free(endcount, "endcount");
+    if (rip->skt->vert_count)
+       bu_free(endcount, "endcount");
 
     return 0;                  /* OK */
 }
@@ -226,9 +227,9 @@
      * if even, the point is ok
      * if odd, the point is at the end of a path
      */
-    endcount = (int *)bu_calloc(rev->skt->vert_count, sizeof(int), "endcount");
-    for (i=0; i<rev->skt->vert_count; i++)
-       endcount[i] = 0;
+    if (rev->skt->vert_count) {
+       endcount = (int *)bu_calloc(rev->skt->vert_count, sizeof(int), 
"endcount");
+    }
     nseg = rev->skt->curve.count;
 
     for (i=0; i<nseg; i++) {
@@ -286,7 +287,8 @@
            j++;
        }
     }
-    while (j < rev->skt->vert_count) endcount[j++] = -1;
+    while (j < rev->skt->vert_count)
+       endcount[j++] = -1;
 
     rev->ends = endcount;
 

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


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to