]> git.tue.mpg.de Git - paraslash.git/commitdiff
wma_afh.c: Use DIV_ROUND_UP().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 6 Jan 2017 00:03:29 +0000 (01:03 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 25 Mar 2017 10:58:52 +0000 (11:58 +0100)
This kills another open-coded instance of DIV_ROUND_UP().

wma_afh.c

index 4c9d87e047af8d1d5873096db54ab4a9d17ab966..af9ead7c451e941380ebf35144d133c6d520d3ea 100644 (file)
--- a/wma_afh.c
+++ b/wma_afh.c
@@ -68,7 +68,7 @@ static int put_utf8(uint32_t val, char *result)
                *out++ = in;
                return 1;
        }
-       bytes = (wma_log2(in) + 4) / 5;
+       bytes = DIV_ROUND_UP(wma_log2(in), 5);
        shift = (bytes - 1) * 6;
        *out++ = (256 - (256 >> bytes)) | (in >> shift);
        while (shift >= 6) {