Skip to content

Commit

Permalink
Round of warning fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Apr 1, 2024
1 parent 059065c commit af6602e
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 13 deletions.
6 changes: 4 additions & 2 deletions bench/b2nd/bench_stack_append.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// when data to append is of the same size as the chunkshape. This benchmark
// compares the performance of the new accelerated path with the old one.

#include <inttypes.h>
#include "blosc2.h"
#include "b2nd.h"

Expand Down Expand Up @@ -87,8 +88,9 @@ int main() {
}
blosc_set_timestamp(&t1);
printf("Time to append (%s): %.4f s\n", accel_str, blosc_elapsed_secs(t0, t1));
printf("Number of chunks: %lld\n", src->sc->nchunks);
printf("Shape of array: (%lld, %lld, %lld)\n", src->shape[0], src->shape[1], src->shape[2]);
printf("Number of chunks: %" PRId64 "\n", src->sc->nchunks);
printf("Shape of array: (%" PRId64 ", %" PRId64 ", %" PRId64 ")\n",
src->shape[0], src->shape[1], src->shape[2]);

b2nd_free(src);
b2nd_free_ctx(ctx);
Expand Down
2 changes: 1 addition & 1 deletion blosc/b2nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ int extend_shape(b2nd_array_t *array, const int64_t *new_shape, const int64_t *s
BLOSC_ERROR(BLOSC2_ERROR_INVALID_PARAM);
}
if (array->shape[i] == INT64_MAX) {
BLOSC_TRACE_ERROR("Cannot extend array with shape[%d] = %lld", i, INT64_MAX);
BLOSC_TRACE_ERROR("Cannot extend array with shape[%d] = %" PRId64 "d", i, INT64_MAX);
BLOSC_ERROR(BLOSC2_ERROR_INVALID_PARAM);
}
}
Expand Down
5 changes: 4 additions & 1 deletion examples/delta_schunk_ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ int main(void) {
data[i] = i * (int64_t)nchunk;
}
nchunks = blosc2_schunk_append_buffer(schunk, data, isize);
assert(nchunks == nchunk);
if (nchunks != nchunk) {
printf("Unexpected nchunks!");
return nchunks;
}
}
/* Gather some info */
nbytes = schunk->nbytes;
Expand Down
6 changes: 5 additions & 1 deletion examples/frame_backed_schunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ int main(void) {
data[i] = i * nchunk;
}
nchunks = blosc2_schunk_append_buffer(schunk1, data, isize);
assert(nchunks == nchunk + 1);
if (nchunks != nchunk + 1) {
printf("Unexpected nchunks!");
return nchunks;
}

}
/* Gather some info */
nbytes = schunk1->nbytes;
Expand Down
13 changes: 8 additions & 5 deletions examples/frame_metalayers.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ int main(void) {

blosc_set_timestamp(&last);
for (nchunk = 0; nchunk < NCHUNKS; nchunk++) {
for (i = 0; i < CHUNKSIZE; i++) {
data[i] = i * nchunk + i;
}
nchunks = blosc2_schunk_append_buffer(schunk, data, isize);
assert(nchunks == nchunk + 1);
for (i = 0; i < CHUNKSIZE; i++) {
data[i] = i * nchunk + i;
}
nchunks = blosc2_schunk_append_buffer(schunk, data, isize);
if (nchunks != nchunk + 1) {
printf("Unexpected nchunks!");
return nchunks;
}
}
/* Gather some info */
nbytes = schunk->nbytes;
Expand Down
5 changes: 4 additions & 1 deletion examples/frame_offset.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ int main(void) {
data2[i] = 2 * i * nchunk;
}
nchunks = blosc2_schunk_append_buffer(schunk0w, data, isize);
assert(nchunks == nchunk + 1);
if (nchunks != nchunk + 1) {
printf("Unexpected nchunks!");
return nchunks;
}
blosc2_schunk_append_buffer(schunk1a, data2, isize);
}

Expand Down
5 changes: 4 additions & 1 deletion examples/zstd_dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ int main(void) {
data[i] = i + (int64_t)nchunk * CHUNKSIZE;
}
nchunks = blosc2_schunk_append_buffer(schunk, data, isize);
assert(nchunks == nchunk + 1);
if (nchunks != nchunk + 1) {
printf("Unexpected nchunks!");
return nchunks;
}
}
/* Gather some info */
nbytes = schunk->nbytes;
Expand Down
3 changes: 2 additions & 1 deletion plugins/filters/int_trunc/test_int_trunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <stdio.h>
#include <assert.h>
#include <inttypes.h>
#include "blosc2.h"
#include "blosc2/filters-registry.h"

Expand Down Expand Up @@ -102,7 +103,7 @@ int main64(void) {
// Check for precision
if ((data_buffer[i] - rec_buffer[i]) > (1LL << PRECISION_BITS)) {
printf("Value not in tolerance margin: ");
printf("%lld - %lld: %lld, (nchunk: %d, nelem: %d)\n",
printf("%" PRId64 " - %" PRId64 ": %" PRId64 ", (nchunk: %d, nelem: %d)\n",
data_buffer[i], rec_buffer[i],
(data_buffer[i] - rec_buffer[i]), nchunk, i);
return -1;
Expand Down
4 changes: 4 additions & 0 deletions tests/test_shuffle_roundtrip_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ static int test_shuffle_roundtrip_avx2(int32_t type_size, int32_t num_elements,

return exit_code;
#else
BLOSC_UNUSED_PARAM(type_size);
BLOSC_UNUSED_PARAM(num_elements);
BLOSC_UNUSED_PARAM(buffer_alignment);
BLOSC_UNUSED_PARAM(test_type);
return EXIT_SUCCESS;
#endif /* defined(SHUFFLE_USE_AVX2) */
}
Expand Down

0 comments on commit af6602e

Please sign in to comment.