Merge branch 'js/commit-slab-decl-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Aug 2016 19:33:20 +0000 (12:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Aug 2016 19:33:20 +0000 (12:33 -0700)
* js/commit-slab-decl-fix:
  commit-slab.h: avoid duplicated global static variables
  config.c: avoid duplicated global static variables

1  2 
builtin/config.c
commit-slab.h

@@@ -25,10 -23,8 +25,9 @@@ static char term = '\n'
  static int use_global_config, use_system_config, use_local_config;
  static struct git_config_source given_config_source;
  static int actions, types;
- static const char *get_color_slot, *get_colorbool_slot;
  static int end_null;
  static int respect_includes = -1;
 +static int show_origin;
  
  #define ACTION_GET (1<<0)
  #define ACTION_GET_ALL (1<<1)
diff --cc commit-slab.h
@@@ -105,31 -96,16 +105,31 @@@ static MAYBE_UNUSED elemtype *slabname#
                        s->slab[i] = NULL;                              \
                s->slab_count = nth_slab + 1;                           \
        }                                                               \
 -      if (!s->slab[nth_slab])                                         \
 +      if (!s->slab[nth_slab]) {                                       \
 +              if (!add_if_missing)                                    \
 +                      return NULL;                                    \
                s->slab[nth_slab] = xcalloc(s->slab_size,               \
                                            sizeof(**s->slab) * s->stride);             \
 -      return &s->slab[nth_slab][nth_slot * s->stride];                                \
 +      }                                                               \
 +      return &s->slab[nth_slab][nth_slot * s->stride];                \
 +}                                                                     \
 +                                                                      \
 +static MAYBE_UNUSED elemtype *slabname## _at(struct slabname *s,      \
 +                                           const struct commit *c)    \
 +{                                                                     \
 +      return slabname##_at_peek(s, c, 1);                             \
 +}                                                                     \
 +                                                                      \
 +static MAYBE_UNUSED elemtype *slabname## _peek(struct slabname *s,    \
 +                                           const struct commit *c)    \
 +{                                                                     \
 +      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
   *