[Wireshark-dev] initializing a variable with a non-constant value

2012-10-14 Thread Martin Kaiser
Hi, doc/README.developer says Don't initialize variables in their declaration with non-constant values. Not all compilers support this. E.g. don't use guint32 i = somearray[2]; ... In file.c, read_packet(), we do const struct wtap_pkthdr *phdr = wtap_phdr(cf-wth); union

Re: [Wireshark-dev] initializing a variable with a non-constant value

2012-10-14 Thread Evan Huus
On Sun, Oct 14, 2012 at 1:36 PM, Martin Kaiser li...@kaiser.cx wrote: Hi, doc/README.developer says Don't initialize variables in their declaration with non-constant values. Not all compilers support this. E.g. don't use guint32 i = somearray[2]; ... In file.c, read_packet(), we do

[Wireshark-dev] parsing an IPv6 address from a text string

2012-10-14 Thread Martin Kaiser
Hi, as part of #7729, we have to parse a text string that contains an IPv6 address and convert it into a sequence of bytes - and detect malformed addresses. The current proposal does the parsing manually. I was wondering if we could simplify things by using getaddrinfo(). It seems that it's

Re: [Wireshark-dev] initializing a variable with a non-constant value

2012-10-14 Thread Guy Harris
On Oct 14, 2012, at 10:36 AM, Martin Kaiser li...@kaiser.cx wrote: doc/README.developer says Don't initialize variables in their declaration with non-constant values. Not all compilers support this. E.g. don't use guint32 i = somearray[2]; Actually, that should only apply to variables

Re: [Wireshark-dev] initializing a variable with a non-constant value

2012-10-14 Thread Guy Harris
On Oct 14, 2012, at 10:47 AM, Evan Huus eapa...@gmail.com wrote: This is very similar in theme to my question about variadic macros a few weeks ago [1]. ...except that... The conclusion there was that they're not officially part of C89 which is Wireshark's official C version. Even though

Re: [Wireshark-dev] parsing an IPv6 address from a text string

2012-10-14 Thread Guy Harris
On Oct 14, 2012, at 10:50 AM, Martin Kaiser li...@kaiser.cx wrote: as part of #7729, we have to parse a text string that contains an IPv6 address and convert it into a sequence of bytes - and detect malformed addresses. The current proposal does the parsing manually. I was wondering if we

Re: [Wireshark-dev] RFD: Limiting scope of ep_ memory

2012-10-14 Thread Jakub Zawadzki
On Fri, Oct 12, 2012 at 02:02:53PM +, Anders Broman wrote: Why not make a patch that developers can try out and start debugging? Attached. PS. I'd rather want to hear comments, rather than debugging... diff --git a/epan/epan.c b/epan/epan.c index 6437bad..6880005 100644 --- a/epan/epan.c

Re: [Wireshark-dev] RFD: Limiting scope of ep_ memory

2012-10-14 Thread Martin Mathieson
On Sun, Oct 14, 2012 at 10:20 PM, Jakub Zawadzki darkjames...@darkjames.plwrote: On Fri, Oct 12, 2012 at 02:02:53PM +, Anders Broman wrote: Why not make a patch that developers can try out and start debugging? Attached. PS. I'd rather want to hear comments, rather than debugging... I