Ethereal-dev: Re: [PATCH] Re: [Ethereal-dev] Problem with parsing float values on some machine

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 27 Jan 2004 16:36:17 -0800
On Tue, Jan 27, 2004 at 02:48:26PM +0100, Lars Ruoff wrote:
> Here is a patch that introduces a new global function to gtk_stat_util.h/.c
> (right place?)
> to compare two string values representing floats (works like strcmp).
> However the function uses possibly heavy string processing and needs
> refinement for cases of scientific notation.

Even "atof()" involves string processing.

Would it be possible to allocate, for all rows in RTP analysis's CList,
a data structure containing the numerical values for that row (and to
free all those data structures when the CList is destroyed)?

If so, then you could set the row data for the row to be a pointer to
the corresponding data structure, and have the sort function get that
data for the row (the "data" field of the GtkCListRow structure) and
sort based on the structure members - no string process is involved at
all with that.