Wireshark-dev: Re: [Wireshark-dev] Change in wireshark[master]: Remove unneeded #includes from

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Fri, 19 Dec 2014 23:28:33 -0500
On 12/19/2014 4:19 PM, Bill Meier wrote:
On 12/19/2014 12:05 PM, Martin Mathieson (Code Review) wrote:

Change subject: Remove unneeded #includes from epan/dissectors
......................................................................

Remove unneeded #includes from epan/dissectors


Martin:

Obviously, #includes usage in dissectors is a bit of a mish-mosh


Of the ~1130 non-generated .c files in epan/dissectors, there's about
350 which don't have '#include <epan/packet.h>' at all and maybe another
50 which don't have the include as the first wireshark include.



Update: My analysis above was incorrect. It was done on the dissector files *after* the "remove unneeded #includes" patch was applied.

The correct numbers (based upon the current epan/dissectors/ files).

         1127 non-generated epan/dissectors/*.c files:

           44 w/o packet.h at all
           58 with packet.h not first before other wireshark includes
         1025 appear OK

So: I conclude:

1. The current "remove unneeded #includes" patch ends up removing
   a number of 'include <epan/packet.h>' which I think is the not the
   best way to go.

2. There's only ~ 100 non-generated files in epan/dissectors which need
   to be changed so that packet.h is included first before other
   Wireshark includes.

I will make the changes (for packet.h & related) to the epan/dissector .c files and upload the changes to Gerrit in the next day or so.

Bill