Tidy up local declarations in DEFINE_BIT_COUNT.
authorTaylor R Campbell <campbell@mumble.net>
Wed, 12 Dec 2012 06:06:39 +0000 (06:06 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 12 Dec 2012 06:06:39 +0000 (06:06 +0000)
`static' is pointless (and causes `gcc -O0' to actually allocate
static storage for them), and using uintmax_t rather than TYPE is
overkill.

src/microcode/bits.h

index fa0dac6d87f5d3a4608b7510a102b212d9673d35..8cb2512ab02c6a035dcbceb74a2db41bc82730fa 100644 (file)
@@ -34,20 +34,19 @@ static inline unsigned int                                          \
 NAME (TYPE x)                                                          \
 {                                                                      \
   /* #b01010101... */                                                  \
-  static const uintmax_t two_bit_mask = ((~ ((TYPE) 0)) / (1 + (1 << 1))); \
+  const TYPE two_bit_mask = ((~ ((TYPE) 0)) / (1 + (1 << 1)));         \
                                                                        \
   /* #b00110011... */                                                  \
-  static const uintmax_t four_bit_mask = ((~ ((TYPE) 0)) / (1 + (1 << 2))); \
+  const TYPE four_bit_mask = ((~ ((TYPE) 0)) / (1 + (1 << 2)));                \
                                                                        \
   /* #b00001111... */                                                  \
-  static const uintmax_t eight_bit_mask = ((~ ((TYPE) 0)) / (1 + (1 << 4))); \
+  const TYPE eight_bit_mask = ((~ ((TYPE) 0)) / (1 + (1 << 4)));       \
                                                                        \
   /* Assumption: The number of bits in a uintmax_t fits in eight bits  \
      (unsigned); that is, the number of bits is less than 256.  */     \
                                                                        \
   /* This is a bit mask covering the total number of bits we need.  */ \
-  static const uintmax_t final_mask                                    \
-    = (((CHAR_BIT * (sizeof (TYPE))) << 1) - 1);                       \
+  const TYPE final_mask = (((CHAR_BIT * (sizeof (TYPE))) << 1) - 1);   \
                                                                        \
   int i;                                                               \
                                                                        \