The error / warning assignments for level are not coming out correctly.
For example: let's say I have status set to 32 = 0x00000020 (ie. warning), then (status && 0xFFFFFF00) should be 0, by doing a bitwise and on all 32 bits. But when I view this in the debugger it says (status && 0xFFFFFF00) is true, resulting in the middle block being executed. But true is non-zero in C. What's going on?
You're using "&&" which is logical and, that means anything apart from 0 will be true.
What you meant to use is "&" bitwise and, which will compare individual bits.