Revision: 45830
http://brlcad.svn.sourceforge.net/brlcad/?rev=45830&view=rev
Author: brlcad
Date: 2011-08-08 22:21:12 +0000 (Mon, 08 Aug 2011)
Log Message:
-----------
come to think of it, we don't need ANY stinking dynamic memory allocation.
huzzah.
Modified Paths:
--------------
brlcad/trunk/src/proc-db/sketch.c
Modified: brlcad/trunk/src/proc-db/sketch.c
===================================================================
--- brlcad/trunk/src/proc-db/sketch.c 2011-08-08 22:19:07 UTC (rev 45829)
+++ brlcad/trunk/src/proc-db/sketch.c 2011-08-08 22:21:12 UTC (rev 45830)
@@ -45,7 +45,6 @@
struct bezier_seg bsg;
struct line_seg lsg[4];
struct carc_seg csg;
- size_t i;
point_t V;
vect_t u_vec, v_vec;
point2d_t verts[] = {
@@ -60,6 +59,9 @@
{ 125, 0 }, /* 8 */
{ 200, 200 } /* 9 */
};
+ int reverse[] = {0, 0, 0, 0, 0, 0};
+ genptr_t segments[] = {NULL, NULL, NULL, NULL, NULL, NULL};
+ int ctrl_points[] = {0, 0, 0, 0, 0};
if (argc > 1)
bu_log("Usage: %s\nWarning - ignored unsupported argument \"%s\"\n",
argv[0], argv[1]);
@@ -73,19 +75,15 @@
VMOVE(skt.u_vec, u_vec);
VMOVE(skt.v_vec, v_vec);
skt.vert_count = 10;
- skt.verts = (point2d_t *)bu_calloc(skt.vert_count, sizeof(point2d_t),
"verts");
- for (i=0; i<skt.vert_count; i++) {
- V2MOVE(skt.verts[i], verts[i]);
- }
+ skt.verts = verts;
skt.curve.count = 6;
- skt.curve.reverse = (int *)bu_calloc(skt.curve.count, sizeof(int),
"reverse");
+ skt.curve.reverse = reverse;
+ skt.curve.segment = segments;
- skt.curve.segment = (genptr_t *)bu_calloc(skt.curve.count,
sizeof(genptr_t), "segs");
-
bsg.magic = CURVE_BEZIER_MAGIC;
bsg.degree = 4;
- bsg.ctl_points = (int *)bu_calloc(bsg.degree+1, sizeof(int),
"bsg.ctl_points");
+ bsg.ctl_points = ctrl_points;
bsg.ctl_points[0] = 4;
bsg.ctl_points[1] = 7;
bsg.ctl_points[2] = 9;
@@ -126,10 +124,6 @@
/* cleanup and release */
wdb_close(outfp);
- bu_free(bsg.ctl_points, "bsg.ctl_points");
- bu_free(skt.curve.segment, "segs");
- bu_free(skt.curve.reverse, "reverse");
- bu_free(skt.verts, "verts");
return 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