...
Code Block | ||
---|---|---|
| ||
int limit = 0x1FFFF; // 2^17 - 1 = 131071 |
NUM01-J-EX1: Data that is normally treated arithmetically may be treated with bitwise operations for the purpose of serialization or deserialization. This alternative treatment is often required for reading or writing the data from a file or network socket. Bitwise operations are also permitted when reading or writing the data from a tightly packed data structure of bytes.
...
INT14-C. Avoid performing bitwise and arithmetic operations on the same data | |
VOID INT14-CPP. Avoid performing bitwise and arithmetic operations on the same data |
Bibliography
[FindBugs 2008] | |
[Seacord 2015] | NUM01-J. Do not perform bitwise and arithmetic operations on the same data LiveLesson |
...