summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-07-08 10:35:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-10 21:24:36 (GMT)
commit42c78a216e751cfa2720c8276c9e9f2b81640e6b (patch)
treeff12c046af74e524d80ec247f8039592337afee6 /diff.c
parent8c8e978f5719c6a58fb998742207bf907f963143 (diff)
downloadgit-42c78a216e751cfa2720c8276c9e9f2b81640e6b.zip
git-42c78a216e751cfa2720c8276c9e9f2b81640e6b.tar.gz
git-42c78a216e751cfa2720c8276c9e9f2b81640e6b.tar.bz2
use DIV_ROUND_UP
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 <l.s.r@web.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 74283d9..63ff66b 100644
--- a/diff.c
+++ b/diff.c
@@ -2095,7 +2095,7 @@ static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *o
* bytes per "line".
* This is stupid and ugly, but very cheap...
*/
- damage = (damage + 63) / 64;
+ damage = DIV_ROUND_UP(damage, 64);
ALLOC_GROW(dir.files, dir.nr + 1, dir.alloc);
dir.files[dir.nr].name = file->name;
dir.files[dir.nr].changed = damage;