Fix build (-Werror) on platforms where char is unsigned. The problem could be easily verified by building with -funsigned-char. This was developed and tested on OpenBSD with oRTP 0.22. --- src/b64.c.orig Sun Dec 8 23:52:27 2013 +++ src/b64.c Mon Dec 9 00:03:52 2013 @@ -181,7 +181,7 @@ static size_t b64_encode_( unsigned char const *src for(; NUM_PLAIN_DATA_BYTES <= srcSize; srcSize -= NUM_PLAIN_DATA_BYTES) { - char characters[NUM_ENCODED_DATA_BYTES]; + unsigned char characters[NUM_ENCODED_DATA_BYTES]; /* * @@ -197,38 +197,38 @@ static size_t b64_encode_( unsigned char const *src */ /* characters[0] is the 6 left-most bits of src[0] */ - characters[0] = (char)((src[0] & 0xfc) >> 2); + characters[0] = ((src[0] & 0xfc) >> 2); /* characters[0] is the right-most 2 bits of src[0] and the left-most 4 bits of src[1] */ - characters[1] = (char)(((src[0] & 0x03) << 4) + ((src[1] & 0xf0) >> 4)); + characters[1] = (((src[0] & 0x03) << 4) + ((src[1] & 0xf0) >> 4)); /* characters[0] is the right-most 4 bits of src[1] and the 2 left-most bits of src[2] */ - characters[2] = (char)(((src[1] & 0x0f) << 2) + ((src[2] & 0xc0) >> 6)); + characters[2] = (((src[1] & 0x0f) << 2) + ((src[2] & 0xc0) >> 6)); /* characters[3] is the right-most 6 bits of src[2] */ - characters[3] = (char)(src[2] & 0x3f); + characters[3] = (src[2] & 0x3f); #ifndef __WATCOMC__ - assert(characters[0] >= 0 && characters[0] < 64); - assert(characters[1] >= 0 && characters[1] < 64); - assert(characters[2] >= 0 && characters[2] < 64); - assert(characters[3] >= 0 && characters[3] < 64); + assert(characters[0] < 64); + assert(characters[1] < 64); + assert(characters[2] < 64); + assert(characters[3] < 64); #endif /* __WATCOMC__ */ src += NUM_PLAIN_DATA_BYTES; - *p++ = b64_chars[(unsigned char)characters[0]]; + *p++ = b64_chars[characters[0]]; assert(NULL != strchr(b64_chars, *(p-1))); ++len; assert(len != lineLen); - *p++ = b64_chars[(unsigned char)characters[1]]; + *p++ = b64_chars[characters[1]]; assert(NULL != strchr(b64_chars, *(p-1))); ++len; assert(len != lineLen); - *p++ = b64_chars[(unsigned char)characters[2]]; + *p++ = b64_chars[characters[2]]; assert(NULL != strchr(b64_chars, *(p-1))); ++len; assert(len != lineLen); - *p++ = b64_chars[(unsigned char)characters[3]]; + *p++ = b64_chars[characters[3]]; assert(NULL != strchr(b64_chars, *(p-1))); if( ++len == lineLen &&