Revision: 41168
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41168&view=rev
Author:   brlcad
Date:     2010-10-29 07:07:05 +0000 (Fri, 29 Oct 2010)

Log Message:
-----------
quell a slew of compilation warnings.  variable decls should be at top of 
scope.  add a couple FIXME notes for dem-g where variable-sized arrays are 
deused.  fix a handful of other UNUSED params and shadowing.

Modified Paths:
--------------
    brlcad/trunk/src/conv/asc/asc2g.c
    brlcad/trunk/src/conv/bot_shell-vtk.c
    brlcad/trunk/src/conv/comgeom/f2a.c
    brlcad/trunk/src/conv/comgeom/read.c
    brlcad/trunk/src/conv/comgeom/solid.c
    brlcad/trunk/src/conv/cy-g.c
    brlcad/trunk/src/conv/dem-g.c
    brlcad/trunk/src/conv/dxf/bot-bldxf.c

Modified: brlcad/trunk/src/conv/asc/asc2g.c
===================================================================
--- brlcad/trunk/src/conv/asc/asc2g.c   2010-10-29 06:36:42 UTC (rev 41167)
+++ brlcad/trunk/src/conv/asc/asc2g.c   2010-10-29 07:07:05 UTC (rev 41168)
@@ -55,7 +55,7 @@
 
 /* Record input buffer */
 char *buf = NULL;
-char name[NAME_LEN + 2] = {0};
+char NAME[NAME_LEN + 2] = {0};
 
 FILE *ifp = NULL;
 struct rt_wdb *ofp = NULL;
@@ -545,7 +545,7 @@
 
     cp = nxt_spc(cp);
 
-    np = name;
+    np = NAME;
     while (*cp != ' ') {
        *np++ = *cp++;
     }
@@ -566,7 +566,7 @@
        case GRP:
            VSET(center, val[0], val[1], val[2]);
            VSET(n, val[3], val[4], val[5]);
-           (void)mk_grip(ofp, name, center, n, val[6]);
+           (void)mk_grip(ofp, NAME, center, n, val[6]);
            break;
 
        case TOR:
@@ -579,7 +579,7 @@
            /* Prevent illegal torii from floating point fuzz */
            if (rad2 > rad1)  rad2 = rad1;
 
-           mk_tor(ofp, name, center, n, rad1, rad2);
+           mk_tor(ofp, NAME, center, n, rad1, rad2);
            break;
 
        case GENTGC:
@@ -590,7 +590,7 @@
            VSET(c, val[12], val[13], val[14]);
            VSET(d, val[15], val[16], val[17]);
 
-           mk_tgc(ofp, name, center, height, a, b, c, d);
+           mk_tgc(ofp, NAME, center, height, a, b, c, d);
            break;
 
        case GENELL:
@@ -599,7 +599,7 @@
            VSET(b, val[6], val[7], val[8]);
            VSET(c, val[9], val[10], val[11]);
 
-           mk_ell(ofp, name, center, a, b, c);
+           mk_ell(ofp, NAME, center, a, b, c);
            break;
 
        case GENARB8:
@@ -617,14 +617,14 @@
                VADD2(pnts[i], pnts[i], pnts[0]);
            }
 
-           mk_arb8(ofp, name, &pnts[0][X]);
+           mk_arb8(ofp, NAME, &pnts[0][X]);
            break;
 
        case HALFSPACE:
            VSET(norm, val[0], val[1], val[2]);
            dd = val[3];
 
-           mk_half(ofp, name, norm, dd);
+           mk_half(ofp, NAME, norm, dd);
            break;
 
        case RPC:
@@ -633,7 +633,7 @@
            VSET(breadth, val[6], val[7], val[8]);
            dd = val[9];
 
-           mk_rpc(ofp, name, center, height, breadth, dd);
+           mk_rpc(ofp, NAME, center, height, breadth, dd);
            break;
 
        case RHC:
@@ -643,7 +643,7 @@
            rad1 = val[9];
            dd = val[10];
 
-           mk_rhc(ofp, name, center, height, breadth, rad1, dd);
+           mk_rhc(ofp, NAME, center, height, breadth, rad1, dd);
            break;
 
        case EPA:
@@ -654,7 +654,7 @@
            rad1 = val[9];
            rad2 = val[10];
 
-           mk_epa(ofp, name, center, height, a, rad1, rad2);
+           mk_epa(ofp, NAME, center, height, a, rad1, rad2);
            break;
 
        case EHY:
