Skip to content

Commit 8ea407a

Browse files
committed
Fix some compiler warnings in ndlz.
1 parent d77d3eb commit 8ea407a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

plugins/codecs/ndlz/ndlz8x8.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ int ndlz8_decompress(const uint8_t *input, int32_t input_len, uint8_t *output, i
437437
uint8_t* ip_limit = ip + input_len;
438438
uint8_t* op = (uint8_t*)output;
439439
uint8_t ndim;
440-
uint32_t blockshape[2];
441-
uint32_t eshape[2];
440+
int32_t blockshape[2];
441+
int32_t eshape[2];
442442
uint8_t* buffercpy;
443443
uint8_t token;
444444
if (NDLZ_UNEXPECT_CONDITIONAL(input_len < 8)) {
@@ -464,16 +464,16 @@ int ndlz8_decompress(const uint8_t *input, int32_t input_len, uint8_t *output, i
464464
}
465465
memset(op, 0, blockshape[0] * blockshape[1]);
466466

467-
uint32_t i_stop[2];
467+
int32_t i_stop[2];
468468
for (int i = 0; i < 2; ++i) {
469469
i_stop[i] = eshape[i] / cell_shape;
470470
}
471471

472472

473473
/* main loop */
474-
uint32_t ii[2];
475-
uint32_t padding[2];
476-
uint32_t ind = 0;
474+
int32_t ii[2];
475+
int32_t padding[2];
476+
int32_t ind = 0;
477477
uint8_t* local_buffer = malloc(cell_size);
478478
uint8_t* cell_aux = malloc(cell_size);
479479
for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
@@ -545,14 +545,14 @@ int ndlz8_decompress(const uint8_t *input, int32_t input_len, uint8_t *output, i
545545
}
546546

547547
uint32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
548-
for (uint32_t i = 0; i < (uint32_t) cell_shape; i++) {
548+
for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
549549
if (i < padding[0]) {
550550
ind = orig + i * blockshape[1];
551551
memcpy(&op[ind], buffercpy, padding[1]);
552552
}
553553
buffercpy += padding[1];
554554
}
555-
if (ind > (uint32_t) output_len) {
555+
if (ind > output_len) {
556556
printf("Output size is bigger than max \n");
557557
free(local_buffer);
558558
free(cell_aux);
@@ -569,7 +569,7 @@ int ndlz8_decompress(const uint8_t *input, int32_t input_len, uint8_t *output, i
569569
printf("Output size is not compatible with embedded blockshape \n");
570570
return 0;
571571
}
572-
if (ind > (uint32_t) output_len) {
572+
if (ind > output_len) {
573573
printf("Output size is bigger than max \n");
574574
return 0;
575575
}

0 commit comments

Comments
 (0)