Browse Source

use char variants of the <ctype.h> toxxxx() family

pre-master-46
rlar 10 years ago
parent
commit
726d0be34c
  1. 2
      src/ciderlib/input/meshset.c
  2. 2
      src/frontend/diff.c
  3. 4
      src/frontend/inpcom.c
  4. 4
      src/frontend/numparam/mystring.c
  5. 2
      src/frontend/numparam/xpressn.c
  6. 6
      src/frontend/subckt.c
  7. 2
      src/misc/dstring.c
  8. 16
      src/misc/string.c
  9. 2
      src/spicelib/parser/inpcfix.c
  10. 4
      src/spicelib/parser/inpgtok.c
  11. 2
      src/spicelib/parser/inppas2.c
  12. 2
      src/xspice/cmpp/mod_yacc.y
  13. 2
      src/xspice/cmpp/util.c
  14. 4
      src/xspice/icm/digital/d_source/cfunc.mod
  15. 4
      src/xspice/icm/digital/d_state/cfunc.mod
  16. 2
      src/xspice/ipc/ipctiein.c

2
src/ciderlib/input/meshset.c

@ -401,7 +401,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
/* Print info header. */ /* Print info header. */
#ifdef NOTDEF #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, "-------------------------\n" );
fprintf( stdout, " %3s %3s %3s %9s %9s %9s %9s %9s %9s\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" ); "n.s", "n.m", "n.e", "l.e", "h.s", "h.e", "h.m", "r.s", "r.e" );

2
src/frontend/diff.c

@ -35,7 +35,7 @@ cannonical_name(char *name, SPICE_DSTRINGPTR dbuf_p)
tmp++; tmp++;
for (ptr = tmp; *ptr; ptr++) for (ptr = tmp; *ptr; ptr++)
if (isupper_c(*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 else
tmp = spice_dstring_append_char(dbuf_p, *ptr); tmp = spice_dstring_append_char(dbuf_p, *ptr);
while (*tmp != ')') while (*tmp != ')')

4
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!) */ /* lower case for all lines (exceptions see above!) */
for (s = buffer; *s && (*s != '\n'); s++) for (s = buffer; *s && (*s != '\n'); s++)
*s = (char) tolower(*s);
*s = tolower_c(*s);
} else { } else {
/* exclude some commands to preserve filename case */ /* exclude some commands to preserve filename case */
for (s = buffer; *s && (*s != '\n'); s++) for (s = buffer; *s && (*s != '\n'); s++)
@ -1959,7 +1959,7 @@ inp_casefix(char *string)
if (!isspace_c(*string) && !isprint_c(*string)) if (!isspace_c(*string) && !isprint_c(*string))
*string = '_'; *string = '_';
if (isupper_c(*string)) if (isupper_c(*string))
*string = (char) tolower(*string);
*string = tolower_c(*string);
string++; string++;
} }
#endif #endif

4
src/frontend/numparam/mystring.c

