You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
433 B
C
19 lines
433 B
C
#include "case.h"
|
|
|
|
int case_diffb(register const char *s,register unsigned int len,register const char *t)
|
|
{
|
|
register unsigned char x;
|
|
register unsigned char y;
|
|
|
|
while (len > 0) {
|
|
--len;
|
|
x = *s++ - 'A';
|
|
if (x <= 'Z' - 'A') x += 'a'; else x += 'A';
|
|
y = *t++ - 'A';
|
|
if (y <= 'Z' - 'A') y += 'a'; else y += 'A';
|
|
if (x != y)
|
|
return ((int)(unsigned int) x) - ((int)(unsigned int) y);
|
|
}
|
|
return 0;
|
|
}
|