diff --git a/ChangeLog b/ChangeLog index 100291a09..856c9a428 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,36 @@ 2010-06-23 Holger Vogt * numparam.h: short replaced by int +2010-06-27 Robert Larice + * src/ciderlib/support/database.c, + * src/frontend/com_let.c, + * src/frontend/define.c, + * src/frontend/gens.c, + * src/frontend/plotting/graphdb.c, + * src/frontend/plotting/plotcurv.c, + * src/frontend/plotting/plotit.c, + * src/frontend/postcoms.c, + * src/frontend/vectors.c, + * src/maths/poly/interpolate.c, + * src/spicelib/analysis/dctran.c, + * src/spicelib/analysis/dctrcurv.c, + * src/spicelib/devices/nbjt/nbjtset.c, + * src/spicelib/devices/nbjt/nbjttemp.c, + * src/spicelib/devices/nbjt2/nbt2set.c, + * src/spicelib/devices/nbjt2/nbt2temp.c, + * src/spicelib/devices/numd/numdset.c, + * src/spicelib/devices/numd/numdtemp.c, + * src/spicelib/devices/numd2/nud2set.c, + * src/spicelib/devices/numd2/nud2temp.c, + * src/spicelib/devices/numos/nummset.c, + * src/spicelib/devices/numos/nummtemp.c : + drop the casts for pointer arguments of bcopy() and bzero() + their arguments are declared to be void pointers. + FIXME, src/frontend/vectors.c vec_mkfamily() + ugly and propably simply incorrect pointer bistromatic, + allocating v_realdata, but copying to v_compdata + I left that one untouched, to be fixed later. + 2010-06-27 Robert Larice * src/frontend/arg.c, * src/frontend/arg.h, diff --git a/src/ciderlib/support/database.c b/src/ciderlib/support/database.c index d6e2a8f9f..818e761c4 100644 --- a/src/ciderlib/support/database.c +++ b/src/ciderlib/support/database.c @@ -40,7 +40,7 @@ int lengthWanted; data = (double *) tmalloc(sizeof (double) * v->v_length); if (isreal(v)) { - bcopy((char *) v->v_realdata, (char *) data, sizeof (double) * v->v_length); + bcopy(v->v_realdata, data, sizeof (double) * v->v_length); } else { for (i=0; i < v->v_length; i++) { data[i] = realpart(&v->v_compdata[i]); diff --git a/src/frontend/com_let.c b/src/frontend/com_let.c index aa54a4176..6c38e9093 100644 --- a/src/frontend/com_let.c +++ b/src/frontend/com_let.c @@ -212,10 +212,10 @@ com_let(wordlist *wl) n->v_flags &= ~VF_PERMANENT; goto quit; } else if (isreal(t)) { - bcopy((char *) t->v_realdata, (char *) (n->v_realdata + offset), + bcopy(t->v_realdata, n->v_realdata + offset, length * sizeof (double)); } else { - bcopy((char *) t->v_compdata, (char *) (n->v_compdata + offset), + bcopy(t->v_compdata, n->v_compdata + offset, length * sizeof (complex)); } diff --git a/src/frontend/define.c b/src/frontend/define.c index f9bcfe548..cd226decc 100644 --- a/src/frontend/define.c +++ b/src/frontend/define.c @@ -165,14 +165,14 @@ savetree(struct pnode *pn) if (isreal(d)) { pn->pn_value->v_realdata = (double *) tmalloc(sizeof (double) * d->v_length); - bcopy((char *) d->v_realdata, - (char *) pn->pn_value->v_realdata, + bcopy(d->v_realdata, + pn->pn_value->v_realdata, sizeof (double) * d->v_length); } else { pn->pn_value->v_compdata = (complex *) tmalloc(sizeof (complex) * d->v_length); - bcopy((char *) d->v_compdata, - (char *) pn->pn_value->v_compdata, + bcopy(d->v_compdata, + pn->pn_value->v_compdata, sizeof (complex) * d->v_length); } } diff --git a/src/frontend/gens.c b/src/frontend/gens.c index ac9725199..7f51c731d 100644 --- a/src/frontend/gens.c +++ b/src/frontend/gens.c @@ -65,7 +65,7 @@ dgen_for_n(dgen *dg, int n, int (*fn) (/* ??? */), void *data, int subindex) int dnum, i, j, k; dgxp = &dgx; - bcopy((void *)dg, (void *)dgxp, sizeof(dgx)); /* va: compatible pointer types */ + bcopy(dg, dgxp, sizeof(dgx)); /* va: compatible pointer types */ dnum = dgxp->dev_type_no; diff --git a/src/frontend/plotting/graphdb.c b/src/frontend/plotting/graphdb.c index 9622ef967..e4b948808 100644 --- a/src/frontend/plotting/graphdb.c +++ b/src/frontend/plotting/graphdb.c @@ -109,7 +109,7 @@ GRAPH *CopyGraph(GRAPH *graph) struct dveclist *link, *newlink; ret = NewGraph(); - bcopy((void *)graph, (void *)ret, sizeof(GRAPH)); /* va: compatible pointer types */ + bcopy(graph, ret, sizeof(GRAPH)); /* va: compatible pointer types */ ret->graphid = RunningId - 1; /* restore id */ diff --git a/src/frontend/plotting/plotcurv.c b/src/frontend/plotting/plotcurv.c index 661689337..be52eb54c 100644 --- a/src/frontend/plotting/plotcurv.c +++ b/src/frontend/plotting/plotcurv.c @@ -220,13 +220,13 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart) /* Plot the first degree segments... */ if (isreal(v)) - bcopy((char *) v->v_realdata, (char *) ydata, + bcopy(v->v_realdata, ydata, (degree + 1) * sizeof (double)); else for (i = 0; i <= degree; i++) ydata[i] = realpart(&v->v_compdata[i]); if (isreal(xs)) - bcopy((char *) xs->v_realdata, (char *) xdata, + bcopy(xs->v_realdata, xdata, (degree + 1) * sizeof (double)); else for (i = 0; i <= degree; i++) diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index bc0c67b5f..63ca3b9b5 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -150,13 +150,11 @@ compress(struct dvec *d, double *xcomp, double *xind) dd = (double *) tmalloc(newlen * sz); cc = (complex *) dd; if (isreal(d)) { - bcopy((char *) (d->v_realdata + ilo), - (char *) dd, newlen * sz); + bcopy(d->v_realdata + ilo, dd, newlen * sz); tfree(d->v_realdata); d->v_realdata = dd; } else { - bcopy((char *) (d->v_compdata + ilo), - (char *) cc, newlen * sz); + bcopy(d->v_compdata + ilo, cc, newlen * sz); tfree(d->v_compdata); d->v_compdata = cc; } diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index dc692752c..cbf378044 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -449,7 +449,7 @@ com_write(wordlist *wl) tpl = vecs->v_plot; tpl->pl_written = TRUE; end = NULL; - bcopy((char *) tpl, (char *) &newplot, sizeof (struct plot)); + bcopy(tpl, &newplot, sizeof (struct plot)); scalefound = FALSE; /* Figure out how many vectors are in this plot. Also look diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index 9f640b26b..84141b84f 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -584,14 +584,14 @@ vec_copy(struct dvec *v) if (isreal(v)) { nv->v_realdata = (double *) tmalloc(sizeof (double) * v->v_length); - bcopy((char *) v->v_realdata, (char *) nv->v_realdata, + bcopy(v->v_realdata, nv->v_realdata, sizeof (double) * v->v_length); nv->v_compdata = NULL; } else { nv->v_realdata = NULL; nv->v_compdata = (complex *) tmalloc(sizeof (complex) * v->v_length); - bcopy((char *) v->v_compdata, (char *) nv->v_compdata, + bcopy(v->v_compdata, nv->v_compdata, sizeof (complex) * v->v_length); } diff --git a/src/maths/poly/interpolate.c b/src/maths/poly/interpolate.c index b9482125f..745cef893 100644 --- a/src/maths/poly/interpolate.c +++ b/src/maths/poly/interpolate.c @@ -62,8 +62,8 @@ ft_interpolate(double *data, double *ndata, double *oscale, int olen, ydata = (double *) tmalloc((degree + 1) * sizeof (double)); /* Deal with the first degree pieces. */ - bcopy((char *) data, (char *) ydata, (degree + 1) * sizeof (double)); - bcopy((char *) oscale, (char *) xdata, (degree + 1) * sizeof (double)); + bcopy(data, ydata, (degree + 1) * sizeof (double)); + bcopy(oscale, xdata, (degree + 1) * sizeof (double)); while (!ft_polyfit(xdata, ydata, result, degree, scratch)) { /* If it doesn't work this time, bump the interpolation diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 2c8671919..5c8bc3d9f 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -292,7 +292,7 @@ DCtran(CKTcircuit *ckt, ckt->CKTmode = (ckt->CKTmode&MODEUIC)|MODETRAN | MODEINITTRAN; /* modeinittran set here */ ckt->CKTag[0]=ckt->CKTag[1]=0; - bcopy((char *)ckt->CKTstate0,(char *)ckt->CKTstate1, + bcopy(ckt->CKTstate0, ckt->CKTstate1, ckt->CKTnumStates*sizeof(double)); #ifdef WANT_SENSE2 diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index 9d00e1ba5..3ed22c44e 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -479,7 +479,7 @@ resume: if(firstTime) { firstTime=0; - bcopy((char *)ckt->CKTstate0,(char *)ckt->CKTstate1, + bcopy(ckt->CKTstate0, ckt->CKTstate1, ckt->CKTnumStates*sizeof(double)); } diff --git a/src/spicelib/devices/nbjt/nbjtset.c b/src/spicelib/devices/nbjt/nbjtset.c index 349d1bce1..1f0707170 100644 --- a/src/spicelib/devices/nbjt/nbjtset.c +++ b/src/spicelib/devices/nbjt/nbjtset.c @@ -205,7 +205,7 @@ NBJTsetup(matrix, inModel, ckt, states) pMaterial = pMaterial->next; } /* Copy everything, then fix the incorrect pointer. */ - bcopy((char *) pM, (char *) pMaterial, sizeof(ONEmaterial)); + bcopy(pM, pMaterial, sizeof(ONEmaterial)); pMaterial->next = NIL(ONEmaterial); } @@ -225,7 +225,7 @@ NBJTsetup(matrix, inModel, ckt, states) ONEgetStatePointers(inst->NBJTpDevice, states); /* Wipe out statistics from previous runs (if any). */ - bzero((char *) inst->NBJTpDevice->pStats, sizeof(ONEstats)); + bzero(inst->NBJTpDevice->pStats, sizeof(ONEstats)); inst->NBJTpDevice->pStats->totalTime[STAT_SETUP] += SPfrontEnd->IFseconds() - startTime; diff --git a/src/spicelib/devices/nbjt/nbjttemp.c b/src/spicelib/devices/nbjt/nbjttemp.c index 63e12c5aa..55f177c56 100644 --- a/src/spicelib/devices/nbjt/nbjttemp.c +++ b/src/spicelib/devices/nbjt/nbjttemp.c @@ -81,7 +81,7 @@ NBJTtemp(inModel, ckt) /* Copy the original values, then fix the incorrect pointer. */ pNextMaterial = pMaterial->next; - bcopy((char *) pM, (char *) pMaterial, sizeof(ONEmaterial)); + bcopy(pM, pMaterial, sizeof(ONEmaterial)); pMaterial->next = pNextMaterial; /* Now do the temperature dependence. */ diff --git a/src/spicelib/devices/nbjt2/nbt2set.c b/src/spicelib/devices/nbjt2/nbt2set.c index 985684d88..d0b18d5c6 100644 --- a/src/spicelib/devices/nbjt2/nbt2set.c +++ b/src/spicelib/devices/nbjt2/nbt2set.c @@ -229,7 +229,7 @@ NBJT2setup(matrix, inModel, ckt, states) pMaterial = pMaterial->next; } /* Copy everything, then fix the incorrect pointer. */ - bcopy((char *) pM, (char *) pMaterial, sizeof(TWOmaterial)); + bcopy(pM, pMaterial, sizeof(TWOmaterial)); pMaterial->next = NIL(TWOmaterial); } @@ -243,7 +243,7 @@ NBJT2setup(matrix, inModel, ckt, states) TWOgetStatePointers(inst->NBJT2pDevice, states); /* Wipe out statistics from previous runs (if any). */ - bzero((char *) inst->NBJT2pDevice->pStats, sizeof(TWOstats)); + bzero(inst->NBJT2pDevice->pStats, sizeof(TWOstats)); inst->NBJT2pDevice->pStats->totalTime[STAT_SETUP] += SPfrontEnd->IFseconds() - startTime; diff --git a/src/spicelib/devices/nbjt2/nbt2temp.c b/src/spicelib/devices/nbjt2/nbt2temp.c index 4269e6213..8371e013e 100644 --- a/src/spicelib/devices/nbjt2/nbt2temp.c +++ b/src/spicelib/devices/nbjt2/nbt2temp.c @@ -86,7 +86,7 @@ NBJT2temp(inModel, ckt) /* Copy everything, then fix the incorrect pointer. */ pNextMaterial = pMaterial->next; - bcopy((char *) pM, (char *) pMaterial, sizeof(TWOmaterial)); + bcopy(pM, pMaterial, sizeof(TWOmaterial)); pMaterial->next = pNextMaterial; /* Now do the temperature dependence. */ diff --git a/src/spicelib/devices/numd/numdset.c b/src/spicelib/devices/numd/numdset.c index 23b58af25..57106c1f6 100644 --- a/src/spicelib/devices/numd/numdset.c +++ b/src/spicelib/devices/numd/numdset.c @@ -196,7 +196,7 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) pMaterial = pMaterial->next; } /* Copy everything, then fix the incorrect pointer. */ - bcopy((void *) pM, (void *) pMaterial, sizeof(ONEmaterial)); + bcopy(pM, pMaterial, sizeof(ONEmaterial)); pMaterial->next = NIL(ONEmaterial); } @@ -210,7 +210,7 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) ONEgetStatePointers(inst->NUMDpDevice, states); /* Wipe out statistics from previous runs (if any). */ - bzero((void *) inst->NUMDpDevice->pStats, sizeof(ONEstats)); + bzero(inst->NUMDpDevice->pStats, sizeof(ONEstats)); inst->NUMDpDevice->pStats->totalTime[STAT_SETUP] += SPfrontEnd->IFseconds() - startTime; diff --git a/src/spicelib/devices/numd/numdtemp.c b/src/spicelib/devices/numd/numdtemp.c index 79fd809e8..7be0bdd15 100644 --- a/src/spicelib/devices/numd/numdtemp.c +++ b/src/spicelib/devices/numd/numdtemp.c @@ -79,7 +79,7 @@ NUMDtemp(inModel, ckt) /* Copy the original values, then fix the incorrect pointer. */ pNextMaterial = pMaterial->next; - bcopy((char *) pM, (char *) pMaterial, sizeof(ONEmaterial)); + bcopy(pM, pMaterial, sizeof(ONEmaterial)); pMaterial->next = pNextMaterial; /* Now do the temperature dependence. */ diff --git a/src/spicelib/devices/numd2/nud2set.c b/src/spicelib/devices/numd2/nud2set.c index e674e1de8..d88d26e0f 100644 --- a/src/spicelib/devices/numd2/nud2set.c +++ b/src/spicelib/devices/numd2/nud2set.c @@ -227,7 +227,7 @@ NUMD2setup(matrix, inModel, ckt, states) pMaterial = pMaterial->next; } /* Copy everything, then fix the incorrect pointer. */ - bcopy((char *) pM, (char *) pMaterial, sizeof(TWOmaterial)); + bcopy(pM, pMaterial, sizeof(TWOmaterial)); pMaterial->next = NIL(TWOmaterial); } @@ -241,7 +241,7 @@ NUMD2setup(matrix, inModel, ckt, states) TWOgetStatePointers(inst->NUMD2pDevice, states); /* Wipe out statistics from previous runs (if any). */ - bzero((char *) inst->NUMD2pDevice->pStats, sizeof(TWOstats)); + bzero(inst->NUMD2pDevice->pStats, sizeof(TWOstats)); inst->NUMD2pDevice->pStats->totalTime[STAT_SETUP] += SPfrontEnd->IFseconds() - startTime; diff --git a/src/spicelib/devices/numd2/nud2temp.c b/src/spicelib/devices/numd2/nud2temp.c index 5cd7c6bd8..351a0ce58 100644 --- a/src/spicelib/devices/numd2/nud2temp.c +++ b/src/spicelib/devices/numd2/nud2temp.c @@ -84,7 +84,7 @@ NUMD2temp(inModel, ckt) /* Copy everything, then fix the incorrect pointer. */ pNextMaterial = pMaterial->next; - bcopy((char *) pM, (char *) pMaterial, sizeof(TWOmaterial)); + bcopy(pM, pMaterial, sizeof(TWOmaterial)); pMaterial->next = pNextMaterial; /* Now do the temperature dependence. */ diff --git a/src/spicelib/devices/numos/nummset.c b/src/spicelib/devices/numos/nummset.c index 1b950f10d..adec70e0d 100644 --- a/src/spicelib/devices/numos/nummset.c +++ b/src/spicelib/devices/numos/nummset.c @@ -226,7 +226,7 @@ NUMOSsetup(matrix, inModel, ckt, states) pMaterial = pMaterial->next; } /* Copy everything, then fix the incorrect pointer. */ - bcopy((char *) pM, (char *) pMaterial, sizeof(TWOmaterial)); + bcopy(pM, pMaterial, sizeof(TWOmaterial)); pMaterial->next = NIL(TWOmaterial); } @@ -240,7 +240,7 @@ NUMOSsetup(matrix, inModel, ckt, states) TWOgetStatePointers(inst->NUMOSpDevice, states); /* Wipe out statistics from previous runs (if any). */ - bzero((char *) inst->NUMOSpDevice->pStats, sizeof(TWOstats)); + bzero(inst->NUMOSpDevice->pStats, sizeof(TWOstats)); inst->NUMOSpDevice->pStats->totalTime[STAT_SETUP] += SPfrontEnd->IFseconds() - startTime; diff --git a/src/spicelib/devices/numos/nummtemp.c b/src/spicelib/devices/numos/nummtemp.c index 1b3c23c00..4c5349749 100644 --- a/src/spicelib/devices/numos/nummtemp.c +++ b/src/spicelib/devices/numos/nummtemp.c @@ -85,7 +85,7 @@ NUMOStemp(inModel, ckt) /* Copy everything, then fix the incorrect pointer. */ pNextMaterial = pMaterial->next; - bcopy((char *) pM, (char *) pMaterial, sizeof(TWOmaterial)); + bcopy(pM, pMaterial, sizeof(TWOmaterial)); pMaterial->next = pNextMaterial; /* Now do the temperature dependence. */