Wireshark mailing list archives

Re: Wireshark coding style help


From: Michael Lum <michael.lum () starsolutions com>
Date: Fri, 22 Nov 2013 11:39:10 -0800

Thanks Bill.

I was concerned there was something I was missing.

I understand its a lot of work to go through other peoples varying styles of code.
Keep up the good work.

Thanks again.

--
Michael Lum (michael.lum () starsolutions com) | STAR SOLUTIONS | Principal Software Engineer
4600 Jacombs Road, Richmond BC, Canada V6V 3B1 | +1.604.303.2315
 

-----Original Message-----
From: wireshark-dev-bounces () wireshark org 
[mailto:wireshark-dev-bounces () wireshark org] On Behalf Of Bill Meier
Sent: November 22, 2013 11:34 AM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] Wireshark coding style help

On 11/21/2013 8:05 PM, Guy Harris wrote:

On Nov 21, 2013, at 4:37 PM, Michael Lum 
<michael.lum () starsolutions com> wrote:

Can someone tell me why code like this:

i++;

would have been changed to this:

i += 1;

?

If the code in question is stepping through a packet, and "i" is 
actually "offset" or some such variable holding the offset into the 
packet, and other code is doing "offset += 2" or "offset += 
4", people 
might have used "offset += 1" to make the style more 
consistent and to 
put the field length into all the incrementing lines of code.


You may be referring to one  or more changes I made.  :)

As Guy suggested, for consistency I tend to change 'offset++' 
to 'offset 
+= 1'.

It does appear that I changed 'i++;' to 'i += 1;' in a few instances.
I must have been a bit over enthusiastic in those cases since 
there's no real reason for that change.

Bill

______________________________________________________________
_____________
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

___________________________________________________________________________
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: