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

This commit is contained in:
rlar 2016-03-08 21:24:40 +01:00
parent 71a7c3459b
commit 726d0be34c
16 changed files with 30 additions and 30 deletions

View File

@ -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" );

View File

@ -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 != ')')

View File

@ -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

View File

@ -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++;

View File

@ -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;

View File

@ -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':

View File

@ -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 ;
}

View File

@ -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++;

View File

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

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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);
}

View File

@ -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')

View File

@ -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')

View File

@ -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];
}