diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-02-25 00:11:56 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-02-25 08:14:46 +0000 |
commit | 10c1634feb0655909d563a33b90f17629eb2cf86 (patch) | |
tree | acedd8b0f151de4c0ea82ff89ea8933920f30db3 /wiretap | |
parent | 8499a9f98f1a52e2e30afd7d55a0ac9a49fffa37 (diff) | |
download | wireshark-10c1634feb0655909d563a33b90f17629eb2cf86.tar.gz |
Make the _offset values static constants.
No need to export them outside this file, and making them constants
might convince the compiler not to bother fetching their values from
memory when referring to them.
Change-Id: Ic110513393a303036aa0b7980a0e8776500ab3b0
Reviewed-on: https://code.wireshark.org/review/7379
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/netscaler.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c index 03fcac3e05..60cfd6e115 100644 --- a/wiretap/netscaler.c +++ b/wiretap/netscaler.c @@ -489,16 +489,16 @@ typedef struct nspr_pktracepart_v26 #define myoffsetof(type,fieldname) (&(((type*)0)->fieldname)) #define __TNO(phdr,enumprefix,structprefix,structname,hdrname,structfieldname) \ - guint8 enumprefix##_##hdrname##_offset = (guint8)GPOINTER_TO_INT(myoffsetof(nspr_##structname##_t,structprefix##_##structfieldname)); + static const guint8 enumprefix##_##hdrname##_offset = (guint8)GPOINTER_TO_INT(myoffsetof(nspr_##structname##_t,structprefix##_##structfieldname)); #define __TNL(phdr,enumprefix,structprefix,structname,hdrname,structfieldname) \ - guint8 enumprefix##_##hdrname##_len = (guint8)sizeof(((nspr_##structname##_t*)0)->structprefix##_##structfieldname); + static const guint8 enumprefix##_##hdrname##_len = (guint8)sizeof(((nspr_##structname##_t*)0)->structprefix##_##structfieldname); #define __TNV1O(phdr,enumprefix,structprefix,structname,hdrname,structfieldname) \ - guint8 enumprefix##_##hdrname##_offset = (guint8)GPOINTER_TO_INT(myoffsetof(nspr_##structname##_t,structfieldname)); + static const guint8 enumprefix##_##hdrname##_offset = (guint8)GPOINTER_TO_INT(myoffsetof(nspr_##structname##_t,structfieldname)); #define __TNV1L(phdr,enumprefix,structprefix,structname,hdrname,structfieldname) \ - guint8 enumprefix##_##hdrname##_len = (guint8)sizeof(((nspr_##structname##_t*)0)->structfieldname); + static const guint8 enumprefix##_##hdrname##_len = (guint8)sizeof(((nspr_##structname##_t*)0)->structfieldname); #define TRACE_V10_REC_LEN_OFF(phdr,enumprefix,structprefix,structname) \ __TNV1O(phdr,enumprefix,structprefix,structname,dir,phd.ph_RecordType)\ |