Ethereal-dev: Re: [Ethereal-dev] Format of multi-byte integers assembled by proto_tree_add_

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: Tue, 12 Mar 2002 20:15:48 -0800
On Tue, Mar 12, 2002 at 12:46:24PM -0800, ddutt@xxxxxxxxx wrote:
> Is is dependent on the value of the last parameter to the function. If this is
> 1, the function treats the data as being in little-endian format else
> big-endian.

Actually, if the last parameter is non-zero, "proto_tree_add_item()"
treats the data as being in little-endian format, and if the last
parameter is zero, "proto_tree_add_item()" treats the data as being in
big-endian format.  A last parameter of 1, 2, 42, 137, 666, 31337, and
so on would all cause "proto_tree_add_item()" to treat the data as
little-endian.

I.e., it's a C-style Boolean - zero means "false", non-zero means
"true".

One should probably just use TRUE and FALSE, rather than 1 or 0 (or 2 or
42 or...) if one is passing a constant value; one should use a gboolean
variable, set either to TRUE or FALSE, if one isn't passing a constant
value.