This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

String comparison on C64x+

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