summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2020-04-05 13:07:40 -0400
committerPikalaxALT <PikalaxALT@gmail.com>2020-04-05 13:07:40 -0400
commitf15a7050216e9e2d01b747439826ff806ce48c0b (patch)
treebd06cb2a79c66a84598f167c7bcd419a213ded45
parent585a1170c95bc3891eca825c125bf30f600b60cf (diff)
Resolve compile warnings in modern
-rw-r--r--Makefile1
-rw-r--r--include/task.h2
-rw-r--r--include/util.h4
-rw-r--r--src/battle_anim_mon_movement.c1
-rw-r--r--src/intro.c2
-rw-r--r--src/task.c2
-rw-r--r--src/util.c4
7 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 03a8366bb..c5c0a321b 100644
--- a/Makefile
+++ b/Makefile
@@ -221,6 +221,7 @@ $(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet
else
$(C_BUILDDIR)/berry_crush_2.o: CFLAGS += -Wno-address-of-packed-member
+$(C_BUILDDIR)/berry_crush_3.o: CFLAGS += -Wno-address-of-packed-member
$(C_BUILDDIR)/text.o: CFLAGS += -Wno-address-of-packed-member
$(C_BUILDDIR)/battle_tower.o: CFLAGS += -Wno-div-by-zero
$(C_BUILDDIR)/librfu_intr.o: override CFLAGS += -marm -mthumb-interwork -O2 -mtune=arm7tdmi -march=armv4t -mabi=apcs-gnu -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast
diff --git a/include/task.h b/include/task.h
index 0d605b04d..fd7f5a4e1 100644
--- a/include/task.h
+++ b/include/task.h
@@ -33,7 +33,7 @@ void SwitchTaskToFollowupFunc(u8 taskId);
bool8 FuncIsActiveTask(TaskFunc func);
u8 FindTaskIdByFunc(TaskFunc func);
u8 GetTaskCount(void);
-void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value);
+void SetWordTaskArg(u8 taskId, u8 dataElem, unsigned long value);
u32 GetWordTaskArg(u8 taskId, u8 dataElem);
#endif // GUARD_TASK_H
diff --git a/include/util.h b/include/util.h
index ef1c15faa..8dc5e9bb6 100644
--- a/include/util.h
+++ b/include/util.h
@@ -9,8 +9,8 @@ extern const u8 gMiscBlank_Gfx[]; // unused in Emerald
extern const u32 gBitTable[];
u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *));
-void StoreWordInTwoHalfwords(u16 *, u32);
-void LoadWordFromTwoHalfwords(u16 *, u32 *);
+void StoreWordInTwoHalfwords(u16 *, unsigned);
+void LoadWordFromTwoHalfwords(u16 *, unsigned *);
int CountTrailingZeroBits(u32 value);
u16 CalcCRC16(const u8 *data, u32 length);
u16 CalcCRC16WithTable(const u8 *data, u32 length);
diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c
index ffd66871c..8ed996993 100644
--- a/src/battle_anim_mon_movement.c
+++ b/src/battle_anim_mon_movement.c
@@ -4,6 +4,7 @@
#include "task.h"
#include "trig.h"
+#undef abs
#define abs(x) ((x) < 0 ? -(x) : (x))
static void AnimTask_ShakeMonStep(u8 taskId);
diff --git a/src/intro.c b/src/intro.c
index 7e1030090..b04bdf9b1 100644
--- a/src/intro.c
+++ b/src/intro.c
@@ -2045,7 +2045,7 @@ static void Task_FightScene3_Bg0Scroll(u8 taskId)
static void SpriteCB_LargeStar(struct Sprite * sprite)
{
- u32 v;
+ unsigned v;
sprite->data[0] -= sprite->data[2];
sprite->data[1] += sprite->data[3];
sprite->data[4] += 48;
diff --git a/src/task.c b/src/task.c
index fafa7c70d..83800a440 100644
--- a/src/task.c
+++ b/src/task.c
@@ -201,7 +201,7 @@ u8 GetTaskCount(void)
return count;
}
-void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value)
+void SetWordTaskArg(u8 taskId, u8 dataElem, unsigned long value)
{
if (dataElem <= 14)
{
diff --git a/src/util.c b/src/util.c
index b32799584..5423e0a2d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -120,13 +120,13 @@ u8 CreateInvisibleSpriteWithCallback(void (*callback)(struct Sprite *))
return sprite;
}
-void StoreWordInTwoHalfwords(u16 *h, u32 w)
+void StoreWordInTwoHalfwords(u16 *h, unsigned w)
{
h[0] = (u16)(w);
h[1] = (u16)(w >> 16);
}
-void LoadWordFromTwoHalfwords(u16 *h, u32 *w)
+void LoadWordFromTwoHalfwords(u16 *h, unsigned *w)
{
*w = h[0] | (s16)h[1] << 16;
}