Ethereal-dev: Re: [Ethereal-dev] Assigning -1 to unsigned int

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Mon, 25 Feb 2002 00:00:45 -0800
On Mon, Feb 25, 2002 at 01:54:21AM -0600, Albert Chin wrote:
> We also have things like the following in packet-ypserv.c:
>   static const value_string ypstat[] =
>   {
>           {       1,      "YP_TRUE"       },
>           {       2,      "YP_NOMORE"     },
>           {       0,      "YP_FALSE"      },
>           {       -1,     "YP_NOMAP"      },
>           {       -2,     "YP_NODOM"      },
>           {       -3,     "YP_NOKEY"      },
> 	  ...

Those require more thought, given that I suspect that the NIS protocol
definition actually says they *are* negative.

We might want to have separate signed and unsigned varsions of
"value_string" (if we could write Ethereal in C99, you might be able to
make "value" a union and explicitly initialize the appropriate union
member - I *think* C99 might finally fix that immensely irritating
deficiency in C89 - but we can't rely on C99).