diff --git a/src/frontend/numparam/general.h b/src/frontend/numparam/general.h index 0528e34aa..1882c5770 100644 --- a/src/frontend/numparam/general.h +++ b/src/frontend/numparam/general.h @@ -27,7 +27,6 @@ void cins(SPICE_DSTRINGPTR s, char c); void sins(SPICE_DSTRINGPTR s, const char *t); int spos_(char *sub, const char *s); bool ci_prefix(const char *p, const char *s); -int length(const char *s); bool steq(const char *s, const char *t); bool stne(const char *s, const char *t); void stri(long n, SPICE_DSTRINGPTR s); diff --git a/src/frontend/numparam/mystring.c b/src/frontend/numparam/mystring.c index a0786c084..ec2b490c5 100644 --- a/src/frontend/numparam/mystring.c +++ b/src/frontend/numparam/mystring.c @@ -82,13 +82,6 @@ ci_prefix(const char *p, const char *s) * string we cannot have a string overflow. */ -int -length(const char *s) -{ - return (int) strlen(s); -} - - /* ----------------------------------------------------------------- * Function: add string t to dynamic string dstr_p. * ----------------------------------------------------------------- */ @@ -143,7 +136,7 @@ sins(SPICE_DSTRINGPTR dstr_p, const char *t) char *s_p; ls = spice_dstring_length(dstr_p); - lt = length(t); + lt = (int) strlen(t); spice_dstring_setlength(dstr_p, ls+lt+1); /* make sure we have space for string + EOS */ s_p = spice_dstring_value(dstr_p); for (i = ls + 1; i >= 0; i--) @@ -249,7 +242,7 @@ pscopy(SPICE_DSTRINGPTR dstr_p, const char *t, int start, int leng) int stop; /* stop value */ char *s_p; /* value of dynamic string */ - stop = length(t); + stop = (int) strlen(t); if (start < stop) { /* nothing! */ @@ -284,7 +277,7 @@ pscopy_up(SPICE_DSTRINGPTR dstr_p, const char *t, int start, int leng) int stop; /* stop value */ char *s_p; /* value of dynamic string */ - stop = length(t); + stop = (int) strlen(t); if (start < stop) { /* nothing! */ diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 9ff1f4688..409e1c064 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -751,7 +751,7 @@ nupa_copy(struct card *deck) spice_dstring_init(&u); spice_dstring_init(&keywd); - ls = length(s); + ls = (int) strlen(s); while ((ls > 0) && (s[ls - 1] <= ' ')) ls--; diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 5cdddcf45..0cfeaf9f7 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -520,7 +520,7 @@ defsubckt(dico_t *dico, struct card *card, nupa_type categ) bool err; int i, j, ls; - ls = length(s); + ls = (int) strlen(s); i = 0; while ((i < ls) && (s[i] != '.')) @@ -563,7 +563,7 @@ findsubckt(dico_t *dico, char *s) spice_dstring_init(&ustr); - k = length(s); + k = (int) strlen(s); while ((k >= 0) && (s[k] <= ' ')) k--; @@ -1208,7 +1208,7 @@ nupa_substitute(dico_t *dico, char *s, char *r, bool err) spice_dstring_init(&qstr); spice_dstring_init(&tstr); i = 0; - ls = length(s); + ls = (int) strlen(s); err = 0; ir = 0; @@ -1334,7 +1334,7 @@ getword(char *s, SPICE_DSTRINGPTR tstr_p, int after, int *pi) int ls; i = after; - ls = length(s); + ls = (int) strlen(s); do i++; @@ -1363,7 +1363,7 @@ getexpress(char *s, SPICE_DSTRINGPTR tstr_p, int *pi) char c, d; nupa_type tpe; - ls = length(s); + ls = (int) strlen(s); ia = i + 1; while ((ia < ls) && (s[ia - 1] <= ' ')) @@ -1458,7 +1458,7 @@ nupa_assignment(dico_t *dico, char *s, char mode) spice_dstring_init(&tstr); spice_dstring_init(&ustr); - ls = length(s); + ls = (int) strlen(s); error = 0; i = 0; @@ -1552,7 +1552,7 @@ nupa_subcktcall(dico_t *dico, char *s, char *x, char *inst_name) /***** first, analyze the subckt definition line */ n = 0; /* number of parameters if any */ - ls = length(s); + ls = (int) strlen(s); scopy_up(&tstr, s);