summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-07-02 08:08:53 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-07-02 08:08:53 -0400
commit6c91368e83e8399a03b8ec97493e6a5d8286db37 (patch)
treed5eccf3944940b851f51a56d292c11a3c0fa4f46
parent23872d44fc48a3a879f90443c4d77db1826b8ec8 (diff)
Use -g flag to compile
-rw-r--r--Makefile8
-rw-r--r--src/battle_message.c3
-rw-r--r--src/battle_setup.c7
-rw-r--r--src/event_object_movement.c3
4 files changed, 8 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index c974cf29f..ed06f11e0 100644
--- a/Makefile
+++ b/Makefile
@@ -88,13 +88,9 @@ ASFLAGS := -mcpu=arm7tdmi -I include --defsym $(GAME_VERSION)=1 --defsym REVISI
CPPFLAGS := -iquote include -Werror -Wno-trigraphs -D $(GAME_VERSION) -D REVISION=$(GAME_REVISION) -D $(GAME_LANGUAGE) -D=DEBUG_FIX$(DEBUG_FIX) -D DEBUG=$(DEBUG) -D MODERN=$(MODERN)
ifeq ($(MODERN),0)
CPPFLAGS += -I tools/agbcc/include -nostdinc -undef
-CC1FLAGS := -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
+CC1FLAGS := -g -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
else
-CC1FLAGS := -mthumb -mthumb-interwork -mabi=apcs-gnu -mcpu=arm7tdmi -O2 -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast -Wno-stringop-overflow
-endif
-
-ifneq (,$(DINFO))
-CC1FLAGS += -g
+CC1FLAGS := -g -mthumb -mthumb-interwork -mabi=apcs-gnu -mcpu=arm7tdmi -O2 -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast -Wno-stringop-overflow
endif
ifneq (,$(NONMATCHING))
diff --git a/src/battle_message.c b/src/battle_message.c
index c15ce19e4..dff698c09 100644
--- a/src/battle_message.c
+++ b/src/battle_message.c
@@ -460,8 +460,7 @@ const u8* TryGetStatusString(u8* src)
statusPtr = status;
for (i = 0; i < sizeof(struct StatusFlagString); i++)
{
- if (*src == EOS)
- break;
+ if (*src == EOS) break; // oneline required to match with -g
*statusPtr = *src;
src++;
statusPtr++;
diff --git a/src/battle_setup.c b/src/battle_setup.c
index bc569dff7..b6e2faff0 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -1287,8 +1287,9 @@ s32 TrainerIdToRematchTableId(const struct TrainerEyeTrainer *trainers, u16 oppo
for (i = 0; i < NUM_TRAINER_EYE_TRAINERS; i++)
{
- for (j = 0; j < 5 && trainers[i].opponentIDs[j] != 0; j++)
+ for (j = 0; j < 5; j++)
{
+ if (trainers[i].opponentIDs[j] == 0) break; // one-line required to match with -g
if (trainers[i].opponentIDs[j] == opponentId)
return i;
}
@@ -1354,7 +1355,7 @@ bool8 IsFirstTrainerIdReadyForRematch(const struct TrainerEyeTrainer *trainers,
{
s32 trainerEyeIndex = FirstBattleTrainerIdToRematchTableId(trainers, opponentId);
- if (trainerEyeIndex != -1 && trainerEyeIndex < 100 && gSaveBlock1.trainerRematches[trainerEyeIndex])
+ if (trainerEyeIndex != -1 && trainerEyeIndex < MAX_REMATCH_ENTRIES && gSaveBlock1.trainerRematches[trainerEyeIndex])
return TRUE;
else
return FALSE;
@@ -1364,7 +1365,7 @@ bool8 GetTrainerEyeRematchFlag(const struct TrainerEyeTrainer *trainers, u16 opp
{
s32 trainerEyeIndex = TrainerIdToRematchTableId(trainers, opponentId);
- if (trainerEyeIndex != -1 && trainerEyeIndex < 100 && gSaveBlock1.trainerRematches[trainerEyeIndex])
+ if (trainerEyeIndex != -1 && trainerEyeIndex < MAX_REMATCH_ENTRIES && gSaveBlock1.trainerRematches[trainerEyeIndex])
return TRUE;
else
return FALSE;
diff --git a/src/event_object_movement.c b/src/event_object_movement.c
index 11bcfd664..61f4160f4 100644
--- a/src/event_object_movement.c
+++ b/src/event_object_movement.c
@@ -1228,8 +1228,7 @@ static bool8 GetAvailableObjectEventId(u16 localId, u8 mapNum, u8 mapGroup, u8 *
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
{
- if (!gObjectEvents[i].active)
- break;
+ if (!gObjectEvents[i].active) break; // one-line required to match with -g
if (gObjectEvents[i].localId == localId && gObjectEvents[i].mapNum == mapNum && gObjectEvents[i].mapGroup == mapGroup)
return TRUE;
}