Joerg-Cyril.Hoehle@t-systems.com writes:
- if (seen < 2) return FALSE;
- if (shift && (val >= 256 || (seen&1))) return FALSE;
- total |= val << shift;
- *data = (seen&1) ? -total : total;
- *ptr = ret;
- return TRUE;
This is still fairly ugly. If you need two flags, declare two flag variables, instead of that sort of counter/flag mix.