Browse Source

cleanup some extra parentheses

pre-master-46
rlar 13 years ago
parent
commit
6050e2e0ea
  1. 6
      src/frontend/com_measure2.c
  2. 2
      src/frontend/com_sysinfo.c
  3. 2
      src/frontend/spiceif.c
  4. 6
      src/maths/ni/niiter.c
  5. 2
      src/sharedspice.c
  6. 10
      src/spicelib/analysis/dcpss.c
  7. 28
      src/spicelib/devices/cktinit.c
  8. 6
      src/spicelib/parser/inpgmod.c

6
src/frontend/com_measure2.c

@ -466,13 +466,13 @@ com_measure_when(
/* 'dc' is special: it may start at an arbitrary scale value.
Use m_td to store this value, a delay TD does not make sense */
if ((dc_check) && (i == 0))
if (dc_check && (i == 0))
meas->m_td = scaleValue;
/* if analysis tran, suppress values below TD */
if ((tran_check) && (scaleValue < meas->m_td))
if (tran_check && (scaleValue < meas->m_td))
continue;
/* if analysis ac, sp, suppress values below 0 */
else if (((ac_check)||(sp_check)) && (scaleValue < 0))
else if ((ac_check || sp_check) && (scaleValue < 0))
continue;
/* if 'dc': reset first if scale jumps back to origin */

2
src/frontend/com_sysinfo.c

@ -335,7 +335,7 @@ tesCreateSystemInfo(TesSystemInfo *info)
* if (info->numLogicalProcessors == 0) {
* char *token;
* char *cpustr = copy(inStr);
* while ((cpustr) && !*cpustr)
* while (cpustr && !*cpustr)
* if (cieq(gettok(&cpustr), "processor")) {
* gettok(&cpustr);
* token = gettok(&cpustr);

2
src/frontend/spiceif.c

@ -963,7 +963,7 @@ if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_
Call only if CKTtime > 0 to avoid conflict with previous 'reset' command.
May contain side effects because called from many places. h_vogt 110101
*/
if ((do_model) && (ckt->CKTtime > 0)) {
if (do_model && (ckt->CKTtime > 0)) {
int error = 0;
error = CKTtemp(ckt);
if (error)

6
src/maths/ni/niiter.c

@ -222,9 +222,9 @@ NIiter(CKTcircuit *ckt, int maxIter)
damp_factor=10/maxdiff;
if (damp_factor<0.1) damp_factor=0.1;
for (node = ckt->CKTnodes->next; node; node = node->next) {
diff = (ckt->CKTrhs)[node->number] -
(ckt->CKTrhsOld)[node->number];
(ckt->CKTrhs)[node->number]=(ckt->CKTrhsOld)[node->number] +
diff = ckt->CKTrhs[node->number] -
ckt->CKTrhsOld[node->number];
ckt->CKTrhs[node->number] = ckt->CKTrhsOld[node->number] +
(damp_factor * diff);
}
for(i=0; i<ckt->CKTnumStates; i++) {

2
src/sharedspice.c

@ -880,7 +880,7 @@ add_bkpt(void)
int error = 0;
CKTcircuit *ckt = ft_curckt->ci_ckt;
if((bkpttmp) && (bkpttmpsize > 0)) {
if(bkpttmp && (bkpttmpsize > 0)) {
for (i = 0; i < bkpttmpsize; i++)
error = CKTsetBreak(ckt, bkpttmp[i]);
FREE(bkpttmp);

10
src/spicelib/analysis/dcpss.c

@ -552,10 +552,10 @@ DCpss(CKTcircuit *ckt,
pss_points_cycle++ ;
/* Set the next BreakPoint for PSS */
CKTsetBreak (ckt, time_temp + (1 / ckt->CKTguessedFreq) * ((double)(pss_points_cycle) / (double)ckt->CKTpsspoints)) ;
CKTsetBreak (ckt, time_temp + (1 / ckt->CKTguessedFreq) * ((double)pss_points_cycle / (double)ckt->CKTpsspoints)) ;
#ifdef STEPDEBUG
fprintf (stderr, "Next breakpoint set in: %1.15g\n", time_temp + 1 / ckt->CKTguessedFreq * ((double)(pss_points_cycle) / (double)ckt->CKTpsspoints)) ;
fprintf (stderr, "Next breakpoint set in: %1.15g\n", time_temp + 1 / ckt->CKTguessedFreq * ((double)pss_points_cycle / (double)ckt->CKTpsspoints)) ;
#endif
} else {
@ -984,7 +984,7 @@ DCpss(CKTcircuit *ckt,
/* Update the PSS points counter and set the next Breakpoint */
pss_points_cycle++ ;
CKTsetBreak (ckt, time_temp + (1 / ckt->CKTguessedFreq) * ((double)(pss_points_cycle) / (double)ckt->CKTpsspoints)) ;
CKTsetBreak (ckt, time_temp + (1 / ckt->CKTguessedFreq) * ((double)pss_points_cycle / (double)ckt->CKTpsspoints)) ;
if (excessive_err_nodes == 0)
fprintf (stderr, "\nConvergence reached. Final circuit time is %1.10g seconds (iteration n° %d) and predicted fundamental frequency is %15.10g Hz\n", ckt->CKTtime, shooting_cycle_counter - 1, ckt->CKTguessedFreq) ;
@ -995,10 +995,10 @@ DCpss(CKTcircuit *ckt,
fprintf (stderr, "time_temp %g\n", time_temp) ;
fprintf (stderr, "IN_PSS: FIRST time point accepted in evolution for FFT calculations\n") ;
fprintf (stderr, "Circuit time %1.15g, final time %1.15g, point index %d and total requested points %ld\n",
ckt->CKTtime, time_temp + 1 / ckt->CKTguessedFreq * ((double)(pss_points_cycle) / (double)ckt->CKTpsspoints),
ckt->CKTtime, time_temp + 1 / ckt->CKTguessedFreq * ((double)pss_points_cycle / (double)ckt->CKTpsspoints),
pss_points_cycle, ckt->CKTpsspoints) ;
fprintf (stderr, "Next breakpoint set in: %1.15g\n",
time_temp + 1 / ckt->CKTguessedFreq * ((double)(pss_points_cycle) / (double)ckt->CKTpsspoints)) ;
time_temp + 1 / ckt->CKTguessedFreq * ((double)pss_points_cycle / (double)ckt->CKTpsspoints)) ;
#endif
} else {

28
src/spicelib/devices/cktinit.c

@ -31,8 +31,8 @@ CKTinit(CKTcircuit **ckt) /* new circuit to create */
/* gtri - begin - dynamically allocate the array of model lists */
/* CKThead used to be statically sized in CKTdefs.h, but has been changed */
/* to a ** pointer */
(sckt)->CKThead = TMALLOC(GENmodel *, DEVmaxnum);
if((sckt)->CKThead == NULL) return(E_NOMEM);
sckt->CKThead = TMALLOC(GENmodel *, DEVmaxnum);
if(sckt->CKThead == NULL) return(E_NOMEM);
/* gtri - end - dynamically allocate the array of model lists */
@ -97,26 +97,26 @@ CKTinit(CKTcircuit **ckt) /* new circuit to create */
/* gtri - begin - wbk - allocate/initialize substructs */
/* Allocate evt data structure */
(sckt)->evt = TMALLOC(Evt_Ckt_Data_t, 1);
if(! (sckt)->evt)
sckt->evt = TMALLOC(Evt_Ckt_Data_t, 1);
if(! sckt->evt)
return(E_NOMEM);
/* Initialize options data */
(sckt)->evt->options.op_alternate = MIF_TRUE;
sckt->evt->options.op_alternate = MIF_TRUE;
/* Allocate enh data structure */
(sckt)->enh = TMALLOC(Enh_Ckt_Data_t, 1);
if(! (sckt)->enh)
sckt->enh = TMALLOC(Enh_Ckt_Data_t, 1);
if(! sckt->enh)
return(E_NOMEM);
/* Initialize non-zero, non-NULL data */
(sckt)->enh->breakpoint.current = 1.0e30;
(sckt)->enh->breakpoint.last = 1.0e30;
(sckt)->enh->ramp.ramptime = 0.0;
(sckt)->enh->conv_limit.enabled = MIF_TRUE;
(sckt)->enh->conv_limit.step = 0.25;
(sckt)->enh->conv_limit.abs_step = 0.1;
(sckt)->enh->rshunt_data.enabled = MIF_FALSE;
sckt->enh->breakpoint.current = 1.0e30;
sckt->enh->breakpoint.last = 1.0e30;
sckt->enh->ramp.ramptime = 0.0;
sckt->enh->conv_limit.enabled = MIF_TRUE;
sckt->enh->conv_limit.step = 0.25;
sckt->enh->conv_limit.abs_step = 0.1;
sckt->enh->rshunt_data.enabled = MIF_FALSE;
/* gtri - end - wbk - allocate/initialize substructs */

6
src/spicelib/parser/inpgmod.c

@ -441,9 +441,9 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess
err = INPerrCat(err, tmp);
} else {
value = INPgetValue( ckt, &line,
((info->cardParms)[idx]).dataType, tab );
info->cardParms[idx].dataType, tab );
if (invert) { /* invert if it's a boolean entry */
if (((((info->cardParms)[idx]).dataType)&IF_VARTYPES)
if ((info->cardParms[idx].dataType & IF_VARTYPES)
== IF_FLAG) {
value->iValue = 0;
} else {
@ -455,7 +455,7 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess
}
}
error = info->setCardParm (
((info->cardParms)[idx]).id, value, tmpCard );
info->cardParms[idx].id, value, tmpCard );
if (error) return(error);
}
FREE(parm);

Loading…
Cancel
Save