wireshark/wsutil
Kevin Bracey 9eda2fa063 Set width of hex output according to bitmask
Output from BASE_HEX et al has always been zero-padded to according to
the field type - 8 digits for FT_UINT32, etc.

When the field has a bitmask, this is definitely not appropriate - the
field type is used to indicate the size of the bitfield container, and
tells us nothing about the size of this field.

Instead, determine the actual size of the field by inspecting the
bitmask, and output the corresponding number of hex digits.

Change-Id: I10ec4e93e1e40e8b1354d5368cc8945cf671a617
Reviewed-on: https://code.wireshark.org/review/13225
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-24 00:03:18 +00:00
..
CMakeLists.txt cfutils.c: Fix ISO C forbids an empty translation unit [-Wpedantic] 2015-11-29 21:54:34 +00:00
Makefile.am autotools: Fix g212f2f1 2015-12-01 21:37:43 +00:00
Makefile.common cfutils.c: Fix ISO C forbids an empty translation unit [-Wpedantic] 2015-11-29 21:54:34 +00:00
Makefile.nmake cfutils.c: Fix ISO C forbids an empty translation unit [-Wpedantic] 2015-11-29 21:54:34 +00:00
adler32.c Restore string.h as OS X misses it for strlen() 2014-12-28 23:47:16 +00:00
adler32.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
aes.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
aes.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
airpdcap_wep.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
base64.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
base64.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
bits_count_ones.h [pedantic] Replace usage of 'long' and 'long long' 2014-11-19 16:31:42 +00:00
bits_ctz.h Set width of hex output according to bitmask 2016-01-24 00:03:18 +00:00
bitswap.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
bitswap.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
buffer.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
buffer.h Rename buffer_ routines to ws_buffer_ to avoid name collisions. 2014-08-02 11:01:29 +00:00
cfutils.c cfutils.c: Fix ISO C forbids an empty translation unit [-Wpedantic] 2015-11-29 21:54:34 +00:00
cfutils.h cfutils.c: Fix ISO C forbids an empty translation unit [-Wpedantic] 2015-11-29 21:54:34 +00:00
clopts_common.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
clopts_common.h Move some more stuff into wsutil. 2014-06-29 23:03:24 +00:00
cmdarg_err.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
cmdarg_err.h Move some more stuff into wsutil. 2014-06-29 23:03:24 +00:00
copyright_info.c Welcome in 2016 2016-01-01 14:08:30 +00:00
copyright_info.h Move get_copyright_info() to wsutil. 2014-06-21 17:33:05 +00:00
crash_info.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
crash_info.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
crc6.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
crc6.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
crc7.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
crc7.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
crc8.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
crc8.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
crc10.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
crc10.h Clean up the CRC-10 code. 2014-08-08 18:09:02 +00:00
crc11.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
crc11.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
crc16-plain.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
crc16-plain.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
crc16.c Add "seed" capabilities to crc16_x25_ccitt (now crc16_x25_ccitt_seed) so we can remove CRC algorithm calculation in packet-assa_r3.c. 2015-03-03 05:12:10 +00:00
crc16.h Add "seed" capabilities to crc16_x25_ccitt (now crc16_x25_ccitt_seed) so we can remove CRC algorithm calculation in packet-assa_r3.c. 2015-03-03 05:12:10 +00:00
crc32.c The "MPEG-2" CRC-32 is also the ATM CRC-32. 2014-08-08 19:52:08 +00:00
crc32.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
des.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
des.h Continue to remove $Id$ from top of file 2014-03-31 18:46:57 +00:00
eax.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
eax.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
file_util.c file_util.h includes io.h, we don't need to do so ourselves. 2015-11-06 23:44:11 +00:00
file_util.h Use ws_{read,write,fdopen,close}. 2015-11-08 10:32:09 +00:00
filesystem.c Clean up indentation. 2016-01-07 09:41:14 +00:00
filesystem.h Make init_progfile_dir() take a function pointer [-Wpedantic] 2015-12-14 23:52:28 +00:00
floorl.c Don't bother with __builtin_floorl(). 2014-12-20 05:09:52 +00:00
floorl.h Remove trailing white space. 2014-12-20 04:11:43 +00:00
frequency-utils.c Match what most source say are the actual Japanese 4.9 GHz channels. 2015-11-05 22:39:52 +00:00
frequency-utils.h Get rid of ws80211_frequency_to_channel(). 2015-11-05 22:56:07 +00:00
g711.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
g711.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
inet_aton.c Get rid of unnecessary includes of ctype.h. 2014-10-17 21:22:58 +00:00
inet_aton.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
inet_ntop.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
inet_pton.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
inet_v6defs.h inet_v6def : fix warning: redundant redeclaration of 'inet_pton' [-Wredundant-decls] 2015-10-12 21:42:32 +00:00
jsmn.c jsmn: bugfix in jsmn_parse() (found by clang). 2015-03-06 19:48:00 +00:00
jsmn.h Added JSON native file support. 2015-02-17 11:08:51 +00:00
md4.c Restore string.h to md4.c 2014-12-29 00:18:17 +00:00
md4.h Continue to remove $Id$ from top of file 2014-03-31 18:46:57 +00:00
md5.c Add back string.h 2014-12-29 00:09:07 +00:00
md5.h Continue to remove $Id$ from top of file 2014-03-31 18:49:26 +00:00
mpeg-audio.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
mpeg-audio.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
nstime.c nstime: fix -Wshift-negative-value 2015-10-09 22:59:26 +00:00
nstime.h No need for "struct nstime_t", "nstime_t" by itself suffices. 2016-01-03 07:19:34 +00:00
os_version_info.c Next Windows Server version seems to be named Windows Server 2016 now 2015-07-07 16:30:36 +00:00
os_version_info.h Move get_os_major_version() to wsutil and rename it to get_windows_major_version(). 2014-06-21 21:33:11 +00:00
pint.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
plugins.c Avoid breaking output string mid-sentence 2015-12-12 13:54:13 +00:00
plugins.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
popcount.c Move popcount() to an optionally built part of wsutil for systems that 2014-12-23 00:22:23 +00:00
popcount.h Move popcount() to an optionally built part of wsutil for systems that 2014-12-23 00:22:23 +00:00
privileges.c Removed duplicated #include lines 2014-12-28 00:02:39 +00:00
privileges.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
processes.h It's INVALID_HANDLE_VALUE, not INVALID_HANDLE. 2015-06-10 04:20:39 +00:00
rc4.c Add string.h back to rc4.c 2014-12-29 00:12:45 +00:00
rc4.h Continue to remove $Id$ from top of file 2014-03-31 18:46:57 +00:00
report_err.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
report_err.h Mark another function as printf-like. 2015-07-04 20:15:33 +00:00
sha1.c Define the SHA-1 digest length in wsutil/sha1.h and use it. 2015-05-09 23:36:11 +00:00
sha1.h Define the SHA-1 digest length in wsutil/sha1.h and use it. 2015-05-09 23:36:11 +00:00
sign_ext.h Don't shift signed values left. 2015-04-30 20:40:17 +00:00
sober128.c Add back string.h to sha1.c and sober128.c 2014-12-29 00:34:56 +00:00
sober128.h Add casting and license info to fix buildbots 2014-06-19 23:55:47 +00:00
str_util.c UDP multicast stream dialog. 2015-08-18 20:17:20 +00:00
str_util.h Don't include "file.h" if you don't need it. 2015-11-04 08:46:30 +00:00
strnatcmp.c Deleting unnecessary #includes from wsutil. 2014-12-28 23:33:54 +00:00
strnatcmp.h Rename the strnatcmp.c routines and make them use the g_ascii_XXX() routines. 2014-10-29 17:54:51 +00:00
strptime.c Replace tabs by spaces when editor modelines has "expandtab" 2015-02-13 17:34:53 +00:00
strptime.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
tempfile.c Clean up includes of unistd.h, fcntl.h, and sys/stat.h. 2015-11-07 21:52:23 +00:00
tempfile.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
time_util.c Add editor-modelines; adjust whitespace. 2014-10-14 16:45:09 +00:00
time_util.h Move mktime_utc() from tvbuff.c to wsutil/time_util.c 2014-04-25 04:13:02 +00:00
type_util.c Keep everything unsigned there. 2015-05-09 01:27:17 +00:00
type_util.h Add some #includes to satisfy check-abi 2014-07-23 17:48:34 +00:00
u3.c Clean up includes of unistd.h, fcntl.h, and sys/stat.h. 2015-11-07 21:52:23 +00:00
u3.h Remove all $Id$ from top of file 2014-03-04 14:27:33 +00:00
unicode-utils.c Qt: fix a crash when closing application under Windows 2015-06-17 23:24:58 +00:00
unicode-utils.h Qt: Make sure we have usable command line arguments. 2015-06-16 18:58:54 +00:00
utf8_entities.h Add DEGREE SIGN character to utf8_entities.h and use it. 2015-10-16 23:27:20 +00:00
ws_cpuid.h "#else", not "#elif", for the last part of a chain of conditionals. 2014-12-31 21:26:10 +00:00
ws_diag_control.h ws80211: Disable shorten-64-to-32. 2015-12-01 01:19:33 +00:00
ws_mempbrk.c Remove tvb_ from the names of wsutil mempbrk routines. 2015-02-21 20:39:25 +00:00
ws_mempbrk.h Remove tvb_ from the names of wsutil mempbrk routines. 2015-02-21 20:39:25 +00:00
ws_mempbrk_int.h Remove tvb_ from the names of wsutil mempbrk routines. 2015-02-21 20:39:25 +00:00
ws_mempbrk_sse42.c The official #define for 32-bit and 64-bit Windows is _WIN32. 2015-09-02 22:59:10 +00:00
ws_version_info.c [MSVC 2015] Compiler and visual studio version are off by 5 not 6 in MSVC 2015-08-05 12:34:11 +00:00
ws_version_info.h Do the full string in get_{compiled,runtime}_version_info(). 2014-12-31 06:29:11 +00:00
wsgcrypt.h Use the <wsutil/ws_diag_control.h> stuff to disable -Wdeprecated-declarations. 2014-08-27 21:57:30 +00:00
wsgetopt.c Remove -Wwrite-strings compiler flag 2015-12-12 16:21:19 +00:00
wsgetopt.h Eliminate include of <ctype.h>. 2014-10-17 07:02:37 +00:00
wsgetopt_int.h Fix some files to pass the pre-commit hook script. 2015-05-17 21:01:03 +00:00