@@ -666,7 +666,7 @@
            rad2 = val[10];
            dd = val[11];
 
-           mk_ehy(ofp, name, center, height, a, rad1, rad2, dd);
+           mk_ehy(ofp, NAME, center, height, a, rad1, rad2, dd);
            break;
 
        case HYP:
@@ -676,7 +676,7 @@
            rad1 = val[9];
            rad2 = val[10];
 
-           mk_hyp(ofp, name, center, height, a, rad1, rad2);
+           mk_hyp(ofp, NAME, center, height, a, rad1, rad2);
 
        case ETO:
            VSET(center, val[0], val[1], val[2]);
@@ -685,12 +685,12 @@
            rad1 = val[9];
            rad2 = val[10];
 
-           mk_eto(ofp, name, center, norm, c, rad1, rad2);
+           mk_eto(ofp, NAME, center, norm, c, rad1, rad2);
            break;
 
        default:
            bu_log("asc2g: bad solid %s s_type= %d, skipping\n",
-                  name, s_type);
+                  NAME, s_type);
     }
 
 }
@@ -782,7 +782,7 @@
     reg_flags = *cp++;         /* Y, N, or new P, F */
     cp = nxt_spc(cp);
 
-    np = name;
+    np = NAME;
     while (*cp != ' ') {
        *np++ = *cp++;
     }
@@ -861,7 +861,7 @@
     }
 
     /* Spit them out, all at once.  Use GIFT semantics. */
