]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 d26fe233a85d062f839615e12f04367b582a2d85..69a982ef5a3aff20a10fcebe468a1af5efd33ba4 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);