diff --git a/ChangeLog b/ChangeLog index 65a30f413..09e59e953 100644 --- a/ChangeLog +++ b/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 * src/ciderlib/oned/oneprint.c , * src/ciderlib/support/database.c , diff --git a/src/frontend/com_history.c b/src/frontend/com_history.c index 263e6e44f..c7f7c3d30 100644 --- a/src/frontend/com_history.c +++ b/src/frontend/com_history.c @@ -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++) diff --git a/src/frontend/com_measure2.c b/src/frontend/com_measure2.c index 0817578be..c9152bd37 100644 --- a/src/frontend/com_measure2.c +++ b/src/frontend/com_measure2.c @@ -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 diff --git a/src/frontend/fourier.c b/src/frontend/fourier.c index 93a564176..6afe537b5 100644 --- a/src/frontend/fourier.c +++ b/src/frontend/fourier.c @@ -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; diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 151dcaafe..8577bdafc 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -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) ; diff --git a/src/frontend/parser/backq.c b/src/frontend/parser/backq.c index 823314542..1920b30b0 100644 --- a/src/frontend/parser/backq.c +++ b/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. */ (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); diff --git a/src/frontend/parser/complete.c b/src/frontend/parser/complete.c index c71c11590..26fb9478b 100644 --- a/src/frontend/parser/complete.c +++ b/src/frontend/parser/complete.c @@ -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; } diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 93b896795..eabd71225 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -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; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 8a7c6568e..1f932c1b5 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -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++; diff --git a/src/frontend/variable.c b/src/frontend/variable.c index 15901e839..3abbdcd3f 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -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); diff --git a/src/xspice/cmpp/mod_yacc.y b/src/xspice/cmpp/mod_yacc.y index 59b8cd022..8cc748344 100755 --- a/src/xspice/cmpp/mod_yacc.y +++ b/src/xspice/cmpp/mod_yacc.y @@ -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); diff --git a/src/xspice/cmpp/pp_lst.c b/src/xspice/cmpp/pp_lst.c index c9551046b..0b59e5d2b 100755 --- a/src/xspice/cmpp/pp_lst.c +++ b/src/xspice/cmpp/pp_lst.c @@ -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) { diff --git a/src/xspice/cmpp/pp_mod.c b/src/xspice/cmpp/pp_mod.c index cd83231d5..1019ed7a1 100755 --- a/src/xspice/cmpp/pp_mod.c +++ b/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) { - int i = strlen (filename); + int i = (int) strlen (filename); strcpy (new_filename, filename); diff --git a/src/xspice/cmpp/writ_ifs.c b/src/xspice/cmpp/writ_ifs.c index 94fcd8c86..3e444846c 100755 --- a/src/xspice/cmpp/writ_ifs.c +++ b/src/xspice/cmpp/writ_ifs.c @@ -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; diff --git a/src/xspice/evt/evtdump.c b/src/xspice/evt/evtdump.c index e4c431e69..15a676277 100755 --- a/src/xspice/evt/evtdump.c +++ b/src/xspice/evt/evtdump.c @@ -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; diff --git a/src/xspice/evt/evtplot.c b/src/xspice/evt/evtplot.c index 18e0749dc..24f73e399 100755 --- a/src/xspice/evt/evtplot.c +++ b/src/xspice/evt/evtplot.c @@ -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]); diff --git a/src/xspice/ipc/ipc.c b/src/xspice/ipc/ipc.c index a432f8ee2..d408bb49e 100755 --- a/src/xspice/ipc/ipc.c +++ b/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; - 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; diff --git a/src/xspice/ipc/ipctiein.c b/src/xspice/ipc/ipctiein.c index 18ffb661f..9e223c048 100755 --- a/src/xspice/ipc/ipctiein.c +++ b/src/xspice/ipc/ipctiein.c @@ -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++)