Wireshark mailing list archives

Re: [Wireshark-commits] rev 44316: /trunk/ui/gtk/ /trunk/ui/gtk/: tcp_graph.c


From: Joerg Mayer <jmayer () loplof de>
Date: Wed, 8 Aug 2012 09:19:40 +0200

Hello Martin,

thanks for the detailed writeup.

On Tue, Aug 7, 2012 at 7:16 PM, Joerg Mayer <jmayer () loplof de> wrote:

Naive question: Why isn't that cross handling code shared between the two
files?

I think it was Guy that asked before about factoring out code that is
common between the 2 modules.  I really dislike that there is identical
code in both modules.  I did start to make a list of types and functions
that could be shared, but it quickly looked messy.  I couldn't even decide
what to call the new module (was it just to be shared between these 2
files, or would it likely be useful for someone creating a third module
like these?).

Maybe call it graph_common.[hc] and move the stuff in there that is of
interest to more than one graphing module.

rlc_lte_graph.c began as a copy of tcp_graph.c.  Initially there were some
features that I didn't like (or in some cases didn't understand) so cut
them out.  Some of them I have since added back, with improvements copied
back to the TCP graph.  The biggest change is that I didn't want to have
the control window, so there are various places where I cut out references
to the controls in the control panel that affects behaviour of the graph,
then tried to automatically do the sensible thing (e.g. customising the way
the zoom factors work, or the way the divisions on the axis work).

Even where some functions are textually the same, they often refer to types
(chiefly the graph struct) that are different between the 2 graphs.  This
could have worked well in C++...

If they are similar, then how about having a common graph structure with (a) task
specific pointer(s) at then end?

I will stop messing around with the RLC graph soon - it may be easier to
see how to share what they have in common when it has settled down.

OK, looks like this may become a much larger task than is worth doing -
depending on time and interest.

Ciao
        Jörg
-- 
Joerg Mayer                                           <jmayer () loplof de>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: