[A] Added more checks

This commit is contained in:
seleznevae 2018-11-18 11:32:07 +03:00
parent 6fb83bc58f
commit 4c7eef8081
4 changed files with 10 additions and 3 deletions

View File

@ -104,7 +104,10 @@ script:
# cppcheck run
- |
if [ "${FORT_C_COMPILER}" = "gcc-8" ]; then
cppcheck --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
cppcheck --std=posix --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
cppcheck --std=c89 --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
cppcheck --std=c99 --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
cppcheck --std=c++11 --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
fi
# Print all environment variables to aid in CI development

View File

@ -4945,8 +4945,8 @@ FT_INTERNAL
size_t buffer_text_width(string_buffer_t *buffer)
{
size_t max_length = 0;
int n = 0;
if (buffer->type == CharBuf) {
int n = 0;
while (1) {
const char *beg = NULL;
const char *end = NULL;
@ -4959,6 +4959,7 @@ size_t buffer_text_width(string_buffer_t *buffer)
}
#ifdef FT_HAVE_WCHAR
} else {
int n = 0;
while (1) {
const wchar_t *beg = NULL;
const wchar_t *end = NULL;
@ -5307,6 +5308,7 @@ fort_status_t get_table_sizes(const ft_table_t *table, size_t *rows, size_t *col
*rows = vector_size(table->rows);
fort_row_t *row = NULL;
FOR_EACH(fort_row_t *, row, table->rows) {
(void)i0;
size_t cols_in_row = columns_in_row(row);
if (cols_in_row > *cols)
*cols = cols_in_row;

View File

@ -307,8 +307,8 @@ FT_INTERNAL
size_t buffer_text_width(string_buffer_t *buffer)
{
size_t max_length = 0;
int n = 0;
if (buffer->type == CharBuf) {
int n = 0;
while (1) {
const char *beg = NULL;
const char *end = NULL;
@ -321,6 +321,7 @@ size_t buffer_text_width(string_buffer_t *buffer)
}
#ifdef FT_HAVE_WCHAR
} else {
int n = 0;
while (1) {
const wchar_t *beg = NULL;
const wchar_t *end = NULL;

View File

@ -110,6 +110,7 @@ fort_status_t get_table_sizes(const ft_table_t *table, size_t *rows, size_t *col
*rows = vector_size(table->rows);
fort_row_t *row = NULL;
FOR_EACH(fort_row_t *, row, table->rows) {
(void)i0;
size_t cols_in_row = columns_in_row(row);
if (cols_in_row > *cols)
*cols = cols_in_row;