Silence compiler warning in make_huffman_decode_table()
authorEric Biggers <ebiggers3@gmail.com>
Tue, 11 Nov 2014 00:34:25 +0000 (18:34 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 11 Nov 2014 00:34:25 +0000 (18:34 -0600)
src/decompress_common.c

index b56fc3f..66440ef 100644 (file)
@@ -292,13 +292,7 @@ make_huffman_decode_table(u16 decode_table[const restrict],
 
                        v = MAKE_DIRECT_ENTRY(sorted_syms[sym_idx], codeword_len);
                        v |= v << 16;
-                       if (sizeof(unsigned long) == 8) {
-                               /* This may produce a compiler warning if an
-                                * 'unsigned long' is 32 bits, but this won't be
-                                * executed unless an 'unsigned long' is at
-                                * least 64 bits anyway.  */
-                               v |= v << 32;
-                       }
+                       v |= v << (sizeof(unsigned long) == 8 ? 32 : 0);
 
                        p = (aliased_long_t *)decode_table_ptr;
                        n = stores_per_loop;