Used CMP_xxx since it matches the SET_ and GET_ one that already exist.
Doesnt really matter for me what the macro is called, as long as it can do
ordering of elements as a proper but primitive metric can and which
ADDRESSES_EQUAL can not. ADDRESSES_EQUAL could be redefined as !CMP_ADDRESS
if one wants to reduce the size/complexity of packet_info.h slightly. Or all
uses of
ADDRESSES_EQUAL could be rewritten to use CMP_ADDRESS instead with a tiny
performance hit
unless the compiler is real good.
It would be easy to change the name to ADDRESS_CMP instead but please wait
until my next checkin for packet-tcp
since that one needs this macro.
ipv4cmp is inappropriate since these macros deal with any kind of addresses
where ipv4 addresses are but
one single type of supported address type.
----- Original Message -----
From: "Richard Sharpe"
Sent: Wednesday, July 31, 2002 5:49 PM
Subject: [Ethereal-dev] Re: [Ethereal-cvs] cvs commit: ethereal/epan
packet_info.h
> On Wed, 31 Jul 2002, Ronnie Sahlberg wrote:
>
> > sahlberg 2002/07/31 01:15:27 CDT
> >
> > Modified files:
> > epan packet_info.h
> > Log:
> > Adding a new macro CMP_ADDRESS similar to ADDRESS_EQUAL but this one
will return
> > -1,0,1 as the xxxcmp() functions will instead of just true/false.
> > Useful if you not only want to check for equality but also if you want
to have a way to order the elements.
>
> Hmmm, for consistency with xxxcmp, perhaps it should be called addresscmp,
> or ipv4cmp or what not.
>
> Regards