Ethereal-dev: Re: [Ethereal-dev] tree==NULL checking?

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

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Tue, 14 Mar 2006 21:20:20 +0100 (CET)
Hi,

How about not including it in the conditional part? Like so:

value = tvb_get_ntohl (tvb, offset);
g_hash_table_insert (table, key, GINT_TO_POINTER(value));

if (XXX_tree) {
	...
}

Thanx,
Jaap


On Tue, 14 Mar 2006, fabio matturro wrote:

> Hi,
> one question I'd like u to clear out : )
>
> Supposing we have a piece of code like this:
>
> if (XXX_tree) {
>
> value = tvb_get_ntohl (tvb, offset);
>
> g_hash_table_insert (table, key, GINT_TO_POINTER(value));
>
> ...
>
> }
>
>
> Now, if XXX_tree == NULL (that is, the user has not asked for a detailed
> dissection), will 'value' not
> be inserted into the hash table? if so, how should I avoid including the
> code
>
> value = tvb_get_ntohl (tvb, offset);
>
> g_hash_table_insert (table, key, GINT_TO_POINTER(value));
>
> inside a control structure like 'if (XXX_tree)' ?
>
> _________________________________________________________________
> Scarica gratuitamente MSN Toolbar! http://toolbar.msn.it/
>
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev
>