From d5f6bcbedf58e567dded243426566ebc848ae3c6 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 6 Feb 2012 20:11:10 +0000 Subject: [PATCH] drop some more casts --- ChangeLog | 13 +++++++++++++ src/frontend/outitf.c | 8 ++++---- src/frontend/plotting/graf.c | 6 +++--- src/frontend/spiceif.c | 2 +- src/frontend/subckt.c | 2 +- src/spicelib/analysis/cktnames.c | 2 +- src/spicelib/devices/hisim2/hsm2noi.c | 6 +++--- src/spicelib/devices/hisimhv/hsmhvnoi.c | 6 +++--- src/spicelib/parser/ifnewuid.c | 12 ++++++------ src/spicelib/parser/inpptree.c | 2 +- src/xspice/mif/mifsetup.c | 2 +- 11 files changed, 37 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 986f8e51b..a445fb133 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2012-02-06 Robert Larice + * src/frontend/outitf.c , + * src/frontend/spiceif.c , + * src/frontend/subckt.c , + * src/frontend/plotting/graf.c , + * src/spicelib/analysis/cktnames.c , + * src/spicelib/devices/hisim2/hsm2noi.c , + * src/spicelib/devices/hisimhv/hsmhvnoi.c , + * src/spicelib/parser/ifnewuid.c , + * src/spicelib/parser/inpptree.c , + * src/xspice/mif/mifsetup.c : + drop some more casts + 2012-02-06 Robert Larice * src/spicelib/analysis/analysis.c , * src/spicelib/devices/urc/urcsetup.c : diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 8407362f1..7f78d5127 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -105,8 +105,8 @@ if (ARCHme != 0) return(OK); name = "circuit name"; return (beginPlot(analysisPtr, circuitPtr, name, - (char *) analName, (char *) refName, refType, numNames, - (char **) dataNames, dataType, FALSE, + analName, refName, refType, numNames, + dataNames, dataType, FALSE, (runDesc **) plotPtr)); } @@ -121,8 +121,8 @@ OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, #endif /* PARALLEL_ARCH */ return (beginPlot(analysisPtr, circuitPtr, "circuit name", - (char *) analName, (char *) refName, refType, numNames, - (char **) dataNames, dataType, TRUE, + analName, refName, refType, numNames, + dataNames, dataType, TRUE, (runDesc **) plotPtr)); } diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index f3b2975a2..441cc82a6 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -114,9 +114,9 @@ gr_init(double *xlims, double *ylims, /* The size of the screen. */ } if (cp_getvar("ticlist", CP_LIST, ticlist)) { - wl = (wordlist *)vareval("ticlist"); - ticlist = (char *)wl_flatten(wl); - graph->ticdata = (double *) readtics(ticlist); + wl = vareval("ticlist"); + ticlist = wl_flatten(wl); + graph->ticdata = readtics(ticlist); } else graph->ticdata = NULL; diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 194ce0a5c..69dc20c5e 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -889,7 +889,7 @@ if_setparam_model(CKTcircuit *ckt, char **name, char *val ) if ( prevMod == NULL ) ckt->CKThead[typecode] = mods->GENnextModel; else prevMod->GENnextModel = mods->GENnextModel; - INPgetMod( ckt, (char *)mods->GENmodName, &inpmod, ft_curckt->ci_symtab ); + INPgetMod( ckt, mods->GENmodName, &inpmod, ft_curckt->ci_symtab ); inpmod->INPmodUsed = 0; FREE(mods); diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 0f6253a5f..b04e730e1 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1071,7 +1071,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, char *sub /* Next we handle the POLY (if any) */ /* get next token */ t = s; - next_name = (char *)gettok_noparens(&t); + next_name = gettok_noparens(&t); if ( (strcmp(next_name, "POLY") == 0) || (strcmp(next_name, "poly") == 0)) { /* found POLY . . . . */ diff --git a/src/spicelib/analysis/cktnames.c b/src/spicelib/analysis/cktnames.c index dd77db25b..9b248587b 100644 --- a/src/spicelib/analysis/cktnames.c +++ b/src/spicelib/analysis/cktnames.c @@ -38,7 +38,7 @@ CKTdnames(CKTcircuit *ckt) i=0; for (here = ckt->CKTnodes->next; here; here = here->next) { - printf("%03d: %s\n", here->number, (char *)here->name); + printf("%03d: %s\n", here->number, here->name); } return(OK); } diff --git a/src/spicelib/devices/hisim2/hsm2noi.c b/src/spicelib/devices/hisim2/hsm2noi.c index ffc6ee14c..22351bd3c 100644 --- a/src/spicelib/devices/hisim2/hsm2noi.c +++ b/src/spicelib/devices/hisim2/hsm2noi.c @@ -81,7 +81,7 @@ int HSM2noise ( case N_DENS: for ( i = 0; i < HSM2NSRCS; i++ ) { (void) sprintf(name, "onoise.%s%s", - (char *)here->HSM2name, HSM2nNames[i]); + here->HSM2name, HSM2nNames[i]); data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) @@ -94,7 +94,7 @@ int HSM2noise ( case INT_NOIZ: for ( i = 0; i < HSM2NSRCS; i++ ) { (void) sprintf(name, "onoise_total.%s%s", - (char *)here->HSM2name, HSM2nNames[i]); + here->HSM2name, HSM2nNames[i]); data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) @@ -104,7 +104,7 @@ int HSM2noise ( NULL, name, UID_OTHER, NULL); (void) sprintf(name, "inoise_total.%s%s", - (char *)here->HSM2name, HSM2nNames[i]); + here->HSM2name, HSM2nNames[i]); data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) diff --git a/src/spicelib/devices/hisimhv/hsmhvnoi.c b/src/spicelib/devices/hisimhv/hsmhvnoi.c index 7ec662d00..e1307fad9 100644 --- a/src/spicelib/devices/hisimhv/hsmhvnoi.c +++ b/src/spicelib/devices/hisimhv/hsmhvnoi.c @@ -81,7 +81,7 @@ int HSMHVnoise ( case N_DENS: for ( i = 0; i < HSMHVNSRCS; i++ ) { (void) sprintf(name, "onoise.%s%s", - (char *)here->HSMHVname, HSMHVnNames[i]); + here->HSMHVname, HSMHVnNames[i]); data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) return(E_NOMEM); @@ -93,7 +93,7 @@ int HSMHVnoise ( case INT_NOIZ: for ( i = 0; i < HSMHVNSRCS; i++ ) { (void) sprintf(name, "onoise_total.%s%s", - (char *)here->HSMHVname, HSMHVnNames[i]); + here->HSMHVname, HSMHVnNames[i]); data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) return(E_NOMEM); @@ -102,7 +102,7 @@ int HSMHVnoise ( (IFuid) NULL, name, UID_OTHER, NULL); (void) sprintf(name, "inoise_total.%s%s", - (char *)here->HSMHVname, HSMHVnNames[i]); + here->HSMHVname, HSMHVnNames[i]); data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) return(E_NOMEM); diff --git a/src/spicelib/parser/ifnewuid.c b/src/spicelib/parser/ifnewuid.c index 02818add2..4b26bb8e7 100644 --- a/src/spicelib/parser/ifnewuid.c +++ b/src/spicelib/parser/ifnewuid.c @@ -37,10 +37,10 @@ IFnewUid(CKTcircuit *ckt, IFuid * newuid, IFuid olduid, char *suffix, int type, if (olduid) { #ifdef HAVE_ASPRINTF - asprintf(&newname, "%s#%s", (char *) olduid, suffix); + asprintf(&newname, "%s#%s", olduid, suffix); #else /* ~ HAVE_ASPRINTF */ - newname = TMALLOC(char, strlen((char *) olduid) + strlen(suffix) + 2); /* 2 = strlen("#\0") */ - sprintf(newname, "%s#%s", (char *) olduid, suffix); + newname = TMALLOC(char, strlen(olduid) + strlen(suffix) + 2); /* 2 = strlen("#\0") */ + sprintf(newname, "%s#%s", olduid, suffix); #endif /* HAVE_ASPRINTF */ } else { @@ -62,15 +62,15 @@ IFnewUid(CKTcircuit *ckt, IFuid * newuid, IFuid olduid, char *suffix, int type, error = INPinsert(&newname, ft_curckt->ci_symtab); if (error && error != E_EXISTS) return (error); - *newuid = (IFuid) newname; + *newuid = newname; break; case UID_SIGNAL: error = INPmkTerm(ckt, &newname, - (INPtables *) ft_curckt->ci_symtab, nodedata); + ft_curckt->ci_symtab, nodedata); if (error && error != E_EXISTS) return (error); - *newuid = (IFuid) newname; + *newuid = newname; break; default: diff --git a/src/spicelib/parser/inpptree.c b/src/spicelib/parser/inpptree.c index 802fa2b16..67757f5ac 100644 --- a/src/spicelib/parser/inpptree.c +++ b/src/spicelib/parser/inpptree.c @@ -928,7 +928,7 @@ static INPparseNode *mkinode(char *name) values = TMALLOC(IFvalue, 1); types = TMALLOC(int, 1); } - values[i].uValue = (IFuid) name; + values[i].uValue = name; types[i] = IF_INSTANCE; numvalues++; } diff --git a/src/xspice/mif/mifsetup.c b/src/xspice/mif/mifsetup.c index b30fca94b..cd9a3b365 100755 --- a/src/xspice/mif/mifsetup.c +++ b/src/xspice/mif/mifsetup.c @@ -353,7 +353,7 @@ MIFsetup( if(smp_data_out->ibranch == 0) { IFuid names[2]; names[0] = here->MIFname; - names[1] = (IFuid) here->conn[i]->port[j]->vsource_str; + names[1] = here->conn[i]->port[j]->vsource_str; SPfrontEnd->IFerror (ERR_FATAL, "%s: unknown controlling source %s",names); return(E_BADPARM);