summaryrefslogtreecommitdiff
path: root/src/rom_8011DC0.c
diff options
context:
space:
mode:
authornullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com>2018-11-29 19:24:28 +0800
committernullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com>2018-12-06 09:44:08 +0800
commit3909b6408c0125fe311d49a3029a2806993615f7 (patch)
treea02365a6eb268dce08941968e11e319f3a7fe080 /src/rom_8011DC0.c
parent1b33ad6c26fa83aa7b77055ddde59c61df03d0e4 (diff)
Fix alloc.c as per #386, define INVALID_ constants and rename malloc to alloc as per #325
Some of the INVALID_ are likely erroneously placed, due to lack of documentation
Diffstat (limited to 'src/rom_8011DC0.c')
-rw-r--r--src/rom_8011DC0.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c
index a197598de..ef82cbf0a 100644
--- a/src/rom_8011DC0.c
+++ b/src/rom_8011DC0.c
@@ -7,7 +7,7 @@
#include "link.h"
#include "link_rfu.h"
#include "librfu.h"
-#include "malloc.h"
+#include "alloc.h"
#include "menu.h"
#include "list_menu.h"
#include "menu_helpers.h"
@@ -961,7 +961,7 @@ u8 sub_80132D4(struct UnkStruct_Main0 *arg0)
if (var == 1)
{
id = sub_80176E4(&data->field_0->arr[i], data->field_4->arr);
- if (id != 0xFF)
+ if (id != INVALID_U8)
{
data->field_0->arr[i].unk = data->field_4->arr[id].unk0;
data->field_0->arr[i].field_18 = var;
@@ -1382,7 +1382,7 @@ void sub_8013C7C(u8 taskId)
case 3:
if (sub_8013E44() == 1)
PlaySE(SE_PC_LOGIN);
- if (gTasks[taskId].data[15] == 0xFF)
+ if (gTasks[taskId].data[15] == INVALID_U8)
data->state = 10;
break;
case 10:
@@ -1401,14 +1401,14 @@ void sub_8013C7C(u8 taskId)
bool32 sub_8013D88(u32 arg0, u32 id)
{
- if (id == 0xFF)
+ if (id == INVALID_U8)
return TRUE;
if (id <= ARRAY_COUNT(gUnknown_082F04D8)) // UB: <= may access data outside the array
{
const u8 *bytes = gUnknown_082F04D8[id];
- while ((*(bytes) != 0xFF))
+ while ((*(bytes) != INVALID_U8))
{
if ((*bytes) == arg0)
return TRUE;
@@ -1454,7 +1454,7 @@ u8 sub_8013E44(void)
if (data->field_0->arr[i].field_1A_0 != 0)
{
id = sub_80176E4(&data->field_0->arr[i], data->field_4->arr);
- if (id != 0xFF)
+ if (id != INVALID_U8)
{
if (data->field_0->arr[i].field_1A_0 == 1)
{
@@ -1500,7 +1500,7 @@ u8 sub_8013E44(void)
for (id = 0; id < 4; id++)
{
- if (sub_8017734(data->field_0->arr, &data->field_4->arr[id].unk0, 16) != 0xFF)
+ if (sub_8017734(data->field_0->arr, &data->field_4->arr[id].unk0, 16) != INVALID_U8)
ret = 1;
}
@@ -2178,7 +2178,7 @@ void sub_8014F48(u8 taskId)
break;
case 0:
id = ListMenuHandleInputGetItemId(data->listTaskId);
- if (gMain.newKeys & A_BUTTON && id != -1)
+ if (gMain.newKeys & A_BUTTON && id != INVALID_S32)
{
// this unused variable along with the assignment is needed to match
u32 unusedVar;
@@ -2732,7 +2732,7 @@ void sub_80156E0(u8 taskId)
break;
case 6:
var5 = sub_8017178(&data->textState, &data->field_1B, &data->field_1C, &gUnknown_082F021C, &gUnknown_082F0244);
- if (var5 != -1)
+ if (var5 != INVALID_S32)
{
if (gReceivedRemoteLinkPlayers == 0)
{