[F] Fixed compilation problems

This commit is contained in:
seleznevae 2019-08-26 12:33:17 +03:00
parent a30f674114
commit 051b3145f7
4 changed files with 18 additions and 18 deletions

View File

@ -3151,7 +3151,7 @@ clear:
const char *ft_to_string(const ft_table_t *table)
{
return ft_to_string_impl(table, CHAR_BUF);
return (const char *)ft_to_string_impl(table, CHAR_BUF);
}
#ifdef FT_HAVE_WCHAR
@ -3627,9 +3627,9 @@ FT_INTERNAL
size_t number_of_columns_in_format_u8string(const void *fmt)
{
size_t separator_counter = 0;
const char *pos = fmt;
const char *pos = (const char *)fmt;
while (1) {
pos = utf8chr(pos, g_col_separator);
pos = (const char *)utf8chr(pos, g_col_separator);
if (pos == NULL)
break;
@ -3789,8 +3789,8 @@ int ft_nwprint(conv_context_t *cntx, const wchar_t *str, size_t strlen)
FT_INTERNAL
int ft_nu8print(conv_context_t *cntx, const void *beg, const void *end)
{
const char *bc = beg;
const char *ec = end;
const char *bc = (const char *)beg;
const char *ec = (const char *)end;
size_t raw_len = ec - bc;
if (cntx->raw_avail + 1 < raw_len)
return -1;
@ -6024,16 +6024,16 @@ void wstr_n_substring(const wchar_t *str, wchar_t ch_separator, size_t n, const
FT_INTERNAL
void utf8_n_substring(const void *str, utf8_int32_t ch_separator, size_t n, const void **begin, const void **end)
{
const char *beg = utf8_n_substring_beg(str, ch_separator, n);
const char *beg = (const char *)utf8_n_substring_beg(str, ch_separator, n);
if (beg == NULL) {
*begin = NULL;
*end = NULL;
return;
}
const char *en = utf8chr(beg, ch_separator);
const char *en = (const char *)utf8chr(beg, ch_separator);
if (en == NULL) {
en = (const char *)str + strlen(str);
en = (const char *)str + strlen((const char *)str);
}
*begin = beg;
@ -6219,7 +6219,7 @@ FT_INTERNAL
size_t ut8_width(const void *beg, const void *end)
{
size_t sz = (size_t)((const char *)end - (const char *)beg);
char *tmp = F_MALLOC(sizeof(char) * (sz + 1));
char *tmp = (char *)F_MALLOC(sizeof(char) * (sz + 1));
// @todo: add check to tmp
assert(tmp);

View File

@ -697,7 +697,7 @@ clear:
const char *ft_to_string(const ft_table_t *table)
{
return ft_to_string_impl(table, CHAR_BUF);
return (const char *)ft_to_string_impl(table, CHAR_BUF);
}
#ifdef FT_HAVE_WCHAR

View File

@ -179,9 +179,9 @@ FT_INTERNAL
size_t number_of_columns_in_format_u8string(const void *fmt)
{
size_t separator_counter = 0;
const char *pos = fmt;
const char *pos = (const char *)fmt;
while (1) {
pos = utf8chr(pos, g_col_separator);
pos = (const char *)utf8chr(pos, g_col_separator);
if (pos == NULL)
break;
@ -341,8 +341,8 @@ int ft_nwprint(conv_context_t *cntx, const wchar_t *str, size_t strlen)
FT_INTERNAL
int ft_nu8print(conv_context_t *cntx, const void *beg, const void *end)
{
const char *bc = beg;
const char *ec = end;
const char *bc = (const char *)beg;
const char *ec = (const char *)end;
size_t raw_len = ec - bc;
if (cntx->raw_avail + 1 < raw_len)
return -1;

View File

@ -226,16 +226,16 @@ void wstr_n_substring(const wchar_t *str, wchar_t ch_separator, size_t n, const
FT_INTERNAL
void utf8_n_substring(const void *str, utf8_int32_t ch_separator, size_t n, const void **begin, const void **end)
{
const char *beg = utf8_n_substring_beg(str, ch_separator, n);
const char *beg = (const char *)utf8_n_substring_beg(str, ch_separator, n);
if (beg == NULL) {
*begin = NULL;
*end = NULL;
return;
}
const char *en = utf8chr(beg, ch_separator);
const char *en = (const char *)utf8chr(beg, ch_separator);
if (en == NULL) {
en = (const char *)str + strlen(str);
en = (const char *)str + strlen((const char *)str);
}
*begin = beg;
@ -421,7 +421,7 @@ FT_INTERNAL
size_t ut8_width(const void *beg, const void *end)
{
size_t sz = (size_t)((const char *)end - (const char *)beg);
char *tmp = F_MALLOC(sizeof(char) * (sz + 1));
char *tmp = (char *)F_MALLOC(sizeof(char) * (sz + 1));
// @todo: add check to tmp
assert(tmp);