[Qemu-devel] [PATCH 26/31] decnumber: use DIV_ROUND_UP

Marc-André Lureau posted 31 patches 8 years, 4 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 26/31] decnumber: use DIV_ROUND_UP
Posted by Marc-André Lureau 8 years, 4 months ago
I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extra

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 libdecnumber/decNumber.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdecnumber/decNumber.c b/libdecnumber/decNumber.c
index c9e7807f87..8c197023f4 100644
--- a/libdecnumber/decNumber.c
+++ b/libdecnumber/decNumber.c
@@ -4775,7 +4775,7 @@ static decNumber * decDivideOp(decNumber *res,
 	    half=*up & 0x01;
 	    *up/=2;		   /* [shift] */
 	    if (!half) continue;
-	    *(up-1)+=(DECDPUNMAX+1)/2;
+	    *(up-1)+=DIV_ROUND_UP(DECDPUNMAX, 2);
 	    }
 	  /* [accunits still describes the original remainder length] */
 
-- 
2.13.1.395.gf7b71de06