diff --git a/cmake/staticAnalyzers.cmake b/cmake/staticAnalyzers.cmake index 08b47c65..210c9ddf 100644 --- a/cmake/staticAnalyzers.cmake +++ b/cmake/staticAnalyzers.cmake @@ -3,6 +3,8 @@ if(MATIO_ENABLE_CPPCHECK) if(CPPCHECK) set(CMAKE_C_CPPCHECK ${CPPCHECK} --language=c + --force + --quiet --check-level=exhaustive --suppress=checkersReport --suppress=unusedFunction @@ -12,8 +14,6 @@ if(MATIO_ENABLE_CPPCHECK) --inline-suppr --inconclusive -i ${CMAKE_SOURCE_DIR}/test - -i ${CMAKE_SOURCE_DIR}/snprintf - -i ${CMAKE_SOURCE_DIR}/getopt ) message(VERBOSE "Cppcheck finished setting up.") else() diff --git a/src/mat5.c b/src/mat5.c index fd4dae3c..9d828b6e 100644 --- a/src/mat5.c +++ b/src/mat5.c @@ -942,6 +942,7 @@ WriteCompressedData(mat_t *mat, z_streamp z, void *data, int N, enum matio_types z->next_in = ZLIB_BYTE_PTR(data_tag); z->avail_in = 8; do { + /* cppcheck-suppress uninitvar */ z->next_out = buf; z->avail_out = buf_size; deflate(z, Z_NO_FLUSH); @@ -2296,6 +2297,7 @@ WriteCompressedTypeArrayFlags(mat_t *mat, matvar_t *matvar, z_streamp z) z->next_in = ZLIB_BYTE_PTR(uncomp_buf); z->avail_in = (6 + i) * sizeof(*uncomp_buf); do { + /* cppcheck-suppress uninitvar */ z->next_out = ZLIB_BYTE_PTR(comp_buf); z->avail_out = buf_size * sizeof(*comp_buf); deflate(z, Z_NO_FLUSH); @@ -2537,6 +2539,7 @@ WriteCompressedCellArrayField(mat_t *mat, matvar_t *matvar, z_streamp z) z->next_in = ZLIB_BYTE_PTR(uncomp_buf); z->avail_in = 8; do { + /* cppcheck-suppress uninitvar */ z->next_out = ZLIB_BYTE_PTR(comp_buf); z->avail_out = buf_size * sizeof(*comp_buf); deflate(z, Z_NO_FLUSH); @@ -2670,6 +2673,7 @@ WriteCompressedStructField(mat_t *mat, matvar_t *matvar, z_streamp z) z->next_in = ZLIB_BYTE_PTR(uncomp_buf); z->avail_in = 8; do { + /* cppcheck-suppress uninitvar */ z->next_out = ZLIB_BYTE_PTR(comp_buf); z->avail_out = buf_size * sizeof(*comp_buf); deflate(z, Z_NO_FLUSH); @@ -5022,6 +5026,7 @@ Mat_VarWrite5(mat_t *mat, matvar_t *matvar, int compress) z->next_in = ZLIB_BYTE_PTR(uncomp_buf); z->avail_in = 8; do { + /* cppcheck-suppress uninitvar */ z->next_out = ZLIB_BYTE_PTR(comp_buf); z->avail_out = buf_size * sizeof(*comp_buf); deflate(z, Z_NO_FLUSH); diff --git a/tools/matdump.c b/tools/matdump.c index b8a8c3d7..2f44530d 100644 --- a/tools/matdump.c +++ b/tools/matdump.c @@ -660,7 +660,7 @@ print_default_numeric_2d(const matvar_t *matvar) printf("\n"); } } else { - char *data = (char *)matvar->data; + const char *data = (char *)matvar->data; for ( i = 0; i < matvar->dims[0]; i++ ) { for ( j = 0; j < matvar->dims[1]; j++ ) { size_t idx = matvar->dims[0] * j + i;