From a7ac45c9cbc224a1853ea2a2d994cc132e81d3f4 Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 13 Dec 2011 18:04:28 +0000 Subject: [PATCH] rename various analysis vars --> `job' --- ChangeLog | 14 ++++++++ src/spicelib/analysis/cktdisto.c | 3 +- src/spicelib/analysis/cktpzld.c | 3 +- src/spicelib/analysis/cktpzset.c | 31 ++++++++-------- src/spicelib/analysis/cktsens.c | 3 +- src/spicelib/analysis/dctrcurv.c | 3 +- src/spicelib/analysis/dctsetp.c | 62 ++++++++++++++++---------------- src/spicelib/analysis/distoan.c | 2 +- src/spicelib/analysis/noisean.c | 2 +- src/spicelib/analysis/pzan.c | 61 +++++++++++++++---------------- src/spicelib/analysis/sensaskq.c | 14 ++++---- src/spicelib/analysis/senssetp.c | 38 ++++++++++---------- 12 files changed, 128 insertions(+), 108 deletions(-) diff --git a/ChangeLog b/ChangeLog index 366ac0947..db2c12654 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2011-12-13 Robert Larice + * src/spicelib/analysis/cktdisto.c , + * src/spicelib/analysis/cktpzld.c , + * src/spicelib/analysis/cktpzset.c , + * src/spicelib/analysis/cktsens.c , + * src/spicelib/analysis/dctrcurv.c , + * src/spicelib/analysis/dctsetp.c , + * src/spicelib/analysis/distoan.c , + * src/spicelib/analysis/noisean.c , + * src/spicelib/analysis/pzan.c , + * src/spicelib/analysis/sensaskq.c , + * src/spicelib/analysis/senssetp.c : + rename various analysis vars --> `job' + 2011-12-13 Robert Larice * src/spicelib/analysis/acaskq.c , * src/spicelib/analysis/acsetp.c , diff --git a/src/spicelib/analysis/cktdisto.c b/src/spicelib/analysis/cktdisto.c index e25b26fc6..9a54cab83 100644 --- a/src/spicelib/analysis/cktdisto.c +++ b/src/spicelib/analysis/cktdisto.c @@ -21,7 +21,8 @@ Author: 1988 Jaijeet S Roychowdhury int CKTdisto (CKTcircuit *ckt, int mode) { - DISTOAN* job = (DISTOAN*) (ckt->CKTcurJob); + DISTOAN *job = (DISTOAN *) ckt->CKTcurJob; + int i; int error=0; int size; diff --git a/src/spicelib/analysis/cktpzld.c b/src/spicelib/analysis/cktpzld.c index bdef28b65..8c5725cac 100644 --- a/src/spicelib/analysis/cktpzld.c +++ b/src/spicelib/analysis/cktpzld.c @@ -14,7 +14,8 @@ Copyright 1990 Regents of the University of California. All rights reserved. int CKTpzLoad(CKTcircuit *ckt, SPcomplex *s) { - PZAN *job = (PZAN *) (ckt->CKTcurJob); + PZAN *job = (PZAN *) ckt->CKTcurJob; + int error; int i; #ifdef PARALLEL_ARCH diff --git a/src/spicelib/analysis/cktpzset.c b/src/spicelib/analysis/cktpzset.c index b92abcc58..4c637595f 100644 --- a/src/spicelib/analysis/cktpzset.c +++ b/src/spicelib/analysis/cktpzset.c @@ -18,7 +18,8 @@ Copyright 1990 Regents of the University of California. All rights reserved. int CKTpzSetup(CKTcircuit *ckt, int type) { - PZAN *pzan = (PZAN *) ckt->CKTcurJob; + PZAN *job = (PZAN *) ckt->CKTcurJob; + SMPmatrix *matrix; int error; int i, temp, solution_col, balance_col; @@ -45,17 +46,17 @@ CKTpzSetup(CKTcircuit *ckt, int type) solution_col = 0; balance_col = 0; - input_pos = pzan->PZin_pos; - input_neg = pzan->PZin_neg; + input_pos = job->PZin_pos; + input_neg = job->PZin_neg; if (type == PZ_DO_ZEROS) { /* Vo/Ii in Y */ - output_pos = pzan->PZout_pos; - output_neg = pzan->PZout_neg; - } else if (pzan->PZinput_type == PZ_IN_VOL) { + output_pos = job->PZout_pos; + output_neg = job->PZout_neg; + } else if (job->PZinput_type == PZ_IN_VOL) { /* Vi/Ii in Y */ - output_pos = pzan->PZin_pos; - output_neg = pzan->PZin_neg; + output_pos = job->PZin_pos; + output_neg = job->PZin_neg; } else { /* Denominator */ output_pos = 0; @@ -76,19 +77,19 @@ CKTpzSetup(CKTcircuit *ckt, int type) } if (input_pos) - pzan->PZdrive_pptr = SMPmakeElt(matrix, input_pos, solution_col); + job->PZdrive_pptr = SMPmakeElt(matrix, input_pos, solution_col); else - pzan->PZdrive_pptr = NULL; + job->PZdrive_pptr = NULL; if (input_neg) - pzan->PZdrive_nptr = SMPmakeElt(matrix, input_neg, solution_col); + job->PZdrive_nptr = SMPmakeElt(matrix, input_neg, solution_col); else - pzan->PZdrive_nptr = NULL; + job->PZdrive_nptr = NULL; - pzan->PZsolution_col = solution_col; - pzan->PZbalance_col = balance_col; + job->PZsolution_col = solution_col; + job->PZbalance_col = balance_col; - pzan->PZnumswaps = 1; + job->PZnumswaps = 1; error = NIreinit(ckt); if (error) diff --git a/src/spicelib/analysis/cktsens.c b/src/spicelib/analysis/cktsens.c index 75ce40690..c5e3d5e1b 100644 --- a/src/spicelib/analysis/cktsens.c +++ b/src/spicelib/analysis/cktsens.c @@ -61,7 +61,8 @@ static double inc_freq(double freq, int type, double step_size); static int error; int sens_sens(CKTcircuit *ckt, int restart) { - SENS_AN *job = ((SENS_AN *) ckt->CKTcurJob); + SENS_AN *job = (SENS_AN *) ckt->CKTcurJob; + static int size; static double *delta_I, *delta_iI, *delta_I_delta_Y, *delta_iI_delta_Y; diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index fb3bb3ef7..7691d2b19 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -34,7 +34,8 @@ DCtrCurv(CKTcircuit *ckt, int restart) /* forced restart flag */ { - TRCV* job = (TRCV*)ckt->CKTcurJob; /* Where we get the job to do */ + TRCV *job = (TRCV *) ckt->CKTcurJob; + int i; double *temp; int converged; diff --git a/src/spicelib/analysis/dctsetp.c b/src/spicelib/analysis/dctsetp.c index 0e7eef138..a122ba9cf 100644 --- a/src/spicelib/analysis/dctsetp.c +++ b/src/spicelib/analysis/dctsetp.c @@ -15,70 +15,70 @@ Author: 1985 Thomas L. Quarles int DCTsetParm(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) { - TRCV* cv= (TRCV*)anal; + TRCV *job = (TRCV *) anal; NG_IGNORE(ckt); switch(which) { case DCT_START1: - cv->TRCVvStart[0] = value->rValue; - cv->TRCVnestLevel = MAX(0,cv->TRCVnestLevel); - cv->TRCVset[0]=TRUE; + job->TRCVvStart[0] = value->rValue; + job->TRCVnestLevel = MAX(0, job->TRCVnestLevel); + job->TRCVset[0] = TRUE; break; case DCT_STOP1: - cv->TRCVvStop[0] = value->rValue; - cv->TRCVnestLevel = MAX(0,cv->TRCVnestLevel); - cv->TRCVset[0]=TRUE; + job->TRCVvStop[0] = value->rValue; + job->TRCVnestLevel = MAX(0, job->TRCVnestLevel); + job->TRCVset[0] = TRUE; break; case DCT_STEP1: - cv->TRCVvStep[0] = value->rValue; - cv->TRCVnestLevel = MAX(0,cv->TRCVnestLevel); - cv->TRCVset[0]=TRUE; + job->TRCVvStep[0] = value->rValue; + job->TRCVnestLevel = MAX(0, job->TRCVnestLevel); + job->TRCVset[0] = TRUE; break; case DCT_START2: - cv->TRCVvStart[1] = value->rValue; - cv->TRCVnestLevel = MAX(1,cv->TRCVnestLevel); - cv->TRCVset[1]=TRUE; + job->TRCVvStart[1] = value->rValue; + job->TRCVnestLevel = MAX(1, job->TRCVnestLevel); + job->TRCVset[1] = TRUE; break; case DCT_STOP2: - cv->TRCVvStop[1] = value->rValue; - cv->TRCVnestLevel = MAX(1,cv->TRCVnestLevel); - cv->TRCVset[1]=TRUE; + job->TRCVvStop[1] = value->rValue; + job->TRCVnestLevel = MAX(1, job->TRCVnestLevel); + job->TRCVset[1] = TRUE; break; case DCT_STEP2: - cv->TRCVvStep[1] = value->rValue; - cv->TRCVnestLevel = MAX(1,cv->TRCVnestLevel); - cv->TRCVset[1]=TRUE; + job->TRCVvStep[1] = value->rValue; + job->TRCVnestLevel = MAX(1, job->TRCVnestLevel); + job->TRCVset[1] = TRUE; break; case DCT_NAME1: - cv->TRCVvName[0] = value->uValue; - cv->TRCVnestLevel = MAX(0,cv->TRCVnestLevel); - cv->TRCVset[0]=TRUE; + job->TRCVvName[0] = value->uValue; + job->TRCVnestLevel = MAX(0, job->TRCVnestLevel); + job->TRCVset[0] = TRUE; break; case DCT_NAME2: - cv->TRCVvName[1] = value->uValue; - cv->TRCVnestLevel = MAX(1,cv->TRCVnestLevel); - cv->TRCVset[1]=TRUE; + job->TRCVvName[1] = value->uValue; + job->TRCVnestLevel = MAX(1, job->TRCVnestLevel); + job->TRCVset[1] = TRUE; break; case DCT_TYPE1: - cv->TRCVvType[0] = value->iValue; - cv->TRCVnestLevel = MAX(0,cv->TRCVnestLevel); - cv->TRCVset[0]=TRUE; + job->TRCVvType[0] = value->iValue; + job->TRCVnestLevel = MAX(0, job->TRCVnestLevel); + job->TRCVset[0] = TRUE; break; case DCT_TYPE2: - cv->TRCVvType[1] = value->iValue; - cv->TRCVnestLevel = MAX(1,cv->TRCVnestLevel); - cv->TRCVset[1]=TRUE; + job->TRCVvType[1] = value->iValue; + job->TRCVnestLevel = MAX(1, job->TRCVnestLevel); + job->TRCVset[1] = TRUE; break; default: diff --git a/src/spicelib/analysis/distoan.c b/src/spicelib/analysis/distoan.c index d89d2880e..cf463ca35 100644 --- a/src/spicelib/analysis/distoan.c +++ b/src/spicelib/analysis/distoan.c @@ -50,7 +50,7 @@ DISTOan(CKTcircuit *ckt, int restart) IFuid *nameList; IFuid freqUid; void *acPlot=NULL; - DISTOAN* job = (DISTOAN *) (ckt->CKTcurJob); + DISTOAN *job = (DISTOAN *) ckt->CKTcurJob; static char *nof2src = "No source with f2 distortion input"; #ifdef DISTODEBUG double time,time1; diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index 6bb430ebb..edcd1bd91 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -38,7 +38,7 @@ NOISEan (CKTcircuit *ckt, int restart) GENinstance *inst; double freqTol; /* tolerence parameter for finding final frequency; hack */ - NOISEAN *job = (NOISEAN*) (ckt->CKTcurJob); + NOISEAN *job = (NOISEAN *) ckt->CKTcurJob; static char *noacinput = "noise input source has no AC value"; posOutNode = (job->output) -> number; diff --git a/src/spicelib/analysis/pzan.c b/src/spicelib/analysis/pzan.c index 6331fb0fe..a6cc6ab94 100644 --- a/src/spicelib/analysis/pzan.c +++ b/src/spicelib/analysis/pzan.c @@ -17,7 +17,8 @@ Copyright 1990 Regents of the University of California. All rights reserved. int PZan(CKTcircuit *ckt, int reset) { - PZAN *pzan = (PZAN *) ckt->CKTcurJob; + PZAN *job = (PZAN *) ckt->CKTcurJob; + int error; int numNames; IFuid *nameList; @@ -53,20 +54,20 @@ PZan(CKTcircuit *ckt, int reset) SPfrontEnd->OUTendPlot (plot); } - if (pzan->PZwhich & PZ_DO_POLES) { + if (job->PZwhich & PZ_DO_POLES) { error = CKTpzSetup(ckt, PZ_DO_POLES); if (error != OK) return error; - error = CKTpzFindZeros(ckt, &pzan->PZpoleList, &pzan->PZnPoles); + error = CKTpzFindZeros(ckt, &job->PZpoleList, &job->PZnPoles); if (error != OK) return(error); } - if (pzan->PZwhich & PZ_DO_ZEROS) { + if (job->PZwhich & PZ_DO_ZEROS) { error = CKTpzSetup(ckt, PZ_DO_ZEROS); if (error != OK) return error; - error = CKTpzFindZeros(ckt, &pzan->PZzeroList, &pzan->PZnZeros); + error = CKTpzFindZeros(ckt, &job->PZzeroList, &job->PZnZeros); if (error != OK) return(error); } @@ -81,7 +82,7 @@ PZan(CKTcircuit *ckt, int reset) int PZinit(CKTcircuit *ckt) { - PZAN *pzan = (PZAN *) ckt->CKTcurJob; + PZAN *job = (PZAN *) ckt->CKTcurJob; int i; i = CKTtypelook("transmission line"); @@ -93,24 +94,24 @@ PZinit(CKTcircuit *ckt) if (i != -1 && ckt->CKThead[i] != NULL) MERROR(E_XMISSIONLINE, "Transmission lines not supported") - pzan->PZpoleList = NULL; - pzan->PZzeroList = NULL; - pzan->PZnPoles = 0; - pzan->PZnZeros = 0; + job->PZpoleList = NULL; + job->PZzeroList = NULL; + job->PZnPoles = 0; + job->PZnZeros = 0; - if (pzan->PZin_pos == pzan->PZin_neg) + if (job->PZin_pos == job->PZin_neg) MERROR(E_SHORT, "Input is shorted") - if (pzan->PZout_pos == pzan->PZout_neg) + if (job->PZout_pos == job->PZout_neg) MERROR(E_SHORT, "Output is shorted") - if (pzan->PZin_pos == pzan->PZout_pos - && pzan->PZin_neg == pzan->PZout_neg - && pzan->PZinput_type == PZ_IN_VOL) + if (job->PZin_pos == job->PZout_pos + && job->PZin_neg == job->PZout_neg + && job->PZinput_type == PZ_IN_VOL) MERROR(E_INISOUT, "Transfer function is unity") - else if (pzan->PZin_pos == pzan->PZout_neg - && pzan->PZin_neg == pzan->PZout_pos - && pzan->PZinput_type == PZ_IN_VOL) + else if (job->PZin_pos == job->PZout_neg + && job->PZin_neg == job->PZout_pos + && job->PZinput_type == PZ_IN_VOL) MERROR(E_INISOUT, "Transfer function is -1") return(OK); @@ -123,7 +124,7 @@ PZinit(CKTcircuit *ckt) int PZpost(CKTcircuit *ckt) { - PZAN *pzan = (PZAN *) ckt->CKTcurJob; + PZAN *job = (PZAN *) ckt->CKTcurJob; void *pzPlotPtr = NULL; /* the plot pointer for front end */ IFcomplex *out_list; IFvalue outData; /* output variable (points to out_list) */ @@ -132,28 +133,28 @@ PZpost(CKTcircuit *ckt) char name[50]; int i, j; - namelist = TMALLOC(IFuid, pzan->PZnPoles + pzan->PZnZeros); - out_list = TMALLOC(IFcomplex, pzan->PZnPoles + pzan->PZnZeros); + namelist = TMALLOC(IFuid, job->PZnPoles + job->PZnZeros); + out_list = TMALLOC(IFcomplex, job->PZnPoles + job->PZnZeros); j = 0; - for (i = 0; i < pzan->PZnPoles; i++) { + for (i = 0; i < job->PZnPoles; i++) { sprintf(name, "pole(%-u)", i+1); SPfrontEnd->IFnewUid (ckt, &(namelist[j++]), NULL, name, UID_OTHER, NULL); } - for (i = 0; i < pzan->PZnZeros; i++) { + for (i = 0; i < job->PZnZeros; i++) { sprintf(name, "zero(%-u)", i+1); SPfrontEnd->IFnewUid (ckt, &(namelist[j++]), NULL, name, UID_OTHER, NULL); } - SPfrontEnd->OUTpBeginPlot (ckt, (JOB *)pzan, pzan->JOBname, - NULL, 0, pzan->PZnPoles + pzan->PZnZeros, namelist, + SPfrontEnd->OUTpBeginPlot (ckt, (JOB *)job, job->JOBname, + NULL, 0, job->PZnPoles + job->PZnZeros, namelist, IF_COMPLEX, &pzPlotPtr); j = 0; - if (pzan->PZnPoles > 0) { - for (root = pzan->PZpoleList; root != NULL; root = root->next) { + if (job->PZnPoles > 0) { + for (root = job->PZpoleList; root != NULL; root = root->next) { for (i = 0; i < root->multiplicity; i++) { out_list[j].real = root->s.real; out_list[j].imag = root->s.imag; @@ -169,8 +170,8 @@ PZpost(CKTcircuit *ckt) } } - if (pzan->PZnZeros > 0) { - for (root = pzan->PZzeroList; root != NULL; root = root->next) { + if (job->PZnZeros > 0) { + for (root = job->PZzeroList; root != NULL; root = root->next) { for (i = 0; i < root->multiplicity; i++) { out_list[j].real = root->s.real; out_list[j].imag = root->s.imag; @@ -186,7 +187,7 @@ PZpost(CKTcircuit *ckt) } } - outData.v.numValue = pzan->PZnPoles + pzan->PZnZeros; + outData.v.numValue = job->PZnPoles + job->PZnZeros; outData.v.vec.cVec = out_list; SPfrontEnd->OUTpData (pzPlotPtr, NULL, &outData); diff --git a/src/spicelib/analysis/sensaskq.c b/src/spicelib/analysis/sensaskq.c index 805de0d9f..303421dcd 100644 --- a/src/spicelib/analysis/sensaskq.c +++ b/src/spicelib/analysis/sensaskq.c @@ -13,37 +13,37 @@ Copyright 1991 Regents of the University of California. All rights reserved. int SENSask(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) { - SENS_AN *sinfo = (SENS_AN *) anal; + SENS_AN *job = (SENS_AN *) anal; NG_IGNORE(ckt); switch (which) { case SENS_START: - value->rValue = sinfo->start_freq; + value->rValue = job->start_freq; break; case SENS_STOP: - value->rValue = sinfo->stop_freq; + value->rValue = job->stop_freq; break; case SENS_STEPS: - value->iValue = sinfo->n_freq_steps; + value->iValue = job->n_freq_steps; break; case SENS_DEC: case SENS_OCT: case SENS_LIN: case SENS_DC: - value->iValue = sinfo->step_type == which; + value->iValue = job->step_type == which; break; case SENS_DEFTOL: - sinfo->deftol = value->rValue; + job->deftol = value->rValue; break; case SENS_DEFPERTURB: - value->rValue = sinfo->defperturb; + value->rValue = job->defperturb; break; default: diff --git a/src/spicelib/analysis/senssetp.c b/src/spicelib/analysis/senssetp.c index 44d96a652..835be0c8b 100644 --- a/src/spicelib/analysis/senssetp.c +++ b/src/spicelib/analysis/senssetp.c @@ -14,67 +14,67 @@ Copyright 1991 Regents of the University of California. All rights reserved. int SENSsetParam(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) { - SENS_AN *sinfo = (SENS_AN *) anal; + SENS_AN *job = (SENS_AN *) anal; NG_IGNORE(ckt); switch(which) { case SENS_POS: - sinfo->output_pos = value->nValue; - sinfo->output_neg = NULL; - sinfo->output_volt = 1; - sinfo->step_type = SENS_DC; + job->output_pos = value->nValue; + job->output_neg = NULL; + job->output_volt = 1; + job->step_type = SENS_DC; break; case SENS_NEG: - sinfo->output_neg = value->nValue; + job->output_neg = value->nValue; break; case SENS_SRC: - sinfo->output_src = value->uValue; - sinfo->output_volt = 0; - sinfo->step_type = SENS_DC; + job->output_src = value->uValue; + job->output_volt = 0; + job->step_type = SENS_DC; break; case SENS_NAME: - sinfo->output_name = value->sValue; + job->output_name = value->sValue; break; case SENS_START: - sinfo->start_freq = value->rValue; + job->start_freq = value->rValue; break; case SENS_STOP: - sinfo->stop_freq = value->rValue; + job->stop_freq = value->rValue; break; case SENS_STEPS: - sinfo->n_freq_steps = value->iValue; + job->n_freq_steps = value->iValue; break; case SENS_DEC: - sinfo->step_type = SENS_DECADE; + job->step_type = SENS_DECADE; break; case SENS_OCT: - sinfo->step_type = SENS_OCTAVE; + job->step_type = SENS_OCTAVE; break; case SENS_LIN: - sinfo->step_type = SENS_LINEAR; + job->step_type = SENS_LINEAR; break; case SENS_DC: - sinfo->step_type = SENS_DC; + job->step_type = SENS_DC; break; case SENS_DEFTOL: - sinfo->deftol = value->rValue; + job->deftol = value->rValue; break; case SENS_DEFPERTURB: - sinfo->defperturb = value->rValue; + job->defperturb = value->rValue; break; default: