Wireshark-bugs: [Wireshark-bugs] [Bug 7664] GMR-1: Various enhancements
Date: Sat, 25 Aug 2012 11:52:02 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7664

--- Comment #8 from Sylvain Munaut <246tnt@xxxxxxxxx> 2012-08-25 11:52:01 PDT ---

> - Is the '!!' here on purpose?
> +    *is_moc = !!(ec & 0x10);

Yes. When I name a variable 'is_xxx' I expect it to contain a "boolean" (or 0/1
whch is the C equivalent of a comparaison result).

and !!x is the shortest way to write that.

Granted in this case it doesn't really matter much. I could leave (ec & 0x10)
alone or use ((ec & 0x10) ? 1 : 0)  but that's longer.


> - hf_rach_retry_cnt and hf_rach_precorr have overlapping bits. Is it expected
> or should hf_rach_precorr and hf_rach_rand_ref be read at another offset?
> +    /* Retry counter */
> +    proto_tree_add_item(tree, hf_rach_retry_cnt,
> +                        tvb, offset + 1, 1, ENC_BIG_ENDIAN);
> +
> +    /* Precorrection Indication */
> +    proto_tree_add_item(tree, hf_rach_precorr,
> +                        tvb, offset + 1, 1, ENC_BIG_ENDIAN);

Mmm, you're right, the retry counter shouldn't have '+ 1' but just offset ...


> - the use of tvb_get_ptr() is not recommended in the developer's guide and in
> tvbuff.h. Any reason for not using the tvb_get_guint8() functions in
> _parse_dialed_number()?

Because I had that function written else where and it wanted a uint8_t *
argument :p


Attaching a fixed version ...

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.