summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2009-07-22 23:34:35 +0200
committerJunio C Hamano <gitster@pobox.com>2009-07-22 21:57:41 -0700
commit98cb6f30f708ef416572bf65bd26ac9f998ae0dc (patch)
treebed685d6c61a21dd9884a97606df16f1697408d0 /git-compat-util.h
parentf630cfda8800aee03c7eb2fcd0f840730fbe43b9 (diff)
downloadgit-98cb6f30f708ef416572bf65bd26ac9f998ae0dc.tar.gz
janitor: add DIV_ROUND_UP and use it.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 6dfc0ddd90..9f941e42b1 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -37,6 +37,8 @@
#define MSB(x, bits) ((x) & TYPEOF(x)(~0ULL << (bitsizeof(x) - (bits))))
#define HAS_MULTI_BITS(i) ((i) & ((i) - 1)) /* checks if an integer has more than 1 bit set */
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+
/* Approximation of the length of the decimal representation of this type. */
#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)