Stupid vxWorks implementation of toupper/tolower expands macro argument more than once!

This commit is contained in:
W. Eric Norum
2004-02-03 16:49:33 +00:00
parent 0da4a9df30
commit 585e2f7d6c

View File

@@ -93,12 +93,15 @@ epicsShareFunc int epicsShareAPI epicsStrCaseCmp(
int nexts1,nexts2;
while(1) {
nexts1 = toupper(*s1++);
nexts2 = toupper(*s2++);
/* vxWorks implementation expands argument more than once!!! */
nexts1 = toupper(*s1);
nexts2 = toupper(*s2);
if(nexts1==0) return( (nexts2==0) ? 0 : 1 );
if(nexts2==0) return(-1);
if(nexts1<nexts2) return(-1);
if(nexts1>nexts2) return(1);
s1++;
s2++;
}
return(0);
}
@@ -111,12 +114,15 @@ epicsShareFunc int epicsShareAPI epicsStrnCaseCmp(
while(1) {
if(ind++ >= n) break;
nexts1 = toupper(*s1++);
nexts2 = toupper(*s2++);
/* vxWorks implementation expands argument more than once!!! */
nexts1 = toupper(*s1);
nexts2 = toupper(*s2);
if(nexts1==0) return( (nexts2==0) ? 0 : 1 );
if(nexts2==0) return(-1);
if(nexts1<nexts2) return(-1);
if(nexts1>nexts2) return(1);
s1++;
s2++;
}
return(0);
}