Skip to content

Commit

Permalink
safeguard SQUARE and CUBE macro arguments in parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurausukun committed Dec 27, 2023
1 parent 6385f04 commit 7567b0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data/pokemon/experience_tables.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define SQUARE(n)(n * n)
#define CUBE(n)(n * n * n)
#define SQUARE(n)((n) * (n))
#define CUBE(n)((n) * (n) * (n))

#define EXP_SLOW(n)((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4
#define EXP_FAST(n)((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5
Expand Down

0 comments on commit 7567b0a

Please sign in to comment.