aboutsummaryrefslogtreecommitdiffstats
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-03-13 17:10:47 +0100
committerJunio C Hamano <gitster@pobox.com>2021-03-13 15:56:13 -0800
commitf1121499e6460e814ec3cffa0b18942ac529f768 (patch)
tree21b2e97b9e51aa208c9365b4f016c1c9c7b4c450 /git-compat-util.h
parent13d7ab6b5d7929825b626f050b62a11241ea4945 (diff)
downloadgit-f1121499e6460e814ec3cffa0b18942ac529f768.tar.gz
git-compat-util.h: drop trailing semicolon from macro definition
Make CALLOC_ARRAY usable like a function by requiring callers to supply the trailing semicolon, which all of the current ones already do. With the extra semicolon e.g. the following code wouldn't compile because it disconnects the "else" from the "if": if (condition) CALLOC_ARRAY(ptr, n); else whatever(); Signed-off-by: René Scharfe <l.s.r@web.de> 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, 1 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 3b2738c73d..dcc786edaa 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -898,7 +898,7 @@ int xstrncmpz(const char *s, const char *t, size_t len);
#define FREE_AND_NULL(p) do { free(p); (p) = NULL; } while (0)
#define ALLOC_ARRAY(x, alloc) (x) = xmalloc(st_mult(sizeof(*(x)), (alloc)))
-#define CALLOC_ARRAY(x, alloc) (x) = xcalloc((alloc), sizeof(*(x)));
+#define CALLOC_ARRAY(x, alloc) (x) = xcalloc((alloc), sizeof(*(x)))
#define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), st_mult(sizeof(*(x)), (alloc)))
#define COPY_ARRAY(dst, src, n) copy_array((dst), (src), (n), sizeof(*(dst)) + \