From 726d0be34ce4311a4568989eb8ebdf38f3ea30a5 Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 8 Mar 2016 21:24:40 +0100 Subject: [PATCH] use char variants of the toxxxx() family --- src/ciderlib/input/meshset.c | 2 +- src/frontend/diff.c | 2 +- src/frontend/inpcom.c | 4 ++-- src/frontend/numparam/mystring.c | 4 ++-- src/frontend/numparam/xpressn.c | 2 +- src/frontend/subckt.c | 6 +++--- src/misc/dstring.c | 2 +- src/misc/string.c | 16 ++++++++-------- src/spicelib/parser/inpcfix.c | 2 +- src/spicelib/parser/inpgtok.c | 4 ++-- src/spicelib/parser/inppas2.c | 2 +- src/xspice/cmpp/mod_yacc.y | 2 +- src/xspice/cmpp/util.c | 2 +- src/xspice/icm/digital/d_source/cfunc.mod | 4 ++-- src/xspice/icm/digital/d_state/cfunc.mod | 4 ++-- src/xspice/ipc/ipctiein.c | 2 +- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/ciderlib/input/meshset.c b/src/ciderlib/input/meshset.c index e81875419..8d9465ba9 100644 --- a/src/ciderlib/input/meshset.c +++ b/src/ciderlib/input/meshset.c @@ -401,7 +401,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords) /* Print info header. */ #ifdef NOTDEF - fprintf( stdout, " %c.Mesh Card Information\n", toupper(dim) ); + fprintf( stdout, " %c.Mesh Card Information\n", toupper_c(dim) ); fprintf( stdout, "-------------------------\n" ); fprintf( stdout, " %3s %3s %3s %9s %9s %9s %9s %9s %9s\n", "n.s", "n.m", "n.e", "l.e", "h.s", "h.e", "h.m", "r.s", "r.e" ); diff --git a/src/frontend/diff.c b/src/frontend/diff.c index 9f21c9dd8..f9ba13f9a 100644 --- a/src/frontend/diff.c +++ b/src/frontend/diff.c @@ -35,7 +35,7 @@ cannonical_name(char *name, SPICE_DSTRINGPTR dbuf_p) tmp++; for (ptr = tmp; *ptr; ptr++) if (isupper_c(*ptr)) - tmp = spice_dstring_append_char(dbuf_p, (char)tolower(*ptr)); + tmp = spice_dstring_append_char(dbuf_p, tolower_c(*ptr)); else tmp = spice_dstring_append_char(dbuf_p, *ptr); while (*tmp != ')') diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 27bfbbb81..123216bfb 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -848,7 +848,7 @@ inp_read(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile) { /* lower case for all lines (exceptions see above!) */ for (s = buffer; *s && (*s != '\n'); s++) - *s = (char) tolower(*s); + *s = tolower_c(*s); } else { /* exclude some commands to preserve filename case */ for (s = buffer; *s && (*s != '\n'); s++) @@ -1959,7 +1959,7 @@ inp_casefix(char *string) if (!isspace_c(*string) && !isprint_c(*string)) *string = '_'; if (isupper_c(*string)) - *string = (char) tolower(*string); + *string = tolower_c(*string); string++; } #endif diff --git a/src/frontend/numparam/mystring.c b/src/frontend/numparam/mystring.c index eac79c91e..0266362b0 100644 --- a/src/frontend/numparam/mystring.c +++ b/src/frontend/numparam/mystring.c @@ -56,8 +56,8 @@ bool ci_prefix(const char *p, const char *s) { while (*p) { - if ((isupper_c(*p) ? tolower(*p) : *p) != - (isupper_c(*s) ? tolower(*s) : *s)) + if ((isupper_c(*p) ? tolower_c(*p) : *p) != + (isupper_c(*s) ? tolower_c(*s) : *s)) return (0); p++; s++; diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index d19905e9a..1ec587c8b 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -647,7 +647,7 @@ static double parseunit(const char *s) /* the Spice suffixes */ { - switch (toupper(s[0])) + switch (toupper_c(s[0])) { case 'T': return 1e12; case 'G': return 1e9; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 87fcb0cd9..a352f5d31 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1478,7 +1478,7 @@ numnodes(char *name, struct subs *subs, wordlist const *modnames) c = *name; if (isupper_c(c)) - c = (char) tolower(c); + c = tolower_c(c); (void) strncpy(buf, name, sizeof(buf)); s = buf; @@ -1694,7 +1694,7 @@ devmodtranslate(struct line *s, char *subname, wordlist * const orig_modnames) t++; c = *t; /* set c to first char in line. . . . */ if (isupper_c(c)) - c = (char) tolower(c); + c = tolower_c(c); buffer = TMALLOC(char, strlen(t) + strlen(subname) + 4); @@ -2050,7 +2050,7 @@ static int inp_numnodes(char c) { if (isupper_c(c)) - c = (char) tolower(c); + c = tolower_c(c); switch (c) { case ' ': case '\t': diff --git a/src/misc/dstring.c b/src/misc/dstring.c index 43b27d5bd..65c0c37d3 100644 --- a/src/misc/dstring.c +++ b/src/misc/dstring.c @@ -158,7 +158,7 @@ char *spice_dstring_append_lower(SPICE_DSTRINGPTR dsPtr, const char *string, int for( dst = dsPtr->string + dsPtr->length, end = string+length; string < end; string++, dst++) { if( isupper_c(*string) ) { - *dst = (char)tolower(*string) ; + *dst = tolower_c(*string) ; } else { *dst = *string ; } diff --git a/src/misc/string.c b/src/misc/string.c index 93090e526..8da33d5d8 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -160,8 +160,8 @@ int cieq(const char *p, const char *s) { while (*p) { - if ((isupper_c(*p) ? tolower(*p) : *p) != - (isupper_c(*s) ? tolower(*s) : *s)) + if ((isupper_c(*p) ? tolower_c(*p) : *p) != + (isupper_c(*s) ? tolower_c(*s) : *s)) return(FALSE); p++; s++; @@ -175,8 +175,8 @@ int ciprefix(const char *p, const char *s) { while (*p) { - if ((isupper_c(*p) ? tolower(*p) : *p) != - (isupper_c(*s) ? tolower(*s) : *s)) + if ((isupper_c(*p) ? tolower_c(*p) : *p) != + (isupper_c(*s) ? tolower_c(*s) : *s)) return(FALSE); p++; s++; @@ -190,7 +190,7 @@ strtolower(char *str) if (str) while (*str) { if(isupper_c(*str)) - *str = (char) tolower(*str); + *str = tolower_c(*str); str++; } } @@ -201,7 +201,7 @@ strtoupper(char *str) if (str) while (*str) { if(islower_c(*str)) - *str = (char) toupper(*str); + *str = toupper_c(*str); str++; } } @@ -228,7 +228,7 @@ register int n) if (!p || !s) return( 0 ); while (*p) { - if ((isupper_c(*p) ? tolower(*p) : *p) != (isupper_c(*s) ? tolower(*s) : *s)) + if ((isupper_c(*p) ? tolower_c(*p) : *p) != (isupper_c(*s) ? tolower_c(*s) : *s)) return( 0 ); p++; s++; @@ -255,7 +255,7 @@ register char *p, register char *s) if (!p || !s) return( 0 ); while (*p) { - if ((isupper_c(*p) ? tolower(*p) : *p) != (isupper_c(*s) ? tolower(*s) : *s)) + if ((isupper_c(*p) ? tolower_c(*p) : *p) != (isupper_c(*s) ? tolower_c(*s) : *s)) return( n ); p++; s++; diff --git a/src/spicelib/parser/inpcfix.c b/src/spicelib/parser/inpcfix.c index f14aec619..ba0db3d0b 100644 --- a/src/spicelib/parser/inpcfix.c +++ b/src/spicelib/parser/inpcfix.c @@ -17,7 +17,7 @@ void INPcaseFix(register char *string) while (*string) { if (isupper_c(*string)) { - *string = (char) tolower(*string); + *string = tolower_c(*string); } string++; } diff --git a/src/spicelib/parser/inpgtok.c b/src/spicelib/parser/inpgtok.c index eccdee1c7..385c287fd 100644 --- a/src/spicelib/parser/inpgtok.c +++ b/src/spicelib/parser/inpgtok.c @@ -94,7 +94,7 @@ INPgetTok(char **line, char **token, int gobble) signstate = 3; else signstate = 1; - } else if (tolower(*point) == 'e' && signstate == 1) + } else if (tolower_c(*point) == 'e' && signstate == 1) signstate = 2; else signstate = 3; @@ -305,7 +305,7 @@ INPgetUTok(char **line, char **token, int gobble) signstate = 3; else signstate = 1; - } else if (tolower(*point) == 'e' && signstate == 1) + } else if (tolower_c(*point) == 'e' && signstate == 1) signstate = 2; else signstate = 3; diff --git a/src/spicelib/parser/inppas2.c b/src/spicelib/parser/inppas2.c index 59e25c399..505603a3a 100644 --- a/src/spicelib/parser/inppas2.c +++ b/src/spicelib/parser/inppas2.c @@ -89,7 +89,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) c = *(current->line); if(islower_c(c)) - c = (char) toupper(c); + c = toupper_c(c); switch (c) { diff --git a/src/xspice/cmpp/mod_yacc.y b/src/xspice/cmpp/mod_yacc.y index 0db013fd9..cd7da266c 100644 --- a/src/xspice/cmpp/mod_yacc.y +++ b/src/xspice/cmpp/mod_yacc.y @@ -127,7 +127,7 @@ static int local_strcmpi(char *s, char *t) /* string compare - case insensitive */ { - for (; *s && t && tolower(*s) == tolower(*t); s++, t++) + for (; *s && t && tolower_c(*s) == tolower_c(*t); s++, t++) ; if (*s && !*t) { return 1; diff --git a/src/xspice/cmpp/util.c b/src/xspice/cmpp/util.c index 7168bc3fc..1a0a0ef5a 100644 --- a/src/xspice/cmpp/util.c +++ b/src/xspice/cmpp/util.c @@ -87,7 +87,7 @@ void str_to_lower(char *s) for(i = 0; (c = s[i]) != '\0'; i++) if(isalpha_c(c)) if(isupper_c(c)) - s[i] = (char) tolower(c); + s[i] = tolower_c(c); } diff --git a/src/xspice/icm/digital/d_source/cfunc.mod b/src/xspice/icm/digital/d_source/cfunc.mod index 8219d8961..e00710211 100644 --- a/src/xspice/icm/digital/d_source/cfunc.mod +++ b/src/xspice/icm/digital/d_source/cfunc.mod @@ -397,7 +397,7 @@ double *p_value ) /* OUT - The numerical value */ else { if(isupper_c(c)) - c = (char) tolower(c); + c = tolower_c(c); switch(c) { @@ -441,7 +441,7 @@ double *p_value ) /* OUT - The numerical value */ break; } if(islower_c(c1)) - c1 = (char) toupper(c1); + c1 = toupper_c(c1); if(c1 == 'E') scale_factor = 1.0e6; else if(c1 == 'I') diff --git a/src/xspice/icm/digital/d_state/cfunc.mod b/src/xspice/icm/digital/d_state/cfunc.mod index 80bbe1faa..00a0b5e4f 100644 --- a/src/xspice/icm/digital/d_state/cfunc.mod +++ b/src/xspice/icm/digital/d_state/cfunc.mod @@ -439,7 +439,7 @@ double *p_value ) /* OUT - The numerical value */ else { if(islower_c(c)) - c = (char) tolower(c); + c = tolower_c(c); switch(c) { @@ -483,7 +483,7 @@ double *p_value ) /* OUT - The numerical value */ break; } if(islower_c(c1)) - c1 = (char) toupper(c1); + c1 = toupper_c(c1); if(c1 == 'E') scale_factor = 1.0e6; else if(c1 == 'I') diff --git a/src/xspice/ipc/ipctiein.c b/src/xspice/ipc/ipctiein.c index 5e5fdacf3..7b833a527 100644 --- a/src/xspice/ipc/ipctiein.c +++ b/src/xspice/ipc/ipctiein.c @@ -336,7 +336,7 @@ Ipc_Boolean_t ipc_screen_name(char *name, char *mapped_name) } else { if(islower_c(name[i])) - mapped_name[i] = (char) toupper(name[i]); + mapped_name[i] = toupper_c(name[i]); else mapped_name[i] = name[i]; }