-    if (mk_comb(ofp, name, &head, is_reg,
+    if (mk_comb(ofp, NAME, &head, is_reg,
                temp_nflag ? matname : (char *)0,
                temp_pflag ? matparm : (char *)0,
                override ? (unsigned char *)rgb : (unsigned char *)0,

Modified: brlcad/trunk/src/conv/bot_shell-vtk.c
===================================================================
--- brlcad/trunk/src/conv/bot_shell-vtk.c       2010-10-29 06:36:42 UTC (rev 
41167)
+++ brlcad/trunk/src/conv/bot_shell-vtk.c       2010-10-29 07:07:05 UTC (rev 
41168)
@@ -129,14 +129,14 @@
 }
 
 HIDDEN int
-hit( struct application *ap, struct partition *part, struct seg *seg )
+hit( struct application *ap, struct partition *part, struct seg *UNUSED(seg))
 {
     struct partition *p;
     int surfno;
     struct soltab *stp;
     double x, y, z, nx, ny, nz;
     int face[3];
-    int i;
+    size_t i;
     struct tri_specific *tri;
     struct bot_specific *bot;
 
@@ -163,7 +163,7 @@
        } else {
            i = bot->bot_ntri - 1;
            tri = bot->bot_facelist;
-           while ( i != surfno ) {
+           while ( i != (size_t)surfno ) {
                i--;
                tri = tri->tri_forw;
            }
@@ -277,7 +277,7 @@
     } else {
        i = bot->bot_ntri - 1;
        tri = bot->bot_facelist;
-       while ( i != surfno ) {
+       while ( i != (size_t)surfno ) {
            i--;
            tri = tri->tri_forw;
        }
@@ -375,7 +375,7 @@
     struct application ap;
     int dir;
     int c;
-    long i;
+    size_t i;
     int database_index;
 
     if ( debug ) {
@@ -466,7 +466,7 @@
        verts = create_vert_tree();
     }
 
-    if ( cell_size != 0.0 ) {
+    if (!NEAR_ZERO(cell_size, SMALL_FASTF)) {
        /* do a grid of shots */
 
        ap.a_onehit = 0;
@@ -516,7 +516,7 @@
        vect_t inv_dir;
 
        /* shoot at every triangle */
-       for ( i=0; i<rtip->nsolids; i++ ) {
+       for ( i=0; i<(size_t)rtip->nsolids; i++ ) {
            stp = rtip->rti_Solids[i];
            if ( stp->st_id != ID_BOT ) {
                continue;
@@ -572,7 +572,7 @@
     }
     fprintf( fd_out, "\nASCII\n\nDATASET POLYDATA\n" );
     fprintf( fd_out, "POINTS %ld float\n", verts->curr_vert );
-    for ( i=0; i<verts->curr_vert; i++ ) {
+    for ( i=0; i<(size_t)verts->curr_vert; i++ ) {
        if ( use_normals ) {
            fprintf( fd_out, "%g %g %g\n", V3ARGS( &verts->the_array[i*6] ) );
        } else {
@@ -580,13 +580,13 @@
        }
     }
     fprintf( fd_out, "POLYGONS %ld %ld\n", num_faces, num_faces*4 );
-    for ( i=0; i<num_faces; i++ ) {
+    for ( i=0; i<(size_t)num_faces; i++ ) {
        fprintf( fd_out, "3 %ld %ld %ld\n", V3ARGS( &faces[i*3] ) );
     }
     if ( use_normals ) {
        fprintf( fd_out, "POINT_DATA %ld\n", verts->curr_vert );
        fprintf( fd_out, "NORMALS default float\n" );
-       for ( i=0; i<verts->curr_vert; i++ ) {
+       for ( i=0; i<(size_t)verts->curr_vert; i++ ) {
            fprintf( fd_out, "%g %g %g\n", V3ARGS( &verts->the_array[i*6+3] ) );
        }
     }

Modified: brlcad/trunk/src/conv/comgeom/f2a.c
===================================================================
--- brlcad/trunk/src/conv/comgeom/f2a.c 2010-10-29 06:36:42 UTC (rev 41167)
+++ brlcad/trunk/src/conv/comgeom/f2a.c 2010-10-29 07:07:05 UTC (rev 41168)
@@ -32,6 +32,7 @@
 
 
 /** F 2 A () ====  convert float to ascii  w.df format.        No leading 
blanks */
+void
 f2a(float f, char *s, int w, int d)
     /* INPUT   ===*/
     /* OUTPUT  ===*/
@@ -43,7 +44,7 @@
     {
        printf( "ftoascii: incorrect format  need w.df\n");
        printf( "w must be at least 2 bigger then d.\n" );
-       printf( "w= %f\t d= %f\n", w, d );
+       printf( "w= %d\t d= %d\n", w, d );
        printf( "STOP\n");
        bu_exit( 10, NULL );
     }

Modified: brlcad/trunk/src/conv/comgeom/read.c
===================================================================
--- brlcad/trunk/src/conv/comgeom/read.c        2010-10-29 06:36:42 UTC (rev 
41167)
+++ brlcad/trunk/src/conv/comgeom/read.c        2010-10-29 07:07:05 UTC (rev 
41168)
@@ -77,7 +77,7 @@
  *                     G E T I N T
  */
 int
-getint(char *cp, int start, int len)
+getint(char *cp, int start, size_t len)
 {
     char       buf[128];
 
@@ -92,7 +92,7 @@
  *                     G E T D O U B L E
  */
 double
-getdouble(char *cp, int start, int len)
+getdouble(char *cp, int start, size_t len)
 {
     char       buf[128];
 

Modified: brlcad/trunk/src/conv/comgeom/solid.c
===================================================================
--- brlcad/trunk/src/conv/comgeom/solid.c       2010-10-29 06:36:42 UTC (rev 
41167)
+++ brlcad/trunk/src/conv/comgeom/solid.c       2010-10-29 07:07:05 UTC (rev 
41168)
@@ -534,7 +534,6 @@
     if ( strncmp( solid_type, "wir", 3 ) == 0 )  {
        int                     numpts;         /* points per wire */
        int                     num;
-       int                     i;
        double                  dia;
        double                  *pts;           /* 3 entries per pt */
        struct  wdb_pipept      *ps;

Modified: brlcad/trunk/src/conv/cy-g.c
===================================================================
--- brlcad/trunk/src/conv/cy-g.c        2010-10-29 06:36:42 UTC (rev 41167)
+++ brlcad/trunk/src/conv/cy-g.c        2010-10-29 07:07:05 UTC (rev 41168)
@@ -445,7 +445,7 @@
            ptr = &curves[y+1][x*3];
 
            r = data[INDEX(y,x)];
-           if ((r << rshift) == VOIDVAL) {
+           if ((r << rshift) == (short)VOIDVAL) {
                /* skip void values */
                continue;
            } else if (r < 0) {

Modified: brlcad/trunk/src/conv/dem-g.c
===================================================================
--- brlcad/trunk/src/conv/dem-g.c       2010-10-29 06:36:42 UTC (rev 41167)
+++ brlcad/trunk/src/conv/dem-g.c       2010-10-29 07:07:05 UTC (rev 41168)
@@ -1565,6 +1565,7 @@
     long int column = 0;
     unsigned short int buf4 = 0;
 
+    /* FIXME: C90 forbids variable size array declarations.  use 
bu_malloc/bu_free instead. */
     /* size of buf3 determined at run time */
     unsigned short int buf3[*in_ydim];
 
@@ -1651,6 +1652,18 @@
 int
 main(int ac, char *av[])
 {
+    double raw_dem_2_raw_dsp_manual_scale_factor = 0;  /* user specified raw 
dem-to-dsp scale factor */
+    long int manual_dem_max_raw_elevation = 0;         /* user specified max 
raw elevation */
+    double manual_dem_max_real_elevation = 0;          /* user specified max 
real elevation in meters */
+    long int xdim = 0;                                 /* x dimension of dem 
(w cells) */
+    long int ydim = 0;                                 /* y dimension of dem 
(n cells) */
+    double dsp_elevation = 0;                          /* datum elevation in 
milimeters (dsp V z coordinate) */
+    double x_cell_size = 0;                            /* x scaling factor in 
milimeters */
+    double y_cell_size = 0;                            /* y scaling factor in 
milimeters */
+    double unit_elevation = 0;                         /* z scaling factor in 
milimeters */
+    char *tmp_ptr = '\0';
+    int string_length = 0;
+
     /*
      * element_counts[]
      * element_counts[record_type] = number of elements in each record type
@@ -2058,18 +2071,6 @@
 
     progname = *av;
 
-    double raw_dem_2_raw_dsp_manual_scale_factor = 0;  /* user specified raw 
dem-to-dsp scale factor */
-    long int manual_dem_max_raw_elevation = 0;         /* user specified max 
raw elevation */
-    double manual_dem_max_real_elevation = 0;          /* user specified max 
real elevation in meters */
-    long int xdim = 0;                                 /* x dimension of dem 
(w cells) */
-    long int ydim = 0;                                 /* y dimension of dem 
(n cells) */
-    double dsp_elevation = 0;                          /* datum elevation in 
milimeters (dsp V z coordinate) */
-    double x_cell_size = 0;                            /* x scaling factor in 
milimeters */
-    double y_cell_size = 0;                            /* y scaling factor in 
milimeters */
-    double unit_elevation = 0;                         /* z scaling factor in 
milimeters */
-    char *tmp_ptr = '\0';
-    int string_length = 0;
-
     if (ac < 2) {
         usage();
         bu_exit(BRLCAD_ERROR, "Exiting.\n");
@@ -2077,6 +2078,8 @@
 
     remove_whitespace(av[1]);
     string_length = strlen(av[1]) + 5;
+
+    /* FIXME: C90 forbids variable size array declarations.  use 
bu_malloc/bu_free instead. */
     char input_filename[string_length];          /* dem input file path and 
file name */
     char temp_filename[string_length];           /* temp file path and file 
name */
     char dsp_output_filename[string_length];     /* dsp output file path and 
file name */

Modified: brlcad/trunk/src/conv/dxf/bot-bldxf.c
===================================================================
--- brlcad/trunk/src/conv/dxf/bot-bldxf.c       2010-10-29 06:36:42 UTC (rev 
41167)
+++ brlcad/trunk/src/conv/dxf/bot-bldxf.c       2010-10-29 07:07:05 UTC (rev 
41168)
@@ -389,7 +389,7 @@
 }
 
 int
-r_start(struct db_tree_state * tsp, const struct db_full_path * pathp, const 
struct rt_comb_internal * combp, genptr_t client_data )
+r_start(struct db_tree_state *UNUSED(tsp), const struct db_full_path * pathp, 
const struct rt_comb_internal *UNUSED(combp), genptr_t client_data )
 {
     int i;
     if (debug&DEBUG_NAMES) {
@@ -406,7 +406,7 @@
 }
 
 union tree *
-r_end(struct db_tree_state * tsp, const struct db_full_path * pathp, union 
tree * curtree, genptr_t client_data)
+r_end(struct db_tree_state *UNUSED(tsp), const struct db_full_path * pathp, 
union tree * curtree, genptr_t client_data)
 {
     int i;
     if (debug&DEBUG_NAMES) {
@@ -467,7 +467,7 @@
 }
 
 union tree *
-l_func(struct db_tree_state * tsp, const struct db_full_path * pathp, struct 
rt_db_internal * ip, genptr_t client_data)
+l_func(struct db_tree_state *UNUSED(tsp), const struct db_full_path * pathp, 
struct rt_db_internal * ip, genptr_t client_data)
 {
     int i;
     struct rt_bot_internal *bot;


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

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to