change the type of a bunch of variables from `int' to `size_t'
This commit is contained in:
parent
8cd9d88d40
commit
d0dba768f8
19
ChangeLog
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
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);*/
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue