compress: Use unsigned constant for definition of mask.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 15 Jul 2018 20:15:42 +0000 (22:15 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 18 Jul 2018 19:11:52 +0000 (21:11 +0200)
Without this, the integer constant is of signed type, which may cause
problems when blocksize is 31.

compress_filter.c

index d26fe23..69a982e 100644 (file)
@@ -49,7 +49,7 @@ static int compress_post_select(__a_unused struct sched *s, void *context)
        int16_t *ip, *op;
        uint32_t inertia = U32_OPTVAL(INERTIA, fn->lpr);
        unsigned gain_shift = inertia + U32_OPTVAL(DAMP, fn->lpr),
-               mask = (1 << U32_OPTVAL(BLOCKSIZE, fn->lpr)) - 1;
+               mask = (1U << U32_OPTVAL(BLOCKSIZE, fn->lpr)) - 1U;
        //inplace = false;
 next_buffer:
        ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);