On 7/4/19 10:11 PM, Gerald Squelart wrote:
- I found plenty of `unsigned`s around, more than `uint32_t`s.
How many are in code that predates the ability to use uint32_t, though?
- Our latest coding style [1] points at Google's, which has a section about Integer Types
[3], and the basic gist is: Use plain `int` for "not-too-big" numbers
If you can 100% guarantee that they will not be too big, right?
(In particular, for generation counters I would be somewhat worried
about making such a guarantee.)
never use any unsigned type unless you work with bitfields or need 2^N overflow
(in particular, don't use unsigned for always-positive numbers, use signed and
assertions instead).
Do you happen to know why? Is this due to worries about underflow or
odd behavior on subtraction or something?
-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform