(font_driver.c) silences the xcode warnings

This commit is contained in:
Twinaphex 2018-04-09 05:56:58 +02:00
parent 4db665130c
commit f2c23970a3

View File

@ -693,10 +693,10 @@ static INLINE unsigned font_get_replacement(const char* src, const char* start)
static char* font_driver_reshape_msg(const char* msg) static char* font_driver_reshape_msg(const char* msg)
{ {
/* worst case transformations are 2 bytes to 4 bytes */ /* worst case transformations are 2 bytes to 4 bytes */
char* buffer = (char*)malloc((strlen(msg) * 2) + 1); unsigned char* buffer = (unsigned char*)malloc((strlen(msg) * 2) + 1);
const char* src = msg; const unsigned char* src = (const unsigned char*)msg;
char* dst = buffer; unsigned char* dst = (unsigned char*)buffer;
bool reverse = false; bool reverse = false;
while (*src || reverse) while (*src || reverse)
{ {
@ -708,7 +708,7 @@ static char* font_driver_reshape_msg(const char* msg)
if (IS_RTL(src) || IS_DIR_NEUTRAL(src)) if (IS_RTL(src) || IS_DIR_NEUTRAL(src))
{ {
unsigned replacement = font_get_replacement(src, msg); unsigned replacement = font_get_replacement((const char*)src, msg);
if (replacement) if (replacement)
{ {
if (replacement < 0x80) if (replacement < 0x80)
@ -770,7 +770,7 @@ static char* font_driver_reshape_msg(const char* msg)
*dst = '\0'; *dst = '\0';
return buffer; return (char*)buffer;
} }
#endif #endif