Skip to content

Commit

Permalink
Merge pull request #652 from Kurausukun/macros
Browse files Browse the repository at this point in the history
Safeguard SQUARE and CUBE Macro Arguments in Parentheses
  • Loading branch information
GriffinRichards committed Dec 27, 2023
2 parents 1d1754d + 2da3a17 commit 9588ba6
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 9588ba6

Please sign in to comment.