Re: [PATCH] use DIV_ROUND_UP

2017-07-11 Thread Jeff King
On Mon, Jul 10, 2017 at 07:08:38PM +0200, René Scharfe wrote: > > So I think it's a true mechanical conversion, but I have to admit the > > original is confusing. Without digging I suspect it's correct, though, > > just because a simple bug here would mean that our ewah bitmaps totally > > don't w

Re: [PATCH] use DIV_ROUND_UP

2017-07-10 Thread René Scharfe
Am 10.07.2017 um 09:27 schrieb Jeff King: On Sat, Jul 08, 2017 at 12:35:35PM +0200, René Scharfe wrote: diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 2dc9c82ecf..06c479f70a 100644 --- a/ewah/ewah_bitmap.c +++ b/ewah/ewah_bitmap.c @@ -210,8 +210,8 @@ size_t ewah_add(struct ewah_bitma

Re: [PATCH] use DIV_ROUND_UP

2017-07-10 Thread Jeff King
On Sat, Jul 08, 2017 at 12:35:35PM +0200, René Scharfe wrote: > Convert code that divides and rounds up to use DIV_ROUND_UP to make the > intent clearer and reduce the number of magic constants. Sounds like a good idea. > - auto_threshold = (gc_auto_threshold + 255) / 256; > + auto_thres

Re: [PATCH] use DIV_ROUND_UP

2017-07-09 Thread Martin Ågren
On 9 July 2017 at 16:01, René Scharfe wrote: > Am 09.07.2017 um 15:25 schrieb Martin Ågren: >> On 8 July 2017 at 12:35, René Scharfe wrote: >>> Convert code that divides and rounds up to use DIV_ROUND_UP to make the >>> intent clearer and reduce the number of magic constants. >> ... >>> diff --gi

Re: [PATCH] use DIV_ROUND_UP

2017-07-09 Thread René Scharfe
Am 09.07.2017 um 15:25 schrieb Martin Ågren: > On 8 July 2017 at 12:35, René Scharfe wrote: >> Convert code that divides and rounds up to use DIV_ROUND_UP to make the >> intent clearer and reduce the number of magic constants. > ... >> diff --git a/sha1_name.c b/sha1_name.c >> index e7f7b12ceb..8c

Re: [PATCH] use DIV_ROUND_UP

2017-07-09 Thread Martin Ågren
On 8 July 2017 at 12:35, René Scharfe wrote: > Convert code that divides and rounds up to use DIV_ROUND_UP to make the > intent clearer and reduce the number of magic constants. ... > diff --git a/sha1_name.c b/sha1_name.c > index e7f7b12ceb..8c513dbff6 100644 > --- a/sha1_name.c > +++ b/sha1_name

[PATCH] use DIV_ROUND_UP

2017-07-08 Thread René Scharfe
Convert code that divides and rounds up to use DIV_ROUND_UP to make the intent clearer and reduce the number of magic constants. Signed-off-by: Rene Scharfe --- builtin/gc.c | 2 +- builtin/grep.c | 2 +- builtin/log.c | 2 +- builtin/receive-pack.c | 2 +- diff.c