Ethereal-dev: RE: [Ethereal-dev] Patch to packet-wbxml.h

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

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Fri, 14 Feb 2003 13:50:15 +0100
Hi all,

In attachment you'll find 2 patches that:
 - Move all static definitions from packet-wbxml.h to packet-wbxml.c
 - Uncomment inclusion of packet-wbxml.h in packet-wbxml.c
 - Append WBXML + version + public ID to the Info column

If required, packet-wbxml.h can be removed altogether (I commented out the
#include statement); however, it is safe to leave it there, might we want to
export WBXML functionality in the future.

I did *not* provide a patch to Makefile.am and Makefile.nmake in case we
want to get rid of packet-wbxml.h from the file list.

Please check in.

Regards,

Olivier

PS thanks for the _U_ trick!

> -----Original Message-----
> From: Guy Harris [mailto:guy@xxxxxxxxxx]
> Sent: vrijdag 14 februari 2003 2:06
> To: Joerg Mayer
> Cc: Biot Olivier; Ethereal-Dev (E-mail)
> Subject: Re: [Ethereal-dev] Patch to packet-wbxml.h
> 
> 
> On Fri, Feb 14, 2003 at 12:30:16AM +0100, Joerg Mayer wrote:
> > Looking at the patch I noticed that quite a lot of static variables
> > are declared in the .h file. IMO, this is not the right thing to do.
> 
> Yes, I tend to have .h files only for variables and #defines 
> exported to
> other pieces of code - if something is used only in one .c 
> file, I tend
> to declare/define it only in that .c file.
> 
> Static definitions are explicitly intended to be used only in one .c
> file, so I don't put them in .h files - if those variables 
> are intended
> to be used in more than one .c file, they should be defined as
> *non*-static variables in one of those files, and should be given
> external declarations in the .h file.
> 

Attachment: packet-wbxml-diffs.zip
Description: Binary data