Wireshark mailing list archives
Re: enum or #define?
From: Jaap Keuter <jaap.keuter () xs4all nl>
Date: Mon, 15 Feb 2010 07:49:22 +0100
Hi, That would probably be #1. This option makes verification against a protocol spec / RFC easiest, also such values don't have to be sequential. Thanks, Jaap Send from my iPhone On 14 feb 2010, at 22:21, Kaul <mykaul () gmail com> wrote:
Which one is better?
option 1:
#define SSL_HND_HELLO_REQUEST 0
#define SSL_HND_CLIENT_HELLO 1
...
or perhaps, option 2:
enum {
SSL_HND_HELLO_REQUEST,
SSL_HND_CLIENT_HELLO,
};
...
and then (in both cases):
const value_string ssl_31_handshake_type[] = {
{ SSL_HND_HELLO_REQUEST, "Hello Request" },
{ SSL_HND_CLIENT_HELLO, "Client Hello" },
?
TIA,
Y.
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- enum or #define? Kaul (Feb 14)
- Re: enum or #define? Jaap Keuter (Feb 14)
- Re: enum or #define? Guy Harris (Feb 15)
- Re: enum or #define? Mike Morrin (Feb 15)
- Re: enum or #define? Guy Harris (Feb 15)
- Re: enum or #define? Jaap Keuter (Feb 14)
