(int) casts for some `strlen()' expressions

This commit is contained in:
rlar 2010-11-02 17:17:43 +00:00
parent c9ba660155
commit b4ffca60c4
18 changed files with 50 additions and 23 deletions

View File

@ -1,3 +1,30 @@
2010-11-02 Robert Larice
* src/frontend/com_history.c ,
* src/frontend/com_measure2.c ,
* src/frontend/fourier.c ,
* src/frontend/numparam/xpressn.c ,
* src/frontend/parser/backq.c ,
* src/frontend/parser/complete.c ,
* src/frontend/plotting/x11.c ,
* src/frontend/subckt.c ,
* src/frontend/variable.c ,
* src/xspice/cmpp/mod_yacc.y ,
* src/xspice/cmpp/pp_lst.c ,
* src/xspice/cmpp/pp_mod.c ,
* src/xspice/cmpp/writ_ifs.c ,
* src/xspice/evt/evtdump.c ,
* src/xspice/evt/evtplot.c ,
* src/xspice/ipc/ipc.c ,
* src/xspice/ipc/ipctiein.c :
(int) casts for some `strlen()' expressions
2010-11-02 Robert Larice
* src/xspice/icm/digital/adc_bridge/cfunc.mod ,
* src/xspice/icm/digital/d_ram/cfunc.mod ,
* src/xspice/icm/digital/d_source/cfunc.mod ,
* src/xspice/icm/digital/dac_bridge/cfunc.mod :
(int) casts for cm_event_alloc and cm_analog_alloc
2010-11-02 Robert Larice
* src/ciderlib/oned/oneprint.c ,
* src/ciderlib/support/database.c ,

View File

@ -474,7 +474,7 @@ dohs(char *pat, char *str)
p =strchr(s, schar);
if (p)
*p = '\0';
plen = strlen(pat) - 1;
plen = (int) strlen(pat) - 1;
for (i = 0; *str; str++) {
if ((*str == *pat) && prefix(pat, str) && (ok == FALSE)) {
for (p = s; *p; p++)

View File

@ -333,7 +333,7 @@ int measure_extract_variables( char *line )
variable2 = NULL;
if (*line == '=') variable2 = gettok_iv(&line) ;
if( variable ){
len = strlen(item) ;
len = (int) strlen(item);
if( item[len-1] == '=' ){
} else {
/* We may have something like V(n1)=1

View File

@ -56,7 +56,7 @@ fourier(wordlist *wl, struct plot *current_plot)
return 1;
sprintf(xbuf, "%1.1e", 0.0);
shift = strlen(xbuf) - 7;
shift = (int) strlen(xbuf) - 7;
if (!current_plot || !current_plot->pl_scale) {
fprintf(cp_err, "Error: no vectors loaded.\n");
return 1;

View File

@ -2258,14 +2258,14 @@ nupa_subcktcall (tdico * dico, char *s, char *x, unsigned char err)
found = 0;
token = strtok(buf, " "); /* a bit more exact - but not sufficient everytime */
j = j + strlen(token) + 1;
j = j + (int) strlen(token) + 1;
if (strcmp(token, spice_dstring_value(&subname))) {
while ((token = strtok(NULL, " "))) {
if (!strcmp(token, spice_dstring_value(&subname))) {
found = 1;
break;
}
j = j + strlen(token) + 1;
j = j + (int) strlen(token) + 1;
}
}
spice_dstring_free(&parsebuf) ;

View File

@ -66,7 +66,7 @@ loop: s =strchr(t, cp_back);
/* MW. We must move to the begging of new wordlist. */
(void) strcpy(buf, wl->wl_word);
i = strlen(buf);
i = (int) strlen(buf);
(void) strcat(buf, tbuf);
tfree(wl->wl_word);
wl->wl_word = copy(buf);

View File

@ -105,7 +105,7 @@ cp_ccom(wordlist *wlist, char *buf, bool esc)
if (cc && (cc->cc_kwords[arg] & 1)) {
pmatches = ccfilec(buf);
s =strrchr(buf, '/');
i = strlen(s ? s + 1 : buf);
i = (int) strlen(s ? s + 1 : buf);
if ((*buf == '~') && !index(buf, '/'))
i--;
}
@ -115,7 +115,7 @@ cp_ccom(wordlist *wlist, char *buf, bool esc)
if (cc && (cc->cc_kwords[arg] & (1 << j))) {
/* Find all the matching keywords. */
a = ccmatch(buf, &keywords[j]);
i = strlen(buf);
i = (int) strlen(buf);
if (pmatches)
pmatches = wl_append(pmatches, a);
else
@ -125,7 +125,7 @@ cp_ccom(wordlist *wlist, char *buf, bool esc)
wl_sort(pmatches);
} else {
pmatches = ccmatch(buf, &commands);
i = strlen(buf);
i = (int) strlen(buf);
}
tfree(buf); /*CDHW*/
@ -307,7 +307,7 @@ printem(wordlist *wl)
}
num = wl_length(wl);
for (ww = wl; ww; ww = ww->wl_next) {
j = strlen(ww->wl_word);
j = (int) strlen(ww->wl_word);
if (j > maxl)
maxl = j;
}

View File

@ -540,7 +540,7 @@ X11_Text(char *text, int x, int y)
DEVDEP(currentgraph).gc, x,
currentgraph->absolute.height
- (y + DEVDEP(currentgraph).font->max_bounds.descent),
text, strlen(text));
text, (int) strlen(text));
/* note: unlike before, we do not save any text here */
return 0;

View File

@ -1939,7 +1939,7 @@ devmodtranslate(struct line *deck, char *subname)
/* Now, is this a subcircuit model? */
for (wlsub = submod; wlsub; wlsub = wlsub->wl_next) {
i = strlen(wlsub->wl_word);
i = (int) strlen(wlsub->wl_word);
j = 0; /* Now, have we a binned model? */
if ( (dot_char = strstr( wlsub->wl_word, "." )) ) {
dot_char++; j++;

View File

@ -703,7 +703,7 @@ cp_variablesubst(wordlist *wlist)
for (wlist = wl; wlist->wl_prev; wlist = wlist->wl_prev)
;
(void) strcpy(buf, wl->wl_word);
i = strlen(buf);
i = (int) strlen(buf);
(void) strcat(buf, tbuf); /* MW. tbuf is used here only */
tfree(wl->wl_word);

View File

@ -316,7 +316,7 @@ static void init_buffer (void)
/*---------------------------------------------------------------------------*/
static void append (char *str)
{
int len = strlen (str);
int len = (int) strlen (str);
if (len + buf_len > BUFFER_SIZE) {
yyerror ("Buffer overflow - try reducing the complexity of CM-macro array subscripts");
exit (1);

View File

@ -252,7 +252,7 @@ static Status_t read_modpath(
while( fgets(path, sizeof(path), fp) ) {
line_num++;
len = strlen(path);
len = (int) strlen(path);
/* If line was too long for buffer, exit with error */
if(len > MAX_PATH_LEN) {
@ -373,7 +373,7 @@ static Status_t read_udnpath(
while( fgets(path, sizeof(path), fp) ) {
line_num++;
len = strlen(path);
len = (int) strlen(path);
/* If line was too long for buffer, exit with error */
if(len > MAX_PATH_LEN) {

View File

@ -78,7 +78,7 @@ extern char *prog_name;
/*---------------------------------------------------------------------------*/
static void change_extension (char *filename, char *ext, char *new_filename)
{
int i = strlen (filename);
int i = (int) strlen (filename);
strcpy (new_filename, filename);

View File

@ -1213,7 +1213,7 @@ static char *value_to_str(Data_Type_t type, Value_t value)
case STRING:
/* be careful, the string could conceivably be very long... */
str_len = strlen(value.svalue);
str_len = (int) strlen(value.svalue);
if((str_len + BASE_STR_LEN) > max_len) {
str = (char *) realloc(str, (size_t) (max_len + str_len + 1));
max_len += str_len;

View File

@ -183,7 +183,7 @@ void EVTdump(
/* If name is in a subcircuit, mark that node should not be sent */
/* and continue to next node. */
name_len = strlen(name);
name_len = (int) strlen(name);
for(j = 0; j < name_len; j++) {
if(name[j] == ':')
break;

View File

@ -118,7 +118,7 @@ struct dvec *EVTfindvec(
name = MIFcopy(node);
/* Convert to all lower case */
len = strlen(name);
len = (int) strlen(name);
for(i = 0; i < len; i++)
if(isupper(name[i]))
name[i] = tolower(name[i]);

View File

@ -505,7 +505,7 @@ ipc_send_line (char *str ) /* The text to send */
Ipc_Status_t status= IPC_STATUS_OK;
len = strlen(str);
len = (int) strlen(str);
/* if short string, send it immediately */
if(len < 80)
@ -946,7 +946,7 @@ ipc_send_event (
assert(sizeof(int) == 4);
/* Put the analysis step bytes in */
buff_len = strlen(buff);
buff_len = (int) strlen(buff);
buff_ptr = buff + buff_len;
fvalue = step;
temp_ptr = (char *) &fvalue;

View File

@ -409,7 +409,7 @@ int ipc_get_devices(
/* Get the name of the instance */
inst_name = here->GENname;
inst_name_len = strlen(inst_name);
inst_name_len = (int) strlen(inst_name);
/* Skip if it is a inside a subcircuit */
for(i = 0; i < inst_name_len; i++)