Revision: 42187
http://brlcad.svn.sourceforge.net/brlcad/?rev=42187&view=rev
Author: brlcad
Date: 2011-01-12 23:40:38 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
init vars before they're used, especially when they're only set within
conditionals.
Modified Paths:
--------------
brlcad/trunk/src/mged/cad_parea.c
brlcad/trunk/src/mged/chgview.c
brlcad/trunk/src/mged/clone.c
Modified: brlcad/trunk/src/mged/cad_parea.c
===================================================================
--- brlcad/trunk/src/mged/cad_parea.c 2011-01-12 23:39:45 UTC (rev 42186)
+++ brlcad/trunk/src/mged/cad_parea.c 2011-01-12 23:40:38 UTC (rev 42187)
@@ -54,11 +54,11 @@
/* argument count */
/* argument strings */
{
- point previous; /* previous point */
- point current; /* current point */
- point first; /* saved first point */
- int saved; /* "`first' valid" flag */
- double sum; /* accumulator */
+ point previous = {0.0, 0.0}; /* previous point */
+ point current = {0.0, 0.0}; /* current point */
+ point first = {0.0, 0.0}; /* saved first point */
+ int saved; /* "`first' valid" flag */
+ double sum; /* accumulator */
if (!GetArgs(argc, argv)) {
/* process command arguments */
Modified: brlcad/trunk/src/mged/chgview.c
===================================================================
--- brlcad/trunk/src/mged/chgview.c 2011-01-12 23:39:45 UTC (rev 42186)
+++ brlcad/trunk/src/mged/chgview.c 2011-01-12 23:40:38 UTC (rev 42187)
@@ -292,7 +292,7 @@
/* check args for "-A" (attributes) and "-o" and "-R" */
bu_vls_init(&vls);
bu_vls_strcpy(&vls, argv[0]);
- for (i=1; i<argc; i++) {
+ for (i=1; i<(size_t)argc; i++) {
char *ptr_A=NULL;
char *ptr_o=NULL;
char *ptr_R=NULL;
@@ -344,7 +344,7 @@
bu_avs_init(&avs, (argc - last_opt)/2, "edit_com avs");
i = 1;
- while (i < argc) {
+ while (i < (size_t)argc) {
if (*argv[i] == '-') {
i++;
continue;
@@ -488,7 +488,7 @@
struct bu_attribute_value_set avs;
const char **objs;
int ret;
- int num_opts=0;
+ size_t num_opts=0;
CHECK_DBI_NULL;
@@ -502,7 +502,7 @@
return TCL_ERROR;
}
- for (i=1; i<argc; i++) {
+ for (i=1; i<(size_t)argc; i++) {
if (*argv[i] == '-') {
num_opts++;
} else {
@@ -511,7 +511,7 @@
}
bu_avs_init(&avs, argc/2, "muves_avs");
- for (i=1; i<argc; i++) {
+ for (i=1; i<(size_t)argc; i++) {
bu_avs_add_nonunique(&avs, "MUVES_Component", argv[i]);
}
@@ -3860,7 +3860,7 @@
int
mged_otran(const vect_t tvec)
{
- vect_t work;
+ vect_t work = {0.0, 0.0, 0.0};
if (STATE == ST_S_EDIT || STATE == ST_O_EDIT) {
/* apply acc_rot_sol to tvec */
Modified: brlcad/trunk/src/mged/clone.c
===================================================================
--- brlcad/trunk/src/mged/clone.c 2011-01-12 23:39:45 UTC (rev 42186)
+++ brlcad/trunk/src/mged/clone.c 2011-01-12 23:40:38 UTC (rev 42187)
@@ -702,8 +702,8 @@
struct directory *mdp = (struct directory *)NULL;
struct directory *copy = (struct directory *)NULL;
- struct bu_vls *copyname;
- struct bu_vls *nextname;
+ struct bu_vls *copyname = NULL;
+ struct bu_vls *nextname = NULL;
/* get the name of what the object "should" get cloned to */
copyname = get_name(_dbip, dp, state, 0);
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