Browse Source

change the type of a bunch of variables from `int' to `size_t'

pre-master-46
rlar 16 years ago
parent
commit
d0dba768f8
  1. 19
      ChangeLog
  2. 2
      src/frontend/help/readhelp.c
  3. 2
      src/frontend/measure.c
  4. 19
      src/frontend/outitf.c
  5. 2
      src/frontend/quote.c
  6. 2
      src/misc/util.c
  7. 4
      src/misc/wlist.c
  8. 2
      src/spicelib/devices/nbjt/nbjtset.c
  9. 2
      src/spicelib/devices/nbjt2/nbt2set.c
  10. 2
      src/spicelib/devices/numd/numdset.c
  11. 2
      src/spicelib/devices/numd2/nud2set.c
  12. 2
      src/spicelib/devices/numos/nummset.c
  13. 4
      src/xspice/cmpp/ifs_yacc.y
  14. 4
      src/xspice/enh/enhtrans.c
  15. 6
      src/xspice/evt/evtload.c
  16. 4
      src/xspice/icm/digital/d_source/cfunc.mod
  17. 4
      src/xspice/icm/digital/d_state/cfunc.mod

19
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

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

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

19
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);*/

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save