@ -56,8 +56,8 @@ bool
ci_prefix(const char *p, const char *s) ci_prefix(const char *p, const char *s)
{ {
while (*p) { 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); return (0);
p++; p++;
s++; s++;

2
src/frontend/numparam/xpressn.c

@ -647,7 +647,7 @@ static double
parseunit(const char *s) parseunit(const char *s)
/* the Spice suffixes */ /* the Spice suffixes */
{ {
switch (toupper(s[0]))
switch (toupper_c(s[0]))
{ {
case 'T': return 1e12; case 'T': return 1e12;
case 'G': return 1e9; case 'G': return 1e9;

6
src/frontend/subckt.c

@ -1478,7 +1478,7 @@ numnodes(char *name, struct subs *subs, wordlist const *modnames)
c = *name; c = *name;
if (isupper_c(c)) if (isupper_c(c))
c = (char) tolower(c);
c = tolower_c(c);
(void) strncpy(buf, name, sizeof(buf)); (void) strncpy(buf, name, sizeof(buf));
s = buf; s = buf;
@ -1694,7 +1694,7 @@ devmodtranslate(struct line *s, char *subname, wordlist * const orig_modnames)
t++; t++;
c = *t; /* set c to first char in line. . . . */ c = *t; /* set c to first char in line. . . . */
if (isupper_c(c)) if (isupper_c(c))
c = (char) tolower(c);
c = tolower_c(c);
buffer = TMALLOC(char, strlen(t) + strlen(subname) + 4); buffer = TMALLOC(char, strlen(t) + strlen(subname) + 4);
@ -2050,7 +2050,7 @@ static int
inp_numnodes(char c) inp_numnodes(char c)
{ {
if (isupper_c(c)) if (isupper_c(c))
c = (char) tolower(c);
c = tolower_c(c);
switch (c) { switch (c) {
case ' ': case ' ':
case '\t': case '\t':

2
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; for( dst = dsPtr->string + dsPtr->length, end = string+length;
string < end; string++, dst++) { string < end; string++, dst++) {
if( isupper_c(*string) ) { if( isupper_c(*string) ) {
*dst = (char)tolower(*string) ;
*dst = tolower_c(*string) ;
} else { } else {
*dst = *string ; *dst = *string ;
} }

16
src/misc/string.c

@ -160,8 +160,8 @@ int
cieq(const char *p, const char *s) cieq(const char *p, const char *s)
{ {
while (*p) { 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); return(FALSE);
p++; p++;
s++; s++;
@ -175,8 +175,8 @@ int
ciprefix(const char *p, const char *s) ciprefix(const char *p, const char *s)
{ {
while (*p) { 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); return(FALSE);
p++; p++;
s++; s++;
@ -190,7 +190,7 @@ strtolower(char *str)
if (str) if (str)
while (*str) { while (*str) {
if(isupper_c(*str)) if(isupper_c(*str))
*str = (char) tolower(*str);
*str = tolower_c(*str);
str++; str++;
} }
} }
@ -201,7 +201,7 @@ strtoupper(char *str)
if (str) if (str)
while (*str) { while (*str) {
if(islower_c(*str)) if(islower_c(*str))
*str = (char) toupper(*str);
*str = toupper_c(*str);
str++; str++;
} }
} }
@ -228,7 +228,7 @@ register int n)
if (!p || !s) return( 0 ); if (!p || !s) return( 0 );
while (*p) { 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 ); return( 0 );
p++; p++;
s++; s++;
@ -255,7 +255,7 @@ register char *p, register char *s)
if (!p || !s) return( 0 ); if (!p || !s) return( 0 );
while (*p) { 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 ); return( n );
p++; p++;
s++; s++;

2
src/spicelib/parser/inpcfix.c

@ -17,7 +17,7 @@ void INPcaseFix(register char *string)
while (*string) { while (*string) {
if (isupper_c(*string)) { if (isupper_c(*string)) {
*string = (char) tolower(*string);
*string = tolower_c(*string);
} }
string++; string++;
} }

4
src/spicelib/parser/inpgtok.c

@ -94,7 +94,7 @@ INPgetTok(char **line, char **token, int gobble)
signstate = 3; signstate = 3;
else else
signstate = 1; signstate = 1;
} else if (tolower(*point) == 'e' && signstate == 1)
} else if (tolower_c(*point) == 'e' && signstate == 1)
signstate = 2; signstate = 2;
else else
signstate = 3; signstate = 3;
@ -305,7 +305,7 @@ INPgetUTok(char **line, char **token, int gobble)
signstate = 3; signstate = 3;
else else
signstate = 1; signstate = 1;
} else if (tolower(*point) == 'e' && signstate == 1)
} else if (tolower_c(*point) == 'e' && signstate == 1)
signstate = 2; signstate = 2;
else else
signstate = 3; signstate = 3;

2
src/spicelib/parser/inppas2.c

@ -89,7 +89,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task)
c = *(current->line); c = *(current->line);
if(islower_c(c)) if(islower_c(c))
c = (char) toupper(c);
c = toupper_c(c);
switch (c) { switch (c) {

2
src/xspice/cmpp/mod_yacc.y

@ -127,7 +127,7 @@ static int
local_strcmpi(char *s, char *t) local_strcmpi(char *s, char *t)
/* string compare - case insensitive */ /* 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) { if (*s && !*t) {
return 1; return 1;

2
src/xspice/cmpp/util.c

@ -87,7 +87,7 @@ void str_to_lower(char *s)
for(i = 0; (c = s[i]) != '\0'; i++) for(i = 0; (c = s[i]) != '\0'; i++)
if(isalpha_c(c)) if(isalpha_c(c))
if(isupper_c(c)) if(isupper_c(c))
s[i] = (char) tolower(c);
s[i] = tolower_c(c);
} }

4
src/xspice/icm/digital/d_source/cfunc.mod

@ -397,7 +397,7 @@ double *p_value ) /* OUT - The numerical value */
else { else {
if(isupper_c(c)) if(isupper_c(c))
c = (char) tolower(c);
c = tolower_c(c);
switch(c) { switch(c) {
@ -441,7 +441,7 @@ double *p_value ) /* OUT - The numerical value */
break; break;
} }
if(islower_c(c1)) if(islower_c(c1))
c1 = (char) toupper(c1);
c1 = toupper_c(c1);
if(c1 == 'E') if(c1 == 'E')
scale_factor = 1.0e6; scale_factor = 1.0e6;
else if(c1 == 'I') else if(c1 == 'I')

4
src/xspice/icm/digital/d_state/cfunc.mod

@ -439,7 +439,7 @@ double *p_value ) /* OUT - The numerical value */
else { else {
if(islower_c(c)) if(islower_c(c))
c = (char) tolower(c);
c = tolower_c(c);
switch(c) { switch(c) {
@ -483,7 +483,7 @@ double *p_value ) /* OUT - The numerical value */
break; break;
} }
if(islower_c(c1)) if(islower_c(c1))
c1 = (char) toupper(c1);
c1 = toupper_c(c1);
if(c1 == 'E') if(c1 == 'E')
scale_factor = 1.0e6; scale_factor = 1.0e6;
else if(c1 == 'I') else if(c1 == 'I')

2
src/xspice/ipc/ipctiein.c

@ -336,7 +336,7 @@ Ipc_Boolean_t ipc_screen_name(char *name, char *mapped_name)
} }
else { else {
if(islower_c(name[i])) if(islower_c(name[i]))
mapped_name[i] = (char) toupper(name[i]);
mapped_name[i] = toupper_c(name[i]);
else else
mapped_name[i] = name[i]; mapped_name[i] = name[i];
} }

Loading…
Cancel
Save