Revision: 57210
http://sourceforge.net/p/brlcad/code/57210
Author: brlcad
Date: 2013-08-28 04:35:15 +0000 (Wed, 28 Aug 2013)
Log Message:
-----------
more var scope reduction
Modified Paths:
--------------
brlcad/trunk/src/conv/comgeom/solid.c
brlcad/trunk/src/conv/cy-g.c
brlcad/trunk/src/conv/dem-g.c
Modified: brlcad/trunk/src/conv/comgeom/solid.c
===================================================================
--- brlcad/trunk/src/conv/comgeom/solid.c 2013-08-28 04:32:00 UTC (rev
57209)
+++ brlcad/trunk/src/conv/comgeom/solid.c 2013-08-28 04:35:15 UTC (rev
57210)
@@ -201,7 +201,7 @@
int i;
double r1, r2;
vect_t work;
- double m1, m2; /* Magnitude temporaries */
+ double m1; /* Magnitude temporaries */
char *name = NULL;
fastf_t dd[4*6]; /* 4 cards of 6 nums each */
point_t tmp[8]; /* 8 vectors of 3 nums each */
@@ -695,8 +695,11 @@
goto ell1;
}
- if ((version == 5 && BU_STR_EQUAL(solid_type, "ell")) ||
- BU_STR_EQUAL(solid_type, "ell1")) {
+ if ((version == 5 && BU_STR_EQUAL(solid_type, "ell"))
+ || BU_STR_EQUAL(solid_type, "ell1"))
+ {
+ double m2 = 0.0;
+
/* V, A, r */
/* GIFT4 name is "ell1", GIFT5 name is "ell" */
if (getsoldata(dd, 2*3+1, sol_work) < 0) {
Modified: brlcad/trunk/src/conv/cy-g.c
===================================================================
--- brlcad/trunk/src/conv/cy-g.c 2013-08-28 04:32:00 UTC (rev 57209)
+++ brlcad/trunk/src/conv/cy-g.c 2013-08-28 04:35:15 UTC (rev 57210)
@@ -441,7 +441,6 @@
for (y=0; y<nlt; y++) {
short r;
- long radius;
fastf_t rad;
ptr = &curves[y+1][x*3];
@@ -454,6 +453,8 @@
/* bu_log("FOUND NEGATIVE VALUE at %d,%d\n", x, y);*/
rad = 0.0;
} else {
+ long radius;
+
if (y < first_non_zero)
first_non_zero = y;
radius = (long)(r) << rshift;
Modified: brlcad/trunk/src/conv/dem-g.c
===================================================================
--- brlcad/trunk/src/conv/dem-g.c 2013-08-28 04:32:00 UTC (rev 57209)
+++ brlcad/trunk/src/conv/dem-g.c 2013-08-28 04:35:15 UTC (rev 57210)
@@ -163,11 +163,12 @@
{
/* it is expected the out_string points to */
/* a string of at least 3 characters */
- unsigned char highbyte = '\0';
- unsigned char lowbyte = '\0';
int status = BRLCAD_ERROR;
if ((in_value >= 0) && (in_value <= 65535)) {
+ unsigned char highbyte = '\0';
+ unsigned char lowbyte = '\0';
+
highbyte = (unsigned char)floor(in_value / 256);
lowbyte = (unsigned char)(in_value - (highbyte * 256));
out_string[0] = highbyte;
@@ -296,8 +297,6 @@
int sub_element = 0;
char *search_result_uppercase;
char *search_result_lowercase;
- double tmp_dbl = 0;
- long tmp_long = 0;
char *endp;
char *buf = '\0';
int status = BRLCAD_ERROR;
@@ -376,6 +375,8 @@
* --------------------------------------------------------------------
*/
if (datatype == type_integer) {
+ long tmp_long = 0;
+
/* sub_element was defined as a integer */
tmp_long = strtol(tmp_str, &endp, 10);
if ((tmp_str != endp) && (*endp == '\0')) {
@@ -396,6 +397,8 @@
* --------------------------------------------------------------------
*/
if (datatype == type_double) {
+ double tmp_dbl = 0;
+
/* sub_element was defined as a double */
if ((search_result_uppercase = strchr(tmp_str, 'D')) != NULL) {
/* uppercase 'D' found, replace with 'E' */
@@ -412,6 +415,7 @@
}
}
}
+
/* convert to double */
tmp_dbl = strtod(tmp_str, &endp);
if ((tmp_str != endp) && (*endp == '\0')) {
@@ -766,8 +770,6 @@
double *in_z_spatial_resolution_ptr,
double *in_datum_elevation_in_curr_b_record_ptr)
{
- long int dem_max_raw_clipped_elevation = 0;
- double dem_max_real_clipped_elevation = 0;
double raw_dem_2_raw_dsp_manual_scale_factor_lowerlimit = 0;
double raw_dem_2_raw_dsp_manual_scale_factor_upperlimit = 0;
@@ -791,6 +793,9 @@
bu_log("Entered scale factor '%g' matches the default computed scale
factor.\n", *in_raw_dem_2_raw_dsp_manual_scale_factor_ptr);
} else {
if (*in_raw_dem_2_raw_dsp_manual_scale_factor_ptr >
*in_raw_dem_2_raw_dsp_auto_scale_factor_ptr) {
+ long int dem_max_raw_clipped_elevation = 0;
+ double dem_max_real_clipped_elevation = 0;
+
/* clipping. manual scale factor > auto scale factor
* derived_dem_max_raw_elevation is any value 0-999999
*/
@@ -858,7 +863,6 @@
double *in_z_spatial_resolution_ptr,
double *in_datum_elevation_in_curr_b_record_ptr)
{
- double dem_max_real_clipped_elevation = 0;
long int manual_dem_max_raw_elevation_lowerlimit = 1;
long int manual_dem_max_raw_elevation_upperlimit = 999999;
@@ -888,6 +892,8 @@
bu_log("Entered DEM max raw elevation '%ld' matches actual DEM max raw
elevation.\n", *in_manual_dem_max_raw_elevation_ptr);
} else {
if (*in_manual_dem_max_raw_elevation_ptr <
*in_derived_dem_max_raw_elevation_ptr) {
+ double dem_max_real_clipped_elevation = 0;
+
/* clipping. user input 'dem max raw elevation' <
* 'derived dem max raw elevation'
* derived_dem_max_raw_elevation is any value 0-999999
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits