From 6050e2e0ead54e4b1fe955f1b7efbb4fbd643c98 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 24 Jul 2013 20:58:34 +0200 Subject: [PATCH] cleanup some extra parentheses --- src/frontend/com_measure2.c | 6 +++--- src/frontend/com_sysinfo.c | 2 +- src/frontend/spiceif.c | 2 +- src/maths/ni/niiter.c | 6 +++--- src/sharedspice.c | 2 +- src/spicelib/analysis/dcpss.c | 10 +++++----- src/spicelib/devices/cktinit.c | 28 ++++++++++++++-------------- src/spicelib/parser/inpgmod.c | 6 +++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/frontend/com_measure2.c b/src/frontend/com_measure2.c index c22481a22..d8c01ea6c 100644 --- a/src/frontend/com_measure2.c +++ b/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 */ diff --git a/src/frontend/com_sysinfo.c b/src/frontend/com_sysinfo.c index 5a72a150f..3c6f0ca15 100644 --- a/src/frontend/com_sysinfo.c +++ b/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); diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 365e9ffb1..5a73c5250 100644 --- a/src/frontend/spiceif.c +++ b/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) diff --git a/src/maths/ni/niiter.c b/src/maths/ni/niiter.c index 4d6c83e08..bd79591d6 100644 --- a/src/maths/ni/niiter.c +++ b/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; iCKTnumStates; i++) { diff --git a/src/sharedspice.c b/src/sharedspice.c index e4db4a107..c2d251ec8 100644 --- a/src/sharedspice.c +++ b/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); diff --git a/src/spicelib/analysis/dcpss.c b/src/spicelib/analysis/dcpss.c index 2afb2374f..190522a6c 100644 --- a/src/spicelib/analysis/dcpss.c +++ b/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 { diff --git a/src/spicelib/devices/cktinit.c b/src/spicelib/devices/cktinit.c index b415f4fb5..4d1f090fa 100644 --- a/src/spicelib/devices/cktinit.c +++ b/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 */ diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 3040e6767..97df9cb84 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/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);