Revision: 41832
http://brlcad.svn.sourceforge.net/brlcad/?rev=41832&view=rev
Author: brlcad
Date: 2010-12-29 07:22:13 +0000 (Wed, 29 Dec 2010)
Log Message:
-----------
quell verbose compilation warnings including unused args, struct init, and
shadow warnings.
Modified Paths:
--------------
brlcad/trunk/src/gtools/beset/beset.c
brlcad/trunk/src/gtools/beset/fitness.c
brlcad/trunk/src/gtools/beset/population.c
brlcad/trunk/src/gtools/beset/population.h
brlcad/trunk/src/gtools/g_lint.c
brlcad/trunk/src/gtools/g_transfer.c
brlcad/trunk/src/gtools/remapid.c
Modified: brlcad/trunk/src/gtools/beset/beset.c
===================================================================
--- brlcad/trunk/src/gtools/beset/beset.c 2010-12-29 06:45:51 UTC (rev
41831)
+++ brlcad/trunk/src/gtools/beset/beset.c 2010-12-29 07:22:13 UTC (rev
41832)
@@ -56,7 +56,7 @@
{
if (((struct individual *)p2)->fitness > ((struct individual
*)p1)->fitness)
return -1;
- else if (((struct individual *)p2)->fitness == ((struct individual
*)p1)->fitness)
+ else if (EQUAL(((struct individual *)p2)->fitness, ((struct individual
*)p1)->fitness))
return 0;
else
return 1;
@@ -120,7 +120,7 @@
struct fitness_state fstate;
struct population pop = {NULL, NULL, NULL, NULL, NULL, 0};
char dbname[256] = {0};
- struct beset_options opts = {DEFAULT_POP_SIZE, DEFAULT_GENS, DEFAULT_RES,
0, 0};
+ struct beset_options opts = {DEFAULT_POP_SIZE, DEFAULT_GENS, DEFAULT_RES,
0, 0, 0, 0};
struct individual *tmp = NULL;
int ac;
struct db_i *source_db;
Modified: brlcad/trunk/src/gtools/beset/fitness.c
===================================================================
--- brlcad/trunk/src/gtools/beset/fitness.c 2010-12-29 06:45:51 UTC (rev
41831)
+++ brlcad/trunk/src/gtools/beset/fitness.c 2010-12-29 07:22:13 UTC (rev
41832)
@@ -74,7 +74,7 @@
* C A P T U R E _ H I T --- called by rt_shootray(), stores a ray that
hit the shape
*/
int
-capture_hit(register struct application *ap, struct partition *partHeadp,
struct seg *segs)
+capture_hit(register struct application *ap, struct partition *partHeadp,
struct seg *UNUSED(segs))
{
register struct partition *pp;
struct part *add;
@@ -107,7 +107,7 @@
* C O M P A R E _ H I T -- compare a ray that hit to source
*/
int
-compare_hit(register struct application *ap, struct partition *partHeadp,
struct seg *segs)
+compare_hit(register struct application *ap, struct partition *partHeadp,
struct seg *UNUSED(segs))
{
register struct partition *pp=NULL;
register struct part *mp=NULL;
@@ -295,7 +295,7 @@
*
*/
void
-rt_worker(int cpu, genptr_t g)
+rt_worker(int UNUSED(cpu), genptr_t g)
{
struct application ap;
struct fitness_state *fstate = (struct fitness_state *)g;
Modified: brlcad/trunk/src/gtools/beset/population.c
===================================================================
--- brlcad/trunk/src/gtools/beset/population.c 2010-12-29 06:45:51 UTC (rev
41831)
+++ brlcad/trunk/src/gtools/beset/population.c 2010-12-29 07:22:13 UTC (rev
41832)
@@ -45,7 +45,7 @@
/* FIXME: get rid of globals*/
-float *idx;
+float *randomer;
int shape_number;
@@ -62,8 +62,8 @@
p->name = bu_malloc(sizeof(char **) * size, "names");
#define SEED 33
- /* init in main() bn_rand_init(idx, SEED);*/
- bn_rand_init(idx, SEED);
+ /* init in main() bn_rand_init(randomer, SEED);*/
+ bn_rand_init(randomer, SEED);
}
/**
@@ -177,12 +177,12 @@
pop_wrand_ind(struct individual *i, int size, fastf_t total_fitness, int
offset)
{
int n = offset;
- fastf_t rindex, psum = 0;
- rindex =pop_rand() * total_fitness;
+ fastf_t idx, psum = 0;
+ idx =pop_rand() * total_fitness;
psum = i[n].fitness;
for (n = offset+1; n < size; n++) {
psum += i[n].fitness;
- if ( rindex <= psum )
+ if ( idx <= psum )
return n-1;
}
return size-1;
@@ -194,7 +194,7 @@
fastf_t
pop_rand (void)
{
- return bn_rand0to1(idx);
+ return bn_rand0to1(randomer);
}
/**
@@ -204,7 +204,7 @@
int
pop_wrand_gop(void)
{
- float i = bn_rand0to1(idx);
+ float i = bn_rand0to1(randomer);
if (i < 0.1)
return REPRODUCE;
if (i < 0.3)
Modified: brlcad/trunk/src/gtools/beset/population.h
===================================================================
--- brlcad/trunk/src/gtools/beset/population.h 2010-12-29 06:45:51 UTC (rev
41831)
+++ brlcad/trunk/src/gtools/beset/population.h 2010-12-29 07:22:13 UTC (rev
41832)
@@ -30,10 +30,10 @@
#define GEO_SPHERE 1
-#define VSCALE_SELF(a, c) { (a)[X] *= (c); (a)[Y] *= (c); (a)[Z]*=(c);}
+#define VSCALE_SELF(a, c) { (a)[X] *= (c); (a)[Y] *= (c); (a)[Z]*=(c); }
#define VMUTATE(a) {VMUT(a, -MUT_STEP/2+MUT_STEP*pop_rand())}
-#define VMUT(a, c) {(a)[X] += ((a)[X] == 0)?0:(c); (a)[Y] += ((a)[Y] ==
0)?0:(c); (a)[Z]+=((a)[Z]==0)?0:(c);}
-#define MUT_STEP .8
+#define VMUT(a, c) {(a)[X] += (NEAR_ZERO((a)[X], SMALL_FASTF))?0.0:(c); (a)[Y]
+= (NEAR_ZERO((a)[Y], SMALL_FASTF))?0.0:(c); (a)[Z]+=(NEAR_ZERO((a)[Z],
SMALL_FASTF))?0:(c);}
+#define MUT_STEP 0.8
Modified: brlcad/trunk/src/gtools/g_lint.c
===================================================================
--- brlcad/trunk/src/gtools/g_lint.c 2010-12-29 06:45:51 UTC (rev 41831)
+++ brlcad/trunk/src/gtools/g_lint.c 2010-12-29 07:22:13 UTC (rev 41832)
@@ -179,7 +179,7 @@
*
* Reports a usage message on stderr.
*/
-void printusage (void)
+void printusage(void)
{
char **u;
@@ -191,7 +191,7 @@
/**
* C R E A T E _ S E G M E N T
*/
-struct g_lint_seg *create_segment (void)
+struct g_lint_seg *create_segment(void)
{
struct g_lint_seg *sp;
@@ -210,7 +210,7 @@
* This routine writes one overlap segent to stdout.
* It's the workhorse of the reporting process for overlaps.
*/
-void print_segment (const char *r1name, const char *r2name, double seg_length,
point_t origin, point_t entrypt, point_t exitpt)
+void print_segment(const char *r1name, const char *r2name, double seg_length,
point_t origin, point_t entrypt, point_t exitpt)
{
printf("overlap ");
if (origin)
@@ -223,7 +223,7 @@
/**
* C R E A T E _ O V E R L A P
*/
-struct g_lint_ovlp *create_overlap (struct region *r1, struct region *r2)
+struct g_lint_ovlp *create_overlap(struct region *r1, struct region *r2)
{
struct g_lint_ovlp *op;
@@ -254,7 +254,7 @@
/**
* F R E E _ O V E R L A P
*/
-void free_overlap (struct g_lint_ovlp *op)
+void free_overlap(struct g_lint_ovlp *op)
{
BU_CKMAG(op, G_LINT_OVLP_MAGIC, "g_lint overlap structure");
@@ -273,7 +273,7 @@
* The call-back for finally outputting data for all the overlap
* segments between any two regions.
*/
-void _print_overlap (void *v, int show_origin)
+void _print_overlap(void *v, int show_origin)
{
const char *r1name, *r2name;
struct g_lint_ovlp *op = (struct g_lint_ovlp *) v;
@@ -299,7 +299,7 @@
* A wrapper for _print_overlap() for use when you don't want to print
* the ray origin.
*/
-void print_overlap (void *v, int depth)
+void print_overlap(void *v, int UNUSED(depth))
{
_print_overlap(v, 0);
}
@@ -311,7 +311,7 @@
* A wrapper for _print_overlap() for use when you do want to print
* the ray origin.
*/
-void print_overlap_o (void *v, int depth)
+void print_overlap_o(void *v, int UNUSED(depth))
{
_print_overlap(v, 1);
}
@@ -322,7 +322,7 @@
*
* The red-black-tree comparison callback for the overlap log.
*/
-int compare_overlaps (void *v1, void *v2)
+int compare_overlaps(void *v1, void *v2)
{
struct g_lint_ovlp *o1 = (struct g_lint_ovlp *) v1;
struct g_lint_ovlp *o2 = (struct g_lint_ovlp *) v2;
@@ -349,7 +349,7 @@
* The red-black-tree comparison callback for the final re-sorting of
* the overlaps by volume.
*/
-int compare_by_vol (void *v1, void *v2)
+int compare_by_vol(void *v1, void *v2)
{
struct g_lint_ovlp *o1 = (struct g_lint_ovlp *) v1;
struct g_lint_ovlp *o2 = (struct g_lint_ovlp *) v2;
@@ -372,7 +372,7 @@
* The call-back, used in traversing the overlap log, to insert
* overlaps into the sorted-by-volume tree.
*/
-void insert_by_vol (void *v, int depth)
+void insert_by_vol(void *v, int UNUSED(depth))
{
int rc; /* Return code from bu_rb_insert() */
struct g_lint_ovlp *op = (struct g_lint_ovlp *) v;
@@ -392,7 +392,7 @@
* routine creates a new entry in the overlap log. Either way, it
* then modifies their entry to record this particular find.
*/
-void update_ovlp_log (struct region *r1, struct region *r2, double seg_length,
fastf_t *origin, fastf_t *entrypt, fastf_t *exitpt)
+void update_ovlp_log(struct region *r1, struct region *r2, double seg_length,
fastf_t *origin, fastf_t *entrypt, fastf_t *exitpt)
{
int rc; /* Return code from bu_rb_insert() */
struct g_lint_ovlp *op;
@@ -429,14 +429,14 @@
op->glo_seg_last = sp;
}
-unsigned char *get_color (unsigned char *ucp, unsigned long x)
+unsigned char *get_color(unsigned char *ucp, unsigned long x)
{
- int index;
+ int idx;
- for (index = 0; x > 1; ++index)
+ for (idx = 0; x > 1; ++idx)
x >>= 1;
- return ucp + (index * 3);
+ return ucp + (idx * 3);
}
@@ -459,7 +459,7 @@
*
* The function returns the number of possible problems it discovers.
*/
-static int rpt_hit (struct application *ap, struct partition *ph, struct seg
*dummy)
+static int rpt_hit(struct application *ap, struct partition *ph, struct seg
*UNUSED(dummy))
{
struct partition *pp;
vect_t delta;
@@ -700,7 +700,7 @@
*
* Null event handler for use by rt_shootray().
*/
-static int no_op_overlap (struct application *ap, struct partition *pp, struct
region *r1, struct region *r2, struct partition *hp)
+static int no_op_overlap(struct application *UNUSED(ap), struct partition
*UNUSED(pp), struct region *UNUSED(r1), struct region *UNUSED(r2), struct
partition *UNUSED(hp))
{
return 0;
}
@@ -711,7 +711,7 @@
*
* Null event handler for use by rt_shootray().
*/
-static int no_op_hit (struct application *ap, struct partition *ph, struct seg
*dummy)
+static int no_op_hit(struct application *UNUSED(ap), struct partition
*UNUSED(ph), struct seg *UNUSED(dummy))
{
return 1;
}
@@ -722,7 +722,7 @@
*
* Null event handler for use by rt_shootray().
*/
-static int no_op_miss (struct application *ap)
+static int no_op_miss(struct application *UNUSED(ap))
{
return 1;
}
@@ -737,7 +737,7 @@
* greater than tolerance. The function returns 1 if the overlap was
* large enough to report, otherwise 0.
*/
-static int rpt_ovlp (struct application *ap, struct partition *pp, struct
region *r1, struct region *r2, struct partition *hp)
+static int rpt_ovlp(struct application *ap, struct partition *pp, struct
region *r1, struct region *r2, struct partition *UNUSED(hp))
{
vect_t delta;
fastf_t mag_del;
@@ -782,7 +782,7 @@
return mag_del > tolerance;
}
-void init_plot3 (struct application *ap)
+void init_plot3(struct application *ap)
{
struct rt_i *rtip;
struct g_lint_ctrl *cp;
@@ -798,7 +798,7 @@
int
-main (int argc, char **argv)
+main(int argc, char **argv)
{
struct application ap;
char db_title[TITLE_LEN+1]; /* Title of database */
@@ -1044,7 +1044,7 @@
bu_rb_walk1(ovlps_by_vol, print_overlap, INORDER);
}
- bu_exit (0, NULL);
+ return 0;
}
/*
Modified: brlcad/trunk/src/gtools/g_transfer.c
===================================================================
--- brlcad/trunk/src/gtools/g_transfer.c 2010-12-29 06:45:51 UTC (rev
41831)
+++ brlcad/trunk/src/gtools/g_transfer.c 2010-12-29 07:22:13 UTC (rev
41832)
@@ -97,14 +97,14 @@
int
-hit(struct application *ap, struct partition *p, struct seg *s)
+hit(struct application *UNUSED(ap), struct partition *UNUSED(p), struct seg
*UNUSED(s))
{
bu_log("HIT!\n");
return 0;
}
int
-miss(struct application *ap)
+miss(struct application *UNUSED(ap))
{
bu_log("MISSED!\n");
return 0;
@@ -150,7 +150,7 @@
void
-server_helo(struct pkg_conn *connection, char *buf)
+server_helo(struct pkg_conn *UNUSED(connection), char *buf)
{
/* should not encounter since we listened for it specifically
* before beginning processing of packets.
@@ -161,7 +161,7 @@
void
-server_args(struct pkg_conn *connection, char *buf)
+server_args(struct pkg_conn *UNUSED(connection), char *buf)
{
/* updates the srv_argc and srv_argv application globals used to
* show that we can shoot at geometry in-memory.
@@ -182,7 +182,7 @@
void
-server_geom(struct pkg_conn *connection, char *buf)
+server_geom(struct pkg_conn *UNUSED(connection), char *buf)
{
struct bu_external ext;
struct db5_raw_internal raw;
@@ -213,7 +213,7 @@
void
-server_ciao(struct pkg_conn *connection, char *buf)
+server_ciao(struct pkg_conn *UNUSED(connection), char *buf)
{
bu_log("CIAO encountered\n");
@@ -244,11 +244,11 @@
char *title;
struct pkg_switch callbacks[] = {
- {MSG_HELO, server_helo, "HELO"},
- {MSG_ARGS, server_args, "ARGS"},
- {MSG_GEOM, server_geom, "GEOM"},
- {MSG_CIAO, server_ciao, "CIAO"},
- {0, 0, (char *)0}
+ {MSG_HELO, server_helo, "HELO", NULL},
+ {MSG_ARGS, server_args, "ARGS", NULL},
+ {MSG_GEOM, server_geom, "GEOM", NULL},
+ {MSG_CIAO, server_ciao, "CIAO", NULL},
+ {0, 0, NULL, NULL}
};
validate_port(port);
Modified: brlcad/trunk/src/gtools/remapid.c
===================================================================
--- brlcad/trunk/src/gtools/remapid.c 2010-12-29 06:45:51 UTC (rev 41831)
+++ brlcad/trunk/src/gtools/remapid.c 2010-12-29 07:22:13 UTC (rev 41832)
@@ -64,6 +64,7 @@
#define bu_stdin (&bu_iob[0])
extern REMAPID_FILE bu_iob[1];
#define REMAPID_FILE_NO_COMMENT -1
+#define COMMA ','
/*
@@ -396,7 +397,7 @@
*
*/
void
-print_curr_id(void *v, int depth)
+print_curr_id(void *v, int UNUSED(depth))
{
struct curr_id *cip = (struct curr_id *) v;
struct remap_reg *rp;
@@ -418,7 +419,7 @@
*
*/
void
-print_nonempty_curr_id(void *v, int depth)
+print_nonempty_curr_id(void *v, int UNUSED(depth))
{
struct curr_id *cip = (struct curr_id *) v;
struct remap_reg *rp;
@@ -604,7 +605,7 @@
while (isspace(*ch))
*ch = remapid_fgetc(sfp);
switch (*ch) {
- case ', ':
+ case COMMA:
case ':':
return 1;
case '-':
@@ -672,7 +673,7 @@
ch = remapid_fgetc(sfp);
switch (ch) {
- case ', ':
+ case COMMA:
continue;
case ':':
ch = remapid_fgetc(sfp);
@@ -751,7 +752,7 @@
*
*/
void
-write_assignment(void *v, int depth)
+write_assignment(void *v, int UNUSED(depth))
{
int region_id;
struct curr_id *cip = (struct curr_id *) v;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits