From 59d4e5d961e30230c0cfaaadf9d9fa52454b47c3 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 4 Jul 2010 17:54:22 +0000 Subject: [PATCH] fix various type glitches --- ChangeLog | 8 ++++++++ src/frontend/evaluate.c | 3 ++- src/frontend/outitf.c | 4 ++-- src/frontend/outitf.h | 2 +- src/frontend/variable.c | 6 +++--- src/include/hlpdefs.h | 2 +- src/spicelib/analysis/ckti2nod.c | 2 +- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b94168c7..eb9b3262f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-07-04 Robert Larice + * src/frontend/evaluate.c : use void* instead of char* for anonymous data + * src/frontend/outitf.c : use a rescasted parameter + * src/frontend/outitf.h : make use of the existing enum GRIDTYPE + * src/frontend/variable.c : add missing casts + * src/spicelib/analysis/ckti2nod.c : drop an useless cast + * src/include/hlpdefs.h : use the struct name instead of the typedef name + 2010-07-04 Robert Larice * src/maths/sparse/spdefs.h : fix the type of an ancient anonymous pointer from char* to void* diff --git a/src/frontend/evaluate.c b/src/frontend/evaluate.c index 97e138e2c..48e80c63c 100644 --- a/src/frontend/evaluate.c +++ b/src/frontend/evaluate.c @@ -803,7 +803,8 @@ apply_func(struct func *func, struct pnode *arg) struct dvec *v, *t, *newv = NULL, *end = NULL; int len, i; short type; - char *data, buf[BSIZE_SP]; + void *data; + char buf[BSIZE_SP]; /* Special case. This is not good -- happens when vm(), etc are used * and it gets caught as a user-definable function. Usually v() diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 6c15c8652..4e921f110 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -460,7 +460,7 @@ OUTpData(void *plotPtr, IFvalue *refValue, IFvalue *valuePtr) if (run->writeOut) { if (run->pointCount == 1) - fileInit_pass2(plotPtr); + fileInit_pass2(run); fileStartPoint(run->fp, run->binary, run->pointCount); if (run->refIndex != -1) { @@ -689,7 +689,7 @@ OUTattributes(void *plotPtr, IFuid varName, int param, IFvalue *value) { runDesc *run = (runDesc *) plotPtr; struct dvec *d; - int type; + GRIDTYPE type; int i; if (param == OUT_SCALE_LIN) diff --git a/src/frontend/outitf.h b/src/frontend/outitf.h index 764efd62f..7fd395683 100644 --- a/src/frontend/outitf.h +++ b/src/frontend/outitf.h @@ -8,7 +8,7 @@ typedef struct dataDesc { char *name; /* The name of the vector. */ int type; /* The type. */ - int gtype; /* default plot scale */ + GRIDTYPE gtype; /* default plot scale */ bool regular; /* Is this given to us? */ int outIndex; /* If regular then the index. */ char *specName; /* The device name if special. */ diff --git a/src/frontend/variable.c b/src/frontend/variable.c index c7728b16a..ace12bc5c 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -583,7 +583,7 @@ cp_getvar(char *name, int type, void *retval) char *s; s = cp_unquote(v->va_string); cp_wstrip(s); - (void) strcpy(retval, s); + (void) strcpy((char*) retval, s); tfree(s);/*DG*/ break; } @@ -617,11 +617,11 @@ cp_getvar(char *name, int type, void *retval) free_struct_variable(uv1); return (TRUE); } else if ((type == VT_STRING) && (v->va_type == VT_NUM)) { - (void) sprintf(retval, "%d", v->va_num); + (void) sprintf((char*) retval, "%d", v->va_num); free_struct_variable(uv1); return (TRUE); } else if ((type == VT_STRING) && (v->va_type == VT_REAL)) { - (void) sprintf(retval, "%f", v->va_real); + (void) sprintf((char*) retval, "%f", v->va_real); free_struct_variable(uv1); return (TRUE); } diff --git a/src/include/hlpdefs.h b/src/include/hlpdefs.h index b26754394..58e732c6b 100644 --- a/src/include/hlpdefs.h +++ b/src/include/hlpdefs.h @@ -39,7 +39,7 @@ typedef struct toplink { char *description; /* really the subject */ fplace *place; struct toplink *next; - button button; + struct button button; } toplink; typedef struct topic { diff --git a/src/spicelib/analysis/ckti2nod.c b/src/spicelib/analysis/ckti2nod.c index 09c768dfa..34d1e1aed 100644 --- a/src/spicelib/analysis/ckti2nod.c +++ b/src/spicelib/analysis/ckti2nod.c @@ -59,7 +59,7 @@ CKTinst2Node(void *ckt, void *instPtr, int terminal, CKTnode **node, IFuid *node for(here = ((CKTcircuit*)ckt)->CKTnodes;here;here = here->next) { if(here->number == nodenum) { /* found it */ - *node = (void*) here; + *node = here; *nodeName = here->name; return(OK); }