1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
int count; int func(int *valp) { int val, locked = 0; while ((val = *valp) != 0) { if (count) { if (count) locked = 1; else locked = 1; if (!locked) continue; } if (!count) count--; break; } return val; }