sadly the C language does not specify any such implicit conversion, so this is not a matter of just fixing warnings (as gcc treats it) but actual errors. i would like to revisit a number of these changes and possibly revise the types used to reduce the number of casts required.
9 lines
251 B
C
9 lines
251 B
C
#include <strings.h>
|
|
#include <ctype.h>
|
|
|
|
int strcasecmp(const char *_l, const char *_r)
|
|
{
|
|
const unsigned char *l=(void *)_l, *r=(void *)_r;
|
|
for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
|
|
return tolower(*l) - tolower(*r);
|
|
}
|