summaryrefslogtreecommitdiff
path: root/include/battle.h
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2017-11-03 02:43:41 -0400
committerProjectRevoTPP <projectrevotpp@hotmail.com>2017-11-03 02:43:41 -0400
commit2f99edc6fd21d0af1bb05fae55302a46c744ffa6 (patch)
tree029550da939f992a73e3ff5e9f0d7c5baa1850f2 /include/battle.h
parent1966f65696215a09066f6da70920703d6f3fd870 (diff)
NotInBattle
Diffstat (limited to 'include/battle.h')
-rw-r--r--include/battle.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/battle.h b/include/battle.h
index 2b268c3c8..95dba4897 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -692,20 +692,21 @@ extern u8 ewram[];
// The compiler wont allow us to locally declare ptr in this macro; some
// functions that invoke this macro will not match without this egregeous
-// assumption about the variable names.
-#define BAD_MEMSET(data, c, size, var, ptr) \
+// assumption about the variable names, so in order to avoid this assumption,
+// we opt to pass the variables themselves, even though it is likely that
+// Sogabe assumed the variables were named src and dest.
+#define BAD_MEMSET(data, c, size, var, dest) \
{ \
- ptr = (u8 *)data; \
+ dest = (u8 *)data; \
for(var = 0; var < (u32)size; var++) \
- ptr[var] = c; \
+ dest[var] = c; \
} \
-// TODO: Try to combine these macros.
-#define BAD_MEMSET_REVERSE(data, ptr2, size, var, ptr) \
+#define BAD_MEMCPY(data, dest, size, var, src) \
{ \
- ptr = (u8 *)data; \
+ src = (u8 *)data; \
for(var = 0; var < (u32)size; var++) \
- ptr2[var] = ptr[var]; \
+ dest[var] = src[var]; \
} \
typedef void (*BattleCmdFunc)(void);