Browse Source

drop the casts for pointer arguments of bcopy() and bzero()

pre-master-46
rlar 16 years ago
parent
commit
a120a5d049
  1. 30
      ChangeLog
  2. 2
      src/ciderlib/support/database.c
  3. 4
      src/frontend/com_let.c
  4. 8
      src/frontend/define.c
  5. 2
      src/frontend/gens.c
  6. 2
      src/frontend/plotting/graphdb.c
  7. 4
      src/frontend/plotting/plotcurv.c
  8. 6
      src/frontend/plotting/plotit.c
  9. 2
      src/frontend/postcoms.c
  10. 4
      src/frontend/vectors.c
  11. 4
      src/maths/poly/interpolate.c
  12. 2
      src/spicelib/analysis/dctran.c
  13. 2
      src/spicelib/analysis/dctrcurv.c
  14. 4
      src/spicelib/devices/nbjt/nbjtset.c
  15. 2
      src/spicelib/devices/nbjt/nbjttemp.c
  16. 4
      src/spicelib/devices/nbjt2/nbt2set.c
  17. 2
      src/spicelib/devices/nbjt2/nbt2temp.c
  18. 4
      src/spicelib/devices/numd/numdset.c
  19. 2
      src/spicelib/devices/numd/numdtemp.c
  20. 4
      src/spicelib/devices/numd2/nud2set.c
  21. 2
      src/spicelib/devices/numd2/nud2temp.c
  22. 4
      src/spicelib/devices/numos/nummset.c
  23. 2
      src/spicelib/devices/numos/nummtemp.c

30
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,

2
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]);

4
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));
}

8
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);
}
}

2
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;

2
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 */

4
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++)

6
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;
}

2
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

4
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);
}

4
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

2
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

2
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));
}

4
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;

2
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. */

4
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;

2
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. */

4
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;

2
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. */

4
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;

2
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. */

4
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;

2
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. */

Loading…
Cancel
Save