rewrite (double)literal --> floating-point-literal

This commit is contained in:
rlar 2011-08-09 08:07:56 +00:00
parent e7ce26c118
commit 9e86e5ca66
14 changed files with 70 additions and 72 deletions

View File

@ -1,3 +1,19 @@
2011-08-09 Robert Larice
* src/main.c
* src/frontend/plotting/graf.c
* src/frontend/plotting/grid.c
* src/frontend/plotting/x11.c
* src/frontend/wdisp/windisp.c
* src/spicelib/analysis/acan.c
* src/spicelib/analysis/dcop.c
* src/spicelib/analysis/dctran.c
* src/spicelib/analysis/dctrcurv.c
* src/spicelib/analysis/distoan.c
* src/spicelib/analysis/pzan.c
* src/spicelib/parser/inpeval.c
* src/spicelib/parser/inpptree.c
rewrite (double)literal --> floating-point-literal
2011-08-08 Holger Vogt
* src/frontend/com_fft.c, src/maths/fft/fftext.c, fftext.h,
fftlib.c, fftlib.h, matlib.c, matlib.h: convert float to double

View File

@ -297,7 +297,7 @@ gr_point(struct dvec *dv,
break;
case PLOT_COMB:
DatatoScreen(currentgraph,
(double) 0, currentgraph->datawindow.ymin,
0.0, currentgraph->datawindow.ymin,
&dummy, &ymin);
DevDrawLine(tox, ymin, tox, toy);
break;

View File

@ -852,7 +852,7 @@ drawpolargrid(GRAPH *graph)
DevDrawArc(graph->grid.xaxis.circular.center,
graph->grid.yaxis.circular.center,
graph->grid.xaxis.circular.radius,
(double) 0.0, 2*M_PI);
0.0, 2*M_PI);
SetLinestyle(1);
/* Now draw the circles. */
@ -1251,7 +1251,7 @@ drawsmithgrid(GRAPH *graph)
} else {
zheight = gr_radius;
}
for (ki[k] = kr[k] = (double) 0; k > 0; k--) {
for (ki[k] = kr[k] = 0.0; k > 0; k--) {
(void) sprintf(plab, "%g", rnorm[k]);
(void) sprintf(nlab, "-%g", rnorm[k]);
arcset(graph, rr[k], kr[k], ir[k], ki[k], pixperunit,

View File

@ -730,7 +730,7 @@ slopelocation(GRAPH *graph, int x0, int y0)
angle = RAD_TO_DEG * atan2( fy0, fx0 );
fprintf(stdout, "r0 = %g, a0 = %g\n",
sqrt( fx0*fx0 + fy0*fy0 ),
(angle>0)?angle:(double) 360+angle);
(angle>0)?angle:360.0+angle);
}

View File

@ -436,7 +436,7 @@ LRESULT CALLBACK PlotWindowProc( HWND hwnd,
angle = RAD_TO_DEG * atan2( fy0, fx0 );
fprintf(stdout, "r0 = %g, a0 = %g\n",
sqrt( fx0*fx0 + fy0*fy0 ),
(angle>0)?angle:(double) 360+angle);
(angle>0)?angle:360.0+angle);
}
} else {
/* need to print info about two points */

View File

@ -467,7 +467,7 @@ SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator)
CONSTroot2 = sqrt(2.);
CONSTvt0 = CONSTboltz * (27 /* deg c */ + CONSTCtoK ) / CHARGE;
CONSTKoverQ = CONSTboltz / CHARGE;
CONSTe = exp((double)1.0);
CONSTe = exp(1.0);
return(OK);
}

View File

@ -135,7 +135,7 @@ ACan(CKTcircuit *ckt, int restart)
tfree(nameList);
ipc_send_dcop_prefix();
CKTdump(ckt,(double)0,acPlot);
CKTdump(ckt, 0.0, acPlot);
ipc_send_dcop_suffix();
SPfrontEnd->OUTendPlot (acPlot);
@ -156,7 +156,7 @@ ACan(CKTcircuit *ckt, int restart)
ckt->CKTcurJob, "AC Operating Point",
NULL, IF_REAL, numNames, nameList, IF_REAL, &plot);
if(error) return(error);
CKTdump(ckt,(double)0,plot);
CKTdump(ckt, 0.0, plot);
SPfrontEnd->OUTendPlot (plot);
plot = NULL;
}

View File

