ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] RFC: sorted value_string + bsearch

From: Anders Broman <anders.broman@xxxxxxxxxxxx>
Date: Tue, 27 Apr 2010 14:39:21 +0200
Committed revision 32576. 

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Jakub Zawadzki
Sent: den 27 april 2010 13:29
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] RFC: sorted value_string + bsearch

On Tue, Apr 27, 2010 at 12:34:14PM +0200, Anders Broman wrote:
> Committed revision 32574 to faciliate further testing, dockumentation 
> updates will be needed if/when we are happy with the implementation.

Thx.

I have two changes in implementation :)
 - use function pointers instead of switch.
 - initalize ->match_type during first use of match_str() func.

I remove IS_INT_TYPE macro, cause it's now unused.

but it could be good idea to replace:
 (hfinfo->type == FT_UINT8 ||
  hfinfo->type == FT_UINT16 ||
  hfinfo->type == FT_UINT24 ||
  hfinfo->type == FT_UINT32 ||
  hfinfo->type == FT_UINT64 ||
  hfinfo->type == FT_INT8 ||
  hfinfo->type == FT_INT16 ||
  hfinfo->type == FT_INT24 ||
  hfinfo->type == FT_INT32 ||
  hfinfo->type == FT_INT64)

with single IS_[U]INT_TYPE...