Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this noncompliant code example, the programmer defines a macro which increments the value in of the first argument 1 x by one and modulates it with the max value provided by the userof the 2nd argument max.

Code Block
bgColor#FFCCCC
#define INCREMENT(x, max) ((x) = ((x) + 1) % (max));

int index = 0;
int value;
value = INCREMENT(index, 10) + 2;
/* ...*/

...