@ -144,7 +144,7 @@ DCop(CKTcircuit *ckt, int notused)
if(g_ipc.enabled)
ipc_send_dcop_prefix();
CKTdump(ckt,(double)0,plot);
CKTdump(ckt, 0.0, plot);
if(g_ipc.enabled)
ipc_send_dcop_suffix();
@ -152,7 +152,7 @@ DCop(CKTcircuit *ckt, int notused)
/* gtri - end - wbk */
#else
if(converged == 0) {
CKTdump(ckt,(double)0,plot);
CKTdump(ckt, 0.0, plot);
} else {
fprintf(stderr,"error: circuit reload failed.\n");
}

View File

@ -256,7 +256,7 @@ DCtran(CKTcircuit *ckt,
/* Send the operating point results for Mspice compatibility */
if(g_ipc.enabled) {
ipc_send_dcop_prefix();
CKTdump(ckt,(double)0,(((TRANan*)ckt->CKTcurJob)->TRANplot));
CKTdump(ckt, 0.0, ((TRANan*)ckt->CKTcurJob)->TRANplot);
ipc_send_dcop_suffix();
}

View File

@ -415,7 +415,7 @@ resume:
if(g_ipc.enabled && firstTime) {
ipc_send_dcop_prefix();
CKTdump(ckt,(double) 0,plot);
CKTdump(ckt, 0.0, plot);
ipc_send_dcop_suffix();
}

View File

@ -111,7 +111,7 @@ time1 = SPfrontEnd->IFseconds();
ckt->CKTcurJob, "Distortion Operating Point",
NULL, IF_REAL, numNames, nameList, IF_REAL, &acPlot);
if(error) return(error);
CKTdump(ckt,(double)0,acPlot);
CKTdump(ckt, 0.0, acPlot);
SPfrontEnd->OUTendPlot (acPlot);
acPlot = NULL;
}

View File

@ -49,7 +49,7 @@ PZan(CKTcircuit *ckt, int reset)
ckt->CKTcurJob, "Distortion Operating Point",
NULL, IF_REAL, numNames, nameList, IF_REAL, &plot);
if(error) return(error);
CKTdump(ckt,(double)0,plot);
CKTdump(ckt, 0.0, plot);
SPfrontEnd->OUTendPlot (plot);
}

View File

@ -28,11 +28,11 @@ double INPevaluate(char **line, int *error, int gobble)
* errors in v(1,2) exp */
*error = INPgetUTok(line, &token, 0);
if (*error)
return ((double) 0.0);
return (0.0);
} else if (gobble == 2) {
*error = INPgetU2Tok(line, &token, 0);
if (*error)
return ((double) 0.0);
return (0.0);
} else {
token = *line;
*error = 0;
@ -176,7 +176,7 @@ double INPevaluate(char **line, int *error, int gobble)
*line = here;
}
return (sign * mantis *
pow((double) 10,
pow(10.0,
(double) (expo1 + expsgn * expo2)));
}
} else if ((*(here + 1) == 'I') || (*(here + 1) == 'i')) {
@ -189,7 +189,7 @@ double INPevaluate(char **line, int *error, int gobble)
*line = here;
}
return (sign * mantis *
pow((double) 10,
pow(10.0,
(double) (expo1 + expsgn * expo2)));
}
}
@ -207,5 +207,5 @@ double INPevaluate(char **line, int *error, int gobble)
*line = here;
}
return (sign * mantis *
pow((double) 10, (double) (expo1 + expsgn * expo2)));
pow(10.0, (double) (expo1 + expsgn * expo2)));
}

View File

@ -174,15 +174,15 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
case PT_TEMPERATURE:
case PT_FREQUENCY:
case PT_CONSTANT:
newp = mkcon((double) 0);
newp = mkcon(0.0);
break;
case PT_VAR:
/* Is this the variable we're differentiating wrt? */
if (p->valueIndex == varnum)
newp = mkcon((double) 1);
newp = mkcon(1.0);
else
newp = mkcon((double) 0);
newp = mkcon(0.0);
break;
case PT_PLUS:
@ -210,7 +210,7 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
p->right), mkb(PT_TIMES,
p->left,
arg2)),
mkb(PT_POWER, p->right, mkcon((double) 2)));
mkb(PT_POWER, p->right, mkcon(2.0)));
break;
case PT_POWER:
@ -279,76 +279,60 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
break;
case PTF_SGN:
arg1 = mkcon((double) 0.0);
arg1 = mkcon(0.0);
break;
case PTF_ACOS: /* - 1 / sqrt(1 - u^2) */
arg1 = mkb(PT_DIVIDE, mkcon((double) -1), mkf(PTF_SQRT,
arg1 = mkb(PT_DIVIDE, mkcon(-1.0), mkf(PTF_SQRT,
mkb(PT_MINUS,
mkcon(
(double)
1),
mkcon(1.0),
mkb(PT_POWER,
p->left,
mkcon(
(double)
2)))));
mkcon(2.0)))));
break;
case PTF_ACOSH: /* 1 / sqrt(u^2 - 1) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkf(PTF_SQRT,
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkf(PTF_SQRT,
mkb(PT_MINUS,
mkb(PT_POWER,
p->left,
mkcon(
(double)
2)),
mkcon((double)
1))));
mkcon(2.0)),
mkcon(1.0))));
break;
case PTF_ASIN: /* 1 / sqrt(1 - u^2) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkf(PTF_SQRT,
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkf(PTF_SQRT,
mkb(PT_MINUS,
mkcon((double)
1),
mkcon(1.0),
mkb(PT_POWER,
p->left,
mkcon(
(double)
2)))));
mkcon(2.0)))));
break;
case PTF_ASINH: /* 1 / sqrt(u^2 + 1) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkf(PTF_SQRT,
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkf(PTF_SQRT,
mkb(PT_PLUS,
mkb(PT_POWER,
p->left,
mkcon(
(double)
2)),
mkcon((double)
1))));
mkcon(2.0)),
mkcon(1.0))));
break;
case PTF_ATAN: /* 1 / (1 + u^2) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkb(PT_PLUS,
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkb(PT_PLUS,
mkb(PT_POWER,
p->left,
mkcon((double)
2)),
mkcon((double)
1)));
mkcon(2.0)),
mkcon(1.0)));
break;
case PTF_ATANH: /* 1 / (1 - u^2) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkb(PT_MINUS,
mkcon((double) 1),
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkb(PT_MINUS,
mkcon(1.0),
mkb(PT_POWER,
p->left,
mkcon((double)
2))));
mkcon(2.0))));
break;
case PTF_COS: /* - sin(u) */
@ -365,11 +349,11 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
break;
case PTF_LN: /* 1 / u */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), p->left);
arg1 = mkb(PT_DIVIDE, mkcon(1.0), p->left);
break;
case PTF_LOG: /* log(e) / u */
arg1 = mkb(PT_DIVIDE, mkcon((double) M_LOG10E), p->left);
arg1 = mkb(PT_DIVIDE, mkcon(M_LOG10E), p->left);
break;
case PTF_SIN: /* cos(u) */
@ -381,26 +365,24 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
break;
case PTF_SQRT: /* 1 / (2 * sqrt(u)) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkb(PT_TIMES,
mkcon((double) 2),
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkb(PT_TIMES,
mkcon(2.0),
mkf(PTF_SQRT,
p->left)));
break;
case PTF_TAN: /* 1 / (cos(u) ^ 2) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkb(PT_POWER,
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkb(PT_POWER,
mkf(PTF_COS,
p->left),
mkcon((double)
2)));
mkcon(2.0)));
break;
case PTF_TANH: /* 1 / (cosh(u) ^ 2) */
arg1 = mkb(PT_DIVIDE, mkcon((double) 1), mkb(PT_POWER,
arg1 = mkb(PT_DIVIDE, mkcon(1.0), mkb(PT_POWER,
mkf(PTF_COSH,
p->left),
mkcon((double)
2)));
mkcon(2.0)));
break;
case PTF_USTEP:
@ -410,7 +392,7 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
case PTF_LT0:
case PTF_GE0:
case PTF_LE0:
arg1 = mkcon((double) 0.0);
arg1 = mkcon(0.0);
break;
case PTF_URAMP:
@ -424,11 +406,11 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
mkf(PTF_USTEP,
mkb(PT_MINUS,
p->left,
mkcon((double) 1.0))));
mkcon(1.0))));
break;
case PTF_UMINUS: /* - 1 ; like a constant (was 0 !) */
arg1 = mkcon((double) - 1.0);
arg1 = mkcon(-1.0);
break;
case PTF_PWL: /* PWL(var, x1, y1, x2, y2, ... a const list) */
@ -437,7 +419,7 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
break;
case PTF_PWL_DERIVATIVE: /* d/dvar PWL(var, ...) */
arg1 = mkcon((double) 0.0);
arg1 = mkcon(0.0);
break;
case PTF_MIN: