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:12:28 +0000 |
commit | 9dfade3494b8ee73e7777acd377b3ee042443e81 (patch) | |
tree | f538ec874088839fbd900cf481eafe08e151e390 /wiretap/netscaler.c | |
parent | 6b6c11c3c34b31234c277142d8aa83c151583e5c (diff) |
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: Ib8605bf0bb9091721a51827c45fe75d19a15ba26
Reviewed-on: https://code.wireshark.org/review/7378
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/netscaler.c')
-rw-r--r-- | wiretap/netscaler.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c index 5ad9364556..a85d2e5941 100644 --- a/wiretap/netscaler.c +++ b/wiretap/netscaler.c @@ -464,19 +464,19 @@ typedef struct nspr_pktracepart_v26 #define myoffsetof(type,fieldname) (&(((type*)0)->fieldname)) #define __TNDO(phdr,enumprefix,structname,hdrname)\ - guint8 enumprefix##_##hdrname##_offset = (guint8)sizeof(nspr_##structname##_t); + static const guint8 enumprefix##_##hdrname##_offset = (guint8)sizeof(nspr_##structname##_t); #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)\ |