projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbb405c
)
wma_afh.c: Use DIV_ROUND_UP().
author
Andre Noll
<maan@tuebingen.mpg.de>
Fri, 6 Jan 2017 00:03:29 +0000
(
01:03
+0100)
committer
Andre 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
patch
|
blob
|
history
diff --git
a/wma_afh.c
b/wma_afh.c
index
4c9d87e
..
af9ead7
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) {