Hi, while looking at the string.h coming with the c6000_7.4.2 compiler tools I came across the following string comparison function:
/********************************************************************************/
int strcmp ( register const char * string1 , register const char * string2 )
{
register int c1, res;
for (;;)
{
c1 = (unsigned char)*string1++;
res = c1 - (unsigned char)*string2++;
if (c1 == 0 || res != 0) break;
}
return res;
}
/********************************************************************************/
Could someone explain why are the (unsigned char) casts necessary ?!
Thanks a lot,
Todor