Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Feb 25, 2024
1 parent 324f59b commit e67141e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmake/staticAnalyzers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions src/mat5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tools/matdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e67141e

Please sign in to comment.