Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Coding convention query

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Fri, 06 Jul 2012 10:39:39 -0400
On 7/6/2012 10:05 AM, Jeff Morriss wrote:
Arun Sharma wrote:
Does in coding convention, it Limit lines to 79 characters?

I have gone through README.developer but didn't find any such
restriction.
Even when i see some codes, packet-tcp.c etc, some or most lines does
not limit to 79 characters.
Could anyone confirm me on this. Thanks in advance.

There is not, AFAIK, a rule (hard or soft) on this.  I generally just
try to use the style of the file I'm currently viewing.  If I'm writing
a new module, personally, I tend to limit the lines to 79/80 columns.

(A colleague once convinced me of the benefit of 8-space tabs plus an
80-column limit: if you find yourself running out of room on the right
then it means your code is too complicated/nested and you need to rework
it, possibly breaking it into sub-functions.  Wireshark, with its
very_long_function_names() does tend to make such an approach difficult
though...)


FWIW: the current distribution of (tab expanded) line lengths for all the .c files in epan/dissectors is as follows: :)


Length	Count	PerCent	CumPercent
0-9	559783	24%	24%
10-19	219988	9%	33%
20-29	256237	11%	44%
30-39	274146	12%	56%
40-49	216950	9%	65%
50-59	180990	8%	73%
60-69	178524	8%	81%
70-79	132531	6%	86%
80-89	80131	3%	90%
90-99	58715	3%	92%
100-109	48689	2%	94%
110-119	39620	2%	96%
120-129	28514	1%	97%
130-139	23397	1%	98%
140-149	16453	1%	99%
150-159	13287	1%	99%
160-169	7028	0%	100%
170-179	3021	0%	100%
180-189	1439	0%	100%
190-199	713	0%	100%
200-	574	0%	100%

Total	2340730	100%