fix usage of an uninitialized variable

This commit is contained in:
rlar 2011-07-23 20:02:19 +00:00
parent 36666a2991
commit 06bbefb5ee
3 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2011-07-23 Robert Larice
* src/xspice/cm/cmutil.c :
fix usage of an uninitialized variable
2011-07-23 Robert Larice
* src/spicelib/analysis/cktsens.c :
fix usage of an uninitialized variable

View File

@ -217,6 +217,10 @@ int sens_sens(CKTcircuit *ckt, int restart)
} else {
/*XXX Restore saved state */
output_values = NULL;
output_cvalues = NULL;
fprintf(stderr, "ERROR: restore is not implemented for cktsens\n");
exit(1);
}
#ifdef ASDEBUG

View File

@ -385,6 +385,7 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size,
if (x_input <= (*(x+1) + *x)/2.0) {/*** x_input below lowest midpoint ***/
*dout_din = (*(y+1) - *y)/(*(x+1) - *x);
out = *y + (x_input - *x) * *dout_din;
return out;
}
else {
if (x_input >= (*(x+size-2) + *(x+size-1))/2.0) {
@ -392,6 +393,7 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size,
*dout_din = (*(y+size-1) - *(y+size-2)) /
(*(x+size-1) - *(x+size-2));
out = *(y+size-1) + (x_input - *(x+size-1)) * *dout_din;
return out;
}
else { /*** x_input within bounds of end midpoints... ***/
/*** must determine position progressively & then ***/
@ -428,6 +430,7 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size,
if (x_input < threshold_lower) { /* Lower linear region */
*dout_din = (*(y+i) - *(y+i-1))/lower_seg;
out = *(y+i) + (x_input - *(x+i)) * *dout_din;
return out;
}
else {
if (x_input < threshold_upper) { /* Parabolic region */
@ -435,10 +438,12 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size,
upper_slope = (*(y+i+1) - *(y+i))/upper_seg;
cm_smooth_corner(x_input,*(x+i),*(y+i),input_domain,
lower_slope,upper_slope,&out,dout_din);
return out;
}
else { /* Upper linear region */
*dout_din = (*(y+i+1) - *(y+i))/upper_seg;
out = *(y+i) + (x_input - *(x+i)) * *dout_din;
return out;
}
}
break; /* Break search loop...x_input has been found, */
@ -447,7 +452,7 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size,
}
}
}
return out;
return NAN;
}