From 4845bba54c7254cb824c5beb01a2ca2dd988e254 Mon Sep 17 00:00:00 2001 From: seleznevae Date: Sun, 25 Aug 2019 10:18:41 +0300 Subject: [PATCH] [F] Fixed compilation errors --- lib/fort.c | 9 +++++---- src/fort_utils.c | 4 +++- src/string_buffer.c | 5 ++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/fort.c b/lib/fort.c index 570d784..124714e 100644 --- a/lib/fort.c +++ b/lib/fort.c @@ -3662,7 +3662,9 @@ int print_n_strings(conv_context_t *cntx, size_t n, const char *str) switch (cntx->b_type) { case CHAR_BUF: - return snprint_n_strings(cntx, n, str); + raw_written = snprint_n_strings(cntx, n, str); + cod_w = raw_written; + return cod_w; #ifdef FT_HAVE_WCHAR case W_CHAR_BUF: cod_w = wsnprint_n_string(cntx->u.wbuf, cntx->raw_avail, n, str); @@ -6248,7 +6250,7 @@ buffer_substring(const string_buffer_t *buffer, size_t buffer_row, const void ** #endif /* FT_HAVE_WCHAR */ #ifdef FT_HAVE_UTF8 case UTF8_BUF: - utf8_n_substring(buffer->str.wstr, '\n', buffer_row, begin, end); + utf8_n_substring(buffer->str.u8str, '\n', buffer_row, begin, end); if ((*(const char **)begin) && (*(const char **)end)) *str_it_width = ut8_width(*begin, *end); break; @@ -6380,14 +6382,13 @@ int buffer_check_align(string_buffer_t *buffer) { assert(buffer); assert(buffer->str.data); - void *p = buffer->str.data; switch (buffer->type) { case CHAR_BUF: return 1; #ifdef FT_HAVE_WCHAR case W_CHAR_BUF: - return (((unsigned long)p) & (sizeof(wchar_t) - 1)) == 0; + return (((unsigned long)buffer->str.data) & (sizeof(wchar_t) - 1)) == 0; #endif #ifdef FT_HAVE_UTF8 case UTF8_BUF: diff --git a/src/fort_utils.c b/src/fort_utils.c index c5bf74b..b04b301 100644 --- a/src/fort_utils.c +++ b/src/fort_utils.c @@ -252,7 +252,9 @@ int print_n_strings(conv_context_t *cntx, size_t n, const char *str) switch (cntx->b_type) { case CHAR_BUF: - return snprint_n_strings(cntx, n, str); + raw_written = snprint_n_strings(cntx, n, str); + cod_w = raw_written; + return cod_w; #ifdef FT_HAVE_WCHAR case W_CHAR_BUF: cod_w = wsnprint_n_string(cntx->u.wbuf, cntx->raw_avail, n, str); diff --git a/src/string_buffer.c b/src/string_buffer.c index df6faee..87ae61b 100644 --- a/src/string_buffer.c +++ b/src/string_buffer.c @@ -505,7 +505,7 @@ buffer_substring(const string_buffer_t *buffer, size_t buffer_row, const void ** #endif /* FT_HAVE_WCHAR */ #ifdef FT_HAVE_UTF8 case UTF8_BUF: - utf8_n_substring(buffer->str.wstr, '\n', buffer_row, begin, end); + utf8_n_substring(buffer->str.u8str, '\n', buffer_row, begin, end); if ((*(const char **)begin) && (*(const char **)end)) *str_it_width = ut8_width(*begin, *end); break; @@ -637,14 +637,13 @@ int buffer_check_align(string_buffer_t *buffer) { assert(buffer); assert(buffer->str.data); - void *p = buffer->str.data; switch (buffer->type) { case CHAR_BUF: return 1; #ifdef FT_HAVE_WCHAR case W_CHAR_BUF: - return (((unsigned long)p) & (sizeof(wchar_t) - 1)) == 0; + return (((unsigned long)buffer->str.data) & (sizeof(wchar_t) - 1)) == 0; #endif #ifdef FT_HAVE_UTF8 case UTF8_BUF: