mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-25 19:24:16 +01:00
Removed calloc macro
This commit is contained in:
parent
63156b4398
commit
e412ec30a0
@ -2,7 +2,6 @@
|
||||
#define GUARD_ALLOC_H
|
||||
|
||||
#define HEAP_SIZE 0x1C000
|
||||
#define calloc(ct, sz) AllocZeroed((ct) * (sz))
|
||||
#define free Free
|
||||
|
||||
#define FREE_AND_SET_NULL(ptr) \
|
||||
|
@ -2271,7 +2271,7 @@ static void Fill1PRecords(struct RankingHall1P *dst, s32 hallFacilityId, s32 lvl
|
||||
{
|
||||
s32 i, j;
|
||||
struct RankingHall1P record1P[HALL_RECORDS_COUNT + 1];
|
||||
struct PlayerHallRecords *playerHallRecords = calloc(1, sizeof(struct PlayerHallRecords));
|
||||
struct PlayerHallRecords *playerHallRecords = AllocZeroed(sizeof(struct PlayerHallRecords));
|
||||
GetPlayerHallRecords(playerHallRecords);
|
||||
|
||||
for (i = 0; i < HALL_RECORDS_COUNT; i++)
|
||||
@ -2305,7 +2305,7 @@ static void Fill2PRecords(struct RankingHall2P *dst, s32 lvlMode)
|
||||
{
|
||||
s32 i, j;
|
||||
struct RankingHall2P record2P[HALL_RECORDS_COUNT + 1];
|
||||
struct PlayerHallRecords *playerHallRecords = calloc(1, sizeof(struct PlayerHallRecords));
|
||||
struct PlayerHallRecords *playerHallRecords = AllocZeroed(sizeof(struct PlayerHallRecords));
|
||||
GetPlayerHallRecords(playerHallRecords);
|
||||
|
||||
for (i = 0; i < HALL_RECORDS_COUNT; i++)
|
||||
@ -2421,7 +2421,7 @@ void ClearRankingHallRecords(void)
|
||||
void SaveGameFrontier(void)
|
||||
{
|
||||
s32 i;
|
||||
struct Pokemon *monsParty = calloc(PARTY_SIZE, sizeof(struct Pokemon));
|
||||
struct Pokemon *monsParty = AllocZeroed(sizeof(struct Pokemon) * PARTY_SIZE);
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
monsParty[i] = gPlayerParty[i];
|
||||
|
@ -913,7 +913,7 @@ void SaveLinkTrainerNames(void)
|
||||
s32 j;
|
||||
s32 nextSpace;
|
||||
s32 connectedTrainerRecordIndices[MAX_RFU_PLAYERS];
|
||||
struct TrainerNameRecord *newRecords = calloc(ARRAY_COUNT(gSaveBlock1Ptr->trainerNameRecords), sizeof(struct TrainerNameRecord));
|
||||
struct TrainerNameRecord *newRecords = AllocZeroed(sizeof(gSaveBlock1Ptr->trainerNameRecords));
|
||||
|
||||
// Check if we already have a record saved for connected trainers.
|
||||
for (i = 0; i < GetLinkPlayerCount(); i++)
|
||||
|
@ -448,7 +448,7 @@ void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText)
|
||||
u16 buffer[2];
|
||||
u16 species;
|
||||
|
||||
sMailRead = calloc(1, sizeof(*sMailRead));
|
||||
sMailRead = AllocZeroed(sizeof(*sMailRead));
|
||||
sMailRead->language = GAME_LANGUAGE;
|
||||
sMailRead->international = TRUE;
|
||||
sMailRead->parserSingle = CopyEasyChatWord;
|
||||
|
@ -921,7 +921,7 @@ static void Task_ShowSecretBaseRegistryMenu(u8 taskId)
|
||||
tSelectedRow = 0;
|
||||
tScrollOffset = 0;
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
sRegistryMenu = calloc(1, sizeof(*sRegistryMenu));
|
||||
sRegistryMenu = AllocZeroed(sizeof(*sRegistryMenu));
|
||||
tMainWindowId = AddWindow(&sRegistryWindowTemplates[0]);
|
||||
BuildRegistryMenuItems(taskId);
|
||||
FinalizeRegistryMenu(taskId);
|
||||
|
Loading…
Reference in New Issue
Block a user