Wireshark-commits: [Wireshark-commits] master 25015a0: ftypes: create a set_value union
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=25015a00a3d1f877f053940b59d5b96c1b80c744
Submitter: Martin Kaiser (wireshark@xxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
25015a0 by Martin Kaiser (wireshark@xxxxxxxxx):
ftypes: create a set_value union
struct _ftype_t contains a number of pointers to set_value_...()
functions. For each pre-defined ftype_t, only one of these pointers
is != NULL.
As the comment already says, we should move these functions into a
union. ftenum_t ftype will be used for selecting the correct function
pointer from the union.
Create a set_value union and move the FvalueSetByteArrayFunc pointer
into the union. Update fvalue_set_byte_array() accordingly. Check
that the fvalue_t parameter is of the correct type.
Change-Id: I6568d8f47108311289c0cd425f28ea8b38046141
Reviewed-on: https://code.wireshark.org/review/20433
Petri-Dish: Martin Kaiser <wireshark@xxxxxxxxx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
Reviewed-by: Martin Kaiser <wireshark@xxxxxxxxx>
Actions performed:
from 4caa64f nsh: add protocol dissection over ethernet
adds 25015a0 ftypes: create a set_value union
Summary of changes:
epan/ftypes/ftype-bytes.c | 27 ++++++++++-----
epan/ftypes/ftype-double.c | 6 ++--
epan/ftypes/ftype-guid.c | 3 +-
epan/ftypes/ftype-ieee-11073-float.c | 6 ++--
epan/ftypes/ftype-integer.c | 63 ++++++++++++++++++++++------------
epan/ftypes/ftype-ipv4.c | 3 +-
epan/ftypes/ftype-ipv6.c | 3 +-
epan/ftypes/ftype-none.c | 3 +-
epan/ftypes/ftype-pcre.c | 3 +-
epan/ftypes/ftype-protocol.c | 3 +-
epan/ftypes/ftype-string.c | 12 ++++---
epan/ftypes/ftype-time.c | 6 ++--
epan/ftypes/ftypes-int.h | 5 ++-
epan/ftypes/ftypes.c | 9 +++--
14 files changed, 103 insertions(+), 49 deletions(-)