diff --git a/ChangeLog b/ChangeLog index ee84a7b99..77175c77f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-08-10 Robert Larice + * src/frontend/spiceif.c , + * src/spicelib/analysis/cktmask.c , + * src/spicelib/analysis/cktmcrt.c , + * src/spicelib/analysis/cluster.c , + * src/spicelib/analysis/dctrcurv.c , + * src/spicelib/devices/cktcrte.c , + * src/spicelib/devices/cktfinddev.c : + drop (GENmodel*) casts, which are no longer necessary + 2010-08-09 Robert Larice * src/frontend/display.c , * src/frontend/parser/input.c , diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 65019f9fd..05764dbe8 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -843,7 +843,7 @@ if_setparam_model(CKTcircuit *ckt, char **name, char *val ) fprintf(cp_err, "Error: no such model %s.\n", val); return; } - newMod = (GENmodel*)(inpmod->INPmodfast); + newMod = inpmod->INPmodfast; /* see if new model name same as current model name */ if ( newMod->GENmodName == curMod->GENmodName ) { diff --git a/src/spicelib/analysis/cktmask.c b/src/spicelib/analysis/cktmask.c index 2b841d86a..c5df20330 100644 --- a/src/spicelib/analysis/cktmask.c +++ b/src/spicelib/analysis/cktmask.c @@ -18,10 +18,10 @@ Author: 1985 Thomas L. Quarles int CKTmodAsk(CKTcircuit *ckt, GENmodel *modfast, int which, IFvalue *value, IFvalue *selector) { - int type = ((GENmodel *)modfast)->GENmodType; + int type = modfast->GENmodType; if((*DEVices[type]).DEVmodAsk) { return( (*((*DEVices[type]).DEVmodAsk)) (ckt, - (GENmodel *)modfast,which,value) ); + modfast, which, value) ); } return(E_BADPARM); } diff --git a/src/spicelib/analysis/cktmcrt.c b/src/spicelib/analysis/cktmcrt.c index e938588cb..f569b3bde 100644 --- a/src/spicelib/analysis/cktmcrt.c +++ b/src/spicelib/analysis/cktmcrt.c @@ -29,8 +29,8 @@ CKTmodCrt(CKTcircuit *ckt, int type, GENmodel **modfast, IFuid name) if(mymodfast == (GENmodel *)NULL) return(E_NOMEM); mymodfast->GENmodType = type; mymodfast->GENmodName = name; - mymodfast->GENnextModel =(GENmodel *)(ckt->CKThead[type]); - ckt->CKThead[type]=(GENmodel *)mymodfast; + mymodfast->GENnextModel = ckt->CKThead[type]; + ckt->CKThead[type] = mymodfast; if(modfast) *modfast=mymodfast; return(OK); } else if (error==0) { diff --git a/src/spicelib/analysis/cluster.c b/src/spicelib/analysis/cluster.c index d2c090a93..4d8f8bfb8 100755 --- a/src/spicelib/analysis/cluster.c +++ b/src/spicelib/analysis/cluster.c @@ -77,7 +77,7 @@ int CLUsetup(CKTcircuit *ckt){ /* count the number of connections expected */ i = INPtypelook("Isource"); - for(mod = (GENmodel *)ckt->CKThead[i]; + for(mod = ckt->CKThead[i]; mod != NULL; mod = mod->GENnextModel) for (inst = mod->GENinstances; @@ -115,7 +115,7 @@ static int setup_output(CKTcircuit *ckt){ lastTimeSent = 0; type = INPtypelook("Isource"); - for(mod = (GENmodel *)ckt->CKThead[type]; + for(mod = ckt->CKThead[type]; mod != NULL; mod = mod->GENnextModel) @@ -238,7 +238,7 @@ static int setup_input(CKTcircuit *ckt){ input->time = -1; /*Find the Isource to control*/ - for(mod = (GENmodel *)ckt->CKThead[type]; + for(mod = ckt->CKThead[type]; mod != NULL; mod = mod->GENnextModel) diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index cb9cfbd6d..91b7f591c 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -305,10 +305,10 @@ resume: 1/(((RESinstance *)(cv->TRCVvElt[i]))->RESresist); /* Note: changing the resistance does nothing */ /* changing the conductance 1/r instead */ - DEVices[rcode]->DEVload((GENmodel*)(cv->TRCVvElt[i]->GENmodPtr),ckt); + DEVices[rcode]->DEVload(cv->TRCVvElt[i]->GENmodPtr, ckt); /* - * RESload((GENmodel*)(cv->TRCVvElt[i]->GENmodPtr),ckt); + * RESload(cv->TRCVvElt[i]->GENmodPtr, ckt); */ @@ -496,9 +496,9 @@ nextstep:; /* This code should update resistance and conductance */ ((RESinstance*)(cv->TRCVvElt[i]))->RESconduct = 1/(((RESinstance*)(cv->TRCVvElt[i]))->RESresist); - DEVices[rcode]->DEVload((GENmodel*)(cv->TRCVvElt[i]->GENmodPtr),ckt); + DEVices[rcode]->DEVload(cv->TRCVvElt[i]->GENmodPtr, ckt); /* - * RESload((GENmodel*)(cv->TRCVvElt[i]->GENmodPtr),ckt); + * RESload(cv->TRCVvElt[i]->GENmodPtr, ckt); */ } /* PN Temp Sweep - serban */ @@ -540,10 +540,10 @@ nextstep:; 1/(((RESinstance*)(cv->TRCVvElt[i]))->RESresist); ((RESinstance*)(cv->TRCVvElt[i]))->RESresGiven = cv->TRCVgSave[i]; - DEVices[rcode]->DEVload((GENmodel*)(cv->TRCVvElt[i]->GENmodPtr),ckt); + DEVices[rcode]->DEVload(cv->TRCVvElt[i]->GENmodPtr, ckt); /* - * RESload((GENmodel*)(cv->TRCVvElt[i]->GENmodPtr),ckt); + * RESload(cv->TRCVvElt[i]->GENmodPtr, ckt); */ } else if(cv->TRCVvType[i] == TEMP_CODE) { diff --git a/src/spicelib/devices/cktcrte.c b/src/spicelib/devices/cktcrte.c index be72721d5..f67f5896c 100644 --- a/src/spicelib/devices/cktcrte.c +++ b/src/spicelib/devices/cktcrte.c @@ -19,7 +19,7 @@ int CKTcrtElt(CKTcircuit *ckt, GENmodel *inModPtr, GENinstance **inInstPtr, IFuid name) { GENinstance *instPtr = NULL; /* instPtr points to the data struct for per-instance data */ - GENmodel *modPtr = (GENmodel*)inModPtr; /* modPtr points to the data struct for per-model data */ + GENmodel *modPtr = /*fixme*/ inModPtr; /* modPtr points to the data struct for per-model data */ SPICEdev **DEVices; int error; @@ -27,10 +27,10 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *inModPtr, GENinstance **inInstPtr, IFuid na DEVices = devices(); - if( (GENmodel *)modPtr == (GENmodel*)NULL ) + if(!modPtr) return E_NOMOD; - type = ((GENmodel*)modPtr)->GENmodType; + type = modPtr->GENmodType; error = CKTfndDev(ckt, &type, &instPtr, name, inModPtr, (char *)NULL ); diff --git a/src/spicelib/devices/cktfinddev.c b/src/spicelib/devices/cktfinddev.c index 03bc9366f..236470727 100644 --- a/src/spicelib/devices/cktfinddev.c +++ b/src/spicelib/devices/cktfinddev.c @@ -46,7 +46,7 @@ CKTfndDev(CKTcircuit *Ckt, int *type, GENinstance **fast, IFuid name, GENmodel * if (*type >= 0 && *type < DEVmaxnum) { /* have device type, need to find model & device */ /* look through all models */ - for (mods = (GENmodel *)ckt->CKThead[*type]; + for (mods = ckt->CKThead[*type]; mods != NULL ; mods = mods->GENnextModel) { @@ -73,7 +73,7 @@ CKTfndDev(CKTcircuit *Ckt, int *type, GENinstance **fast, IFuid name, GENmodel * for(*type = 0; *type < DEVmaxnum; (*type)++) { /* need to find model & device */ /* look through all models */ - for(mods=(GENmodel *)ckt->CKThead[*type];mods!=NULL; + for(mods = ckt->CKThead[*type]; mods != NULL; mods = mods->GENnextModel) { /* and all instances */