Browse Source

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

pre-master-46
rlar 16 years ago
parent
commit
b4ffca60c4
  1. 27
      ChangeLog
  2. 2
      src/frontend/com_history.c
  3. 2
      src/frontend/com_measure2.c
  4. 2
      src/frontend/fourier.c
  5. 4
      src/frontend/numparam/xpressn.c
  6. 2
      src/frontend/parser/backq.c
  7. 8
      src/frontend/parser/complete.c
  8. 2
      src/frontend/plotting/x11.c
  9. 2
      src/frontend/subckt.c
  10. 2
      src/frontend/variable.c
  11. 2
      src/xspice/cmpp/mod_yacc.y
  12. 4
      src/xspice/cmpp/pp_lst.c
  13. 2
      src/xspice/cmpp/pp_mod.c
  14. 2
      src/xspice/cmpp/writ_ifs.c
  15. 2
      src/xspice/evt/evtdump.c
  16. 2
      src/xspice/evt/evtplot.c
  17. 4
      src/xspice/ipc/ipc.c
  18. 2
      src/xspice/ipc/ipctiein.c

27
ChangeLog

@ -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 2010-11-02 Robert Larice
* src/ciderlib/oned/oneprint.c , * src/ciderlib/oned/oneprint.c ,
* src/ciderlib/support/database.c , * src/ciderlib/support/database.c ,

2
src/frontend/com_history.c

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

2
src/frontend/com_measure2.c

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

2
src/frontend/fourier.c

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

4
src/frontend/numparam/xpressn.c

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

2
src/frontend/parser/backq.c

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

8
src/frontend/parser/complete.c

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

2
src/frontend/plotting/x11.c

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

2
src/frontend/subckt.c

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

2
src/frontend/variable.c

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

2
src/xspice/cmpp/mod_yacc.y

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

4
src/xspice/cmpp/pp_lst.c

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

2
src/xspice/cmpp/pp_mod.c

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

2
src/xspice/cmpp/writ_ifs.c

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

2
src/xspice/evt/evtdump.c

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

2
src/xspice/evt/evtplot.c

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

4
src/xspice/ipc/ipc.c

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

2
src/xspice/ipc/ipctiein.c

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

Loading…
Cancel
Save