Revision: 42182
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42182&view=rev
Author:   brlcad
Date:     2011-01-12 23:26:34 +0000 (Wed, 12 Jan 2011)

Log Message:
-----------
protect from peculiar setjmp() use in here by making the variables set before 
and accessed afterwards as static.  candidate for removal.

Modified Paths:
--------------
    brlcad/trunk/src/mged/hideline.c

Modified: brlcad/trunk/src/mged/hideline.c
===================================================================
--- brlcad/trunk/src/mged/hideline.c    2011-01-12 23:24:57 UTC (rev 42181)
+++ brlcad/trunk/src/mged/hideline.c    2011-01-12 23:26:34 UTC (rev 42182)
@@ -71,8 +71,8 @@
 {
     char diff_solid;
     vect_t diff;
-    fastf_t len;
-    struct solid *sp;
+    fastf_t len = 0.0;
+    struct solid *sp = NULL;
 
     if (PartHeadp->pt_forw->pt_forw != PartHeadp)
        Tcl_AppendResult(INTERP, "hit_headon: multiple partitions\n", (char 
*)NULL);
@@ -124,22 +124,27 @@
 int
 f_hideline(ClientData UNUSED(clientData), Tcl_Interp *interp, int argc, const 
char *argv[])
 {
-    struct ged_display_list *gdlp;
-    struct ged_display_list *next_gdlp;
-    FILE *plotfp;
-    char visible;
-    int i, numobjs;
-    char *objname[MAXOBJECTS], title[1];
-    fastf_t len, u, step;
-    float ratio;
-    vect_t last_move;
-    struct rt_i *rtip;
+    FILE *plotfp = NULL;
+    char *objname[MAXOBJECTS] = {0};
+    char title[512] = {0};
+    char visible = 0;
+    fastf_t len = 0.0;
+    fastf_t ratio = 0.0;
+    fastf_t step = 0.0;
+    fastf_t u = 0.0;
+    int i = 0;
+    int numobjs = 0;
+    struct application a;
+    struct bn_vlist *vp = NULL;
+    struct ged_display_list *gdlp = NULL;
+    struct ged_display_list *next_gdlp = NULL;
     struct resource resource;
-    struct application a;
-    vect_t temp;
-    vect_t last, dir;
-    struct bn_vlist *vp;
-    struct solid *sp;
+    struct rt_i *rtip = NULL;
+    struct solid *sp = NULL;
+    vect_t dir = {0.0, 0.0, 0.0};
+    vect_t last = {0.0, 0.0, 0.0};
+    vect_t last_move = {0.0, 0.0, 0.0};
+    vect_t temp = {0.0, 0.0, 0.0};
 
     CHECK_DBI_NULL;
 
@@ -185,7 +190,7 @@
        Tcl_AppendResult(interp, "\t", objname[i], "\n", (char *)NULL);
 
     /* Initialization for librt */
-    if ((rtip = rt_dirbuild(dbip->dbi_filename, title, 0)) == RTI_NULL) {
+    if ((rtip = rt_dirbuild(dbip->dbi_filename, title, sizeof(title))) == 
RTI_NULL) {
        Tcl_AppendResult(interp, "f_hideline: unable to open model file \"",
                         dbip->dbi_filename, "\"\n", (char *)NULL);
        return TCL_ERROR;


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

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to