Fix build with core.autocrlf=true
[gitweb.git] / commit-slab.h
index 9d12ce299cb844bd7bd74d0b5813af2932868773..42d16dcded870bfa400421a88b6d0d8c9309a404 100644 (file)
@@ -8,7 +8,7 @@
  *
  * After including this header file, using:
  *
- * define_commit_slab(indegee, int);
+ * define_commit_slab(indegree, int);
  *
  * will let you call the following functions:
  *
@@ -99,8 +99,7 @@ static MAYBE_UNUSED elemtype *slabname## _at_peek(struct slabname *s, \
                int i;                                                  \
                if (!add_if_missing)                                    \
                        return NULL;                                    \
-               s->slab = xrealloc(s->slab,                             \
-                                  (nth_slab + 1) * sizeof(*s->slab));  \
+               REALLOC_ARRAY(s->slab, nth_slab + 1);                   \
                stat_ ##slabname## realloc++;                           \
                for (i = s->slab_count; i <= nth_slab; i++)             \
                        s->slab[i] = NULL;                              \
@@ -127,16 +126,16 @@ static MAYBE_UNUSED elemtype *slabname## _peek(struct slabname *s,        \
        return slabname##_at_peek(s, c, 0);                             \
 }                                                                      \
                                                                        \
-static int stat_ ##slabname## realloc
+struct slabname
 
 /*
- * Note that this seemingly redundant second declaration is required
+ * Note that this redundant forward declaration is required
  * to allow a terminating semicolon, which makes instantiations look
  * like function declarations.  I.e., the expansion of
  *
  *    define_commit_slab(indegree, int);
  *
- * ends in 'static int stat_indegreerealloc;'.  This would otherwise
+ * ends in 'struct indegree;'.  This would otherwise
  * be a syntax error according (at least) to ISO C.  It's hard to
  * catch because GCC silently parses it by default.
  */