Wireshark mailing list archives

Re: Wireshark coding style help


From: Guy Harris <guy () alum mit edu>
Date: Thu, 21 Nov 2013 17:05:10 -0800


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.

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