diff --git a/ChangeLog b/ChangeLog index 880d07684..482c029c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2010-11-06 Robert Larice + * src/frontend/measure.c , + * src/frontend/outitf.c , + * src/frontend/quote.c , + * src/frontend/help/readhelp.c , + * src/misc/util.c , + * src/misc/wlist.c , + * src/spicelib/devices/nbjt/nbjtset.c , + * src/spicelib/devices/nbjt2/nbt2set.c , + * src/spicelib/devices/numd/numdset.c , + * src/spicelib/devices/numd2/nud2set.c , + * src/spicelib/devices/numos/nummset.c , + * src/xspice/cmpp/ifs_yacc.y , + * src/xspice/enh/enhtrans.c , + * src/xspice/evt/evtload.c , + * src/xspice/icm/digital/d_source/cfunc.mod , + * src/xspice/icm/digital/d_state/cfunc.mod : + change the type of a bunch of variables from `int' to `size_t' + 2010-11-06 Robert Larice * src/frontend/plotting/plotit.c : tiny rewrite, avoid type conversion warnings diff --git a/src/frontend/help/readhelp.c b/src/frontend/help/readhelp.c index d433beca9..4a40d0924 100644 --- a/src/frontend/help/readhelp.c +++ b/src/frontend/help/readhelp.c @@ -42,7 +42,7 @@ static void sortlist(toplink **tlp) { toplink **vec, *tl; - int num = 0, i; + size_t num = 0, i; for (tl = *tlp; tl; tl = tl->next) num++; diff --git a/src/frontend/measure.c b/src/frontend/measure.c index debe462d6..075d969b5 100644 --- a/src/frontend/measure.c +++ b/src/frontend/measure.c @@ -396,7 +396,7 @@ check_autostop( char* what ) { /* parses the .meas line into a wordlist (without leading .meas) */ static wordlist *measure_parse_line( char *line ) { - int len ; /* length of string */ + size_t len ; /* length of string */ wordlist *wl ; /* build a word list - head of list */ wordlist *new_item ; /* single item of a list */ char *item ; /* parsed item */ diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 003e5c234..8f0a5fa54 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -80,7 +80,7 @@ static void freeRun(runDesc *run); static clock_t lastclock, currclock; static double *rowbuf; -static int column, rowbuflen; +static size_t column, rowbuflen; static bool shouldstop = FALSE; /* Tell simulator to stop next time it asks. */ @@ -727,6 +727,7 @@ fileInit(runDesc *run) { char buf[513]; int i; + size_t n; lastclock = clock(); @@ -736,29 +737,29 @@ fileInit(runDesc *run) if (run->data[i].type == IF_COMPLEX) run->isComplex = TRUE; - i = 0; + n = 0; sprintf(buf, "Title: %s\n", run->name); - i += strlen(buf); + n += strlen(buf); fputs(buf, run->fp); sprintf(buf, "Date: %s\n", datestring()); - i += strlen(buf); + n += strlen(buf); fputs(buf, run->fp); sprintf(buf, "Plotname: %s\n", run->type); - i += strlen(buf); + n += strlen(buf); fputs(buf, run->fp); sprintf(buf, "Flags: %s\n", run->isComplex ? "complex" : "real"); - i += strlen(buf); + n += strlen(buf); fputs(buf, run->fp); sprintf(buf, "No. Variables: %d\n", run->numData); - i += strlen(buf); + n += strlen(buf); fputs(buf, run->fp); sprintf(buf, "No. Points: "); - i += strlen(buf); + n += strlen(buf); fputs(buf, run->fp); fflush(run->fp); /* Gotta do this for LATTICE. */ if (run->fp == stdout || (run->pointPos = ftell(run->fp)) <= 0) - run->pointPos = i; + run->pointPos = (long) n; fprintf(run->fp, "0 \n"); /* Save 8 spaces here. */ /*fprintf(run->fp, "Command: version %s\n", ft_sim->version);*/ diff --git a/src/frontend/quote.c b/src/frontend/quote.c index 8316c01dd..2fc753284 100644 --- a/src/frontend/quote.c +++ b/src/frontend/quote.c @@ -76,7 +76,7 @@ char * cp_unquote(char *string) { char *s; - int l; + size_t l; if (string) { l = strlen(string); s = TMALLOC(char, l + 1); diff --git a/src/misc/util.c b/src/misc/util.c index f08494385..9ccbece9b 100644 --- a/src/misc/util.c +++ b/src/misc/util.c @@ -123,7 +123,7 @@ canonicalize_pathname(char *path) char * absolute_pathname(char *string, char *dot_path) { char *result; - int result_len; + size_t result_len; if (!dot_path || *string == '/') result = copy(string); diff --git a/src/misc/wlist.c b/src/misc/wlist.c index e258f0d9b..1dc4638f6 100644 --- a/src/misc/wlist.c +++ b/src/misc/wlist.c @@ -194,7 +194,7 @@ wl_flatten(wordlist *wl) { char *buf; wordlist *tw; - int i = 0; + size_t i = 0; for (tw = wl; tw; tw = tw->wl_next) i += strlen(tw->wl_word) + 1; @@ -237,7 +237,7 @@ wlcomp(const void *a, const void *b) void wl_sort(wordlist *wl) { - int i = 0; + size_t i = 0; wordlist *ww = wl; char **stuff; diff --git a/src/spicelib/devices/nbjt/nbjtset.c b/src/spicelib/devices/nbjt/nbjtset.c index 0b49b13be..3de720a55 100644 --- a/src/spicelib/devices/nbjt/nbjtset.c +++ b/src/spicelib/devices/nbjt/nbjtset.c @@ -36,7 +36,7 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) OPTNcard *options; OUTPcard *outputs; char *icFileName = NULL; - int nameLen; + size_t nameLen; int error; int xMeshSize; ONEdevice *pDevice; diff --git a/src/spicelib/devices/nbjt2/nbt2set.c b/src/spicelib/devices/nbjt2/nbt2set.c index f9c474546..e765f3920 100644 --- a/src/spicelib/devices/nbjt2/nbt2set.c +++ b/src/spicelib/devices/nbjt2/nbt2set.c @@ -38,7 +38,7 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) OPTNcard *options; OUTPcard *outputs; char *icFileName = NULL; - int nameLen; + size_t nameLen; int error, xIndex; int xMeshSize, yMeshSize; TWOdevice *pDevice; diff --git a/src/spicelib/devices/numd/numdset.c b/src/spicelib/devices/numd/numdset.c index d2bd95a6c..b3c8941ef 100644 --- a/src/spicelib/devices/numd/numdset.c +++ b/src/spicelib/devices/numd/numdset.c @@ -37,7 +37,7 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) OPTNcard *options; OUTPcard *outputs; char *icFileName = NULL; - int nameLen; + size_t nameLen; int error; int xMeshSize; ONEdevice *pDevice; diff --git a/src/spicelib/devices/numd2/nud2set.c b/src/spicelib/devices/numd2/nud2set.c index 4fb7ff951..4fe958978 100644 --- a/src/spicelib/devices/numd2/nud2set.c +++ b/src/spicelib/devices/numd2/nud2set.c @@ -38,7 +38,7 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) OPTNcard *options; OUTPcard *outputs; char *icFileName = NULL; - int nameLen; + size_t nameLen; int error, xIndex; int xMeshSize, yMeshSize; TWOdevice *pDevice; diff --git a/src/spicelib/devices/numos/nummset.c b/src/spicelib/devices/numos/nummset.c index 83bf59711..d0ed52a8a 100644 --- a/src/spicelib/devices/numos/nummset.c +++ b/src/spicelib/devices/numos/nummset.c @@ -38,7 +38,7 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) OPTNcard *options; OUTPcard *outputs; char *icFileName = NULL; - int nameLen; + size_t nameLen; int error, xIndex; int xMeshSize, yMeshSize; TWOdevice *pDevice; diff --git a/src/xspice/cmpp/ifs_yacc.y b/src/xspice/cmpp/ifs_yacc.y index daa9dc99d..e9254cfa1 100755 --- a/src/xspice/cmpp/ifs_yacc.y +++ b/src/xspice/cmpp/ifs_yacc.y @@ -113,7 +113,7 @@ static Boolean_t num_items_fixed; Ifs_Table_t *parser_ifs_table; #define TBL parser_ifs_table -static int alloced_size [4]; +static size_t alloced_size [4]; /* * !!!!! Make sure these are large enough so that they never get realloced @@ -358,7 +358,7 @@ check_item_num (void) if (item-item_offset >= ITEM_BUFFER_SIZE) { fatal ("Too many items in table - split into sub-tables"); } - if (item > alloced_size [context.table] ) { + if (item > (int) alloced_size [context.table] ) { switch (context.table) { case TBL_NAME: break; diff --git a/src/xspice/enh/enhtrans.c b/src/xspice/enh/enhtrans.c index ef21e937f..ae8513681 100755 --- a/src/xspice/enh/enhtrans.c +++ b/src/xspice/enh/enhtrans.c @@ -283,8 +283,8 @@ static char *two2three_translate( int num_conns; int num_coefs; - int inst_card_len; - int mod_card_len; + size_t inst_card_len; + size_t mod_card_len; int i; diff --git a/src/xspice/evt/evtload.c b/src/xspice/evt/evtload.c index 3e4b0ac9a..d78e1596d 100755 --- a/src/xspice/evt/evtload.c +++ b/src/xspice/evt/evtload.c @@ -319,7 +319,7 @@ static void EVTcreate_state( CKTcircuit *ckt, /* The circuit structure */ int inst_index) /* The instance to create state for */ { - int total_size; + size_t total_size; Evt_State_Data_t *state_data; @@ -334,7 +334,7 @@ static void EVTcreate_state( return; /* Get size of state block to be allocated */ - total_size = state_data->total_size[inst_index]; + total_size = (size_t) state_data->total_size[inst_index]; /* Allocate a new state for the instance */ if(state_data->free[inst_index]) @@ -346,7 +346,7 @@ static void EVTcreate_state( { new_state = TMALLOC(Evt_State_t, 1); - new_state->block = tmalloc((size_t) total_size); + new_state->block = tmalloc(total_size); } diff --git a/src/xspice/icm/digital/d_source/cfunc.mod b/src/xspice/icm/digital/d_source/cfunc.mod index c33cba50a..56276ca26 100644 --- a/src/xspice/icm/digital/d_source/cfunc.mod +++ b/src/xspice/icm/digital/d_source/cfunc.mod @@ -340,8 +340,8 @@ float *p_value ) /* OUT - The numerical value */ /* the following were "int4" devices - jpm */ - int len; - int i; + size_t len; + size_t i; int n_matched; line_t val_str; diff --git a/src/xspice/icm/digital/d_state/cfunc.mod b/src/xspice/icm/digital/d_state/cfunc.mod index ed0f82742..c7b45eed2 100644 --- a/src/xspice/icm/digital/d_state/cfunc.mod +++ b/src/xspice/icm/digital/d_state/cfunc.mod @@ -399,8 +399,8 @@ float *p_value ) /* OUT - The numerical value */ /* the following were "int4" devices - jpm */ - int len; - int i; + size_t len; + size_t i; int n_matched; line_t val_str;