[F] Fixed compiler warnings

This commit is contained in:
seleznevae
2018-07-29 11:24:05 +03:00
parent 0c8a8793a0
commit 087ad4e10b
4 changed files with 17 additions and 13 deletions

View File

@@ -313,6 +313,8 @@ int print_row_separator(char *buffer, size_t buffer_sz,
}
}
size_t i = 0;
/* If all chars are not printable, skip line separator */ /* todo: add processing for wchar_t */
// if (!isprint(*L) && !isprint(*I) && !isprint(*IV) && !isprint(*R)) {
// status = 0;
@@ -326,8 +328,6 @@ int print_row_separator(char *buffer, size_t buffer_sz,
goto clear;
}
size_t i = 0;
/* Print left margin */
CHCK_RSLT_ADD_TO_WRITTEN(snprint_n_strings_(buffer + written, buffer_sz - written, context->table_options->entire_table_options.left_margin, space_char));
@@ -486,6 +486,8 @@ int wprint_row_separator(wchar_t *buffer, size_t buffer_sz,
}
}
size_t i = 0;
/* If all chars are not printable, skip line separator */ /* todo: add processing for wchar_t */
// if (!isprint(*L) && !isprint(*I) && !isprint(*IV) && !isprint(*R)) {
// status = 0;
@@ -499,8 +501,6 @@ int wprint_row_separator(wchar_t *buffer, size_t buffer_sz,
goto clear;
}
size_t i = 0;
/* Print left margin */
CHCK_RSLT_ADD_TO_WRITTEN(snprint_n_strings_(buffer + written, buffer_sz - written, context->table_options->entire_table_options.left_margin, space_char));

View File

@@ -326,6 +326,7 @@ int buffer_printf(string_buffer_t *buffer, size_t buffer_row, char *buf, size_t
int written = 0;
int tmp = 0;
ptrdiff_t str_it_width = 0;
const CHAR_TYPE *beg = NULL;
const CHAR_TYPE *end = NULL;
CHAR_TYPE old_value;
@@ -338,7 +339,7 @@ int buffer_printf(string_buffer_t *buffer, size_t buffer_row, char *buf, size_t
old_value = *end;
*(CHAR_TYPE *)end = NULL_CHAR;
ptrdiff_t str_it_width = STR_ITER_WIDTH(beg, end);
str_it_width = STR_ITER_WIDTH(beg, end);
if (str_it_width < 0 || content_width < (size_t)str_it_width)
return - 1;
@@ -411,6 +412,7 @@ int buffer_wprintf(string_buffer_t *buffer, size_t buffer_row, wchar_t *buf, siz
int written = 0;
int tmp = 0;
ptrdiff_t str_it_width = 0;
const CHAR_TYPE *beg = NULL;
const CHAR_TYPE *end = NULL;
CHAR_TYPE old_value;
@@ -423,7 +425,7 @@ int buffer_wprintf(string_buffer_t *buffer, size_t buffer_row, wchar_t *buf, siz
old_value = *end;
*(CHAR_TYPE *)end = NULL_CHAR;
ptrdiff_t str_it_width = STR_ITER_WIDTH(beg, end);
str_it_width = STR_ITER_WIDTH(beg, end);
if (str_it_width < 0 || content_width < (size_t)str_it_width)
return - 1;