Skip to content

Commit 41630b5

Browse files
committed
Capitalize most instances of null
1 parent 38b78d0 commit 41630b5

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

ttyd-tools/rel/include/gc/card.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace gc::card {
1010
#define CARD_READ_SIZE 512 // Minimum read size
1111
#define CARD_WRITE_SIZE 8192 // Minimum write size
1212
#define CARD_MAX_FILE 127 // Maximun number of files on memory card
13-
#define CARD_FILENAME_MAX 32 // Maximum filename length, excluding null terminator
13+
#define CARD_FILENAME_MAX 32 // Maximum filename length, excluding NULL terminator
1414
#define CARD_MAX_ICONS 8
1515

1616
#define CARD_RESULT_UNLOCKED 1 // Card is being unlocked or is already unlocked

ttyd-tools/rel/include/global.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,8 @@ struct ReloadRoomStruct
708708
{
709709
bool ManuallyReloadingRoom;
710710
bool SystemLevelShouldBeLowered;
711-
char NewBero[16]; // Not null terminated
712-
char NewMap[8]; // Not null terminated
711+
char NewBero[16]; // Not NULL terminated
712+
char NewMap[8]; // Not NULL terminated
713713
};
714714

715715
struct SpawnItems
@@ -1043,9 +1043,9 @@ struct CustomStateStruct
10431043
ttyd::party::PartyMembers PartnerOut;
10441044
ttyd::party::PartyMembers FollowerOut;
10451045
bool MarioIsShip;
1046-
char StateName[16]; // Does not include null terminator
1047-
char CurrentMap[8]; // Does not include null terminator
1048-
char CurrentBero[16]; // Does not include null terminator
1046+
char StateName[16]; // Does not include NULL terminator
1047+
char CurrentMap[8]; // Does not include NULL terminator
1048+
char CurrentBero[16]; // Does not include NULL terminator
10491049
uint8_t padding;
10501050
} __attribute__((__packed__));
10511051

ttyd-tools/rel/source/codes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ ttyd::mapdata::MapData *Mod::mapDataPtrHandleUnusedMaps(const char *mapName)
23592359
ttyd::mapdata::MapData *tempUnusedMapData = &tempUnusedMap->UnusedMapData;
23602360
char *tempUnusedMapName = tempUnusedMap->UnusedMapName;
23612361

2362-
strncpy(tempUnusedMapName, mapName, Size - 1); // Subtract 1 to make sure the string is properly null terminated
2362+
strncpy(tempUnusedMapName, mapName, Size - 1); // Subtract 1 to make sure the string is properly NULL terminated
23632363
tempUnusedMapData->pInitEvtCode = MenuVar.CurrentMapInitScript;
23642364

23652365
return tempUnusedMapData;

ttyd-tools/rel/source/draw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void drawTextMultipleLines(const char *text, int32_t x, int32_t y,
349349
break;
350350
}
351351

352-
// Copy this line to the temporary buffer and append a null byte
352+
// Copy this line to the temporary buffer and append a NULL byte
353353
int32_t LineLength = Newline - CurrentLine;
354354

355355
// Make sure the current line won't be an empty string
@@ -607,7 +607,7 @@ void drawMultipleColumnsVertical(int32_t posX, int32_t posY, uint32_t currentMen
607607

608608
int32_t setCustomText(char *textOut, uint32_t textSize, bool applyNullTerminator)
609609
{
610-
// If not setting a null terminator, allow the last byte in textOut to be used
610+
// If not setting a NULL terminator, allow the last byte in textOut to be used
611611
if (!applyNullTerminator)
612612
{
613613
textSize++;
@@ -4591,7 +4591,7 @@ void drawCheatsManageCustomStates()
45914591
CustomStateStruct *tempCustomStates = &CustomState.State[0];
45924592
constexpr uint32_t MaxTextSize = sizeof(tempCustomStates->StateName);
45934593

4594-
// The names are not null terminated, so create a temporary buffer for them
4594+
// The names are not NULL terminated, so create a temporary buffer for them
45954595
char StateNameBuffer[MaxTextSize + 1];
45964596
StateNameBuffer[MaxTextSize] = '\0';
45974597

ttyd-tools/rel/source/menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ void menuCheckButton()
17141714
constexpr uint32_t StateNameSize =
17151715
sizeof(CustomState.State[tempCurrentMenuOption].StateName);
17161716

1717-
// Add 1 to StateNameSize since it's not null terminated
1717+
// Add 1 to StateNameSize since it's not NULL terminated
17181718
customTextInit(StateName, StateNameSize + 1);
17191719

17201720
MenuVar.SecondaryMenuOption = 0;

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,7 @@ uint32_t setCustomTextButtonControls(char *textOut, uint32_t textSize, bool appl
23282328
tempBuffer[tempIndex] = CustomText.CharsToChooseFrom[MenuVar.SecondaryMenuOption];
23292329

23302330
// If not at the end of the buffer, increment the index
2331-
// Subtract 2 from textSize to account for index starting at 0 and null terminator
2331+
// Subtract 2 from textSize to account for index starting at 0 and NULL terminator
23322332
if (tempIndex < (textSize - 2))
23332333
{
23342334
CustomText.CurrentIndex = tempIndex + 1;
@@ -2343,11 +2343,11 @@ uint32_t setCustomTextButtonControls(char *textOut, uint32_t textSize, bool appl
23432343
{
23442344
// Move backward one character while clearing a specific char depending on circumstances
23452345
// If at the end of the buffer, don't decrement the index if tempBuffer[tempIndex] is not 0
2346-
// Subtract 2 from textSize to account for index starting at 0 and null terminator
2346+
// Subtract 2 from textSize to account for index starting at 0 and NULL terminator
23472347
if (tempIndex < (textSize - 2))
23482348
{
23492349
// Not at the end of the buffer
2350-
// If the char at the current index is not 0, then write a space instead of null
2350+
// If the char at the current index is not 0, then write a space instead of NULL
23512351
if (tempBuffer[tempIndex--] != '\0')
23522352
{
23532353
tempBuffer[tempIndex] = ' ';
@@ -2410,10 +2410,10 @@ uint32_t setCustomTextButtonControls(char *textOut, uint32_t textSize, bool appl
24102410
{
24112411
// Move forward one character
24122412
// Only move forward if not at the end of the buffer
2413-
// Subtract 2 from textSize to account for index starting at 0 and null terminator
2413+
// Subtract 2 from textSize to account for index starting at 0 and NULL terminator
24142414
if (tempIndex < (textSize - 2))
24152415
{
2416-
// If the current char is null, then set it to a space to allow more chars afterward
2416+
// If the current char is NULL, then set it to a space to allow more chars afterward
24172417
if (tempBuffer[tempIndex] == '\0')
24182418
{
24192419
tempBuffer[tempIndex] = ' ';
@@ -2443,7 +2443,7 @@ uint32_t setCustomTextButtonControls(char *textOut, uint32_t textSize, bool appl
24432443
return CUSTOM_TEXT_CANCEL;
24442444
}
24452445

2446-
// Subtract 1 from textSize to account for null terminator
2446+
// Subtract 1 from textSize to account for NULL terminator
24472447
strncpy(textOut, tempBuffer, textSize - 1);
24482448

24492449
if (applyNullTerminator)
@@ -5303,7 +5303,7 @@ int32_t convertDoubleToString(char *strOut, int32_t totalLength, int32_t decimal
53035303
}
53045304

53055305
// Get the value as a string
5306-
// The string is assumed to have a size of at least 64 bytes including the null terminator
5306+
// The string is assumed to have a size of at least 64 bytes including the NULL terminator
53075307
// If the value is positive, then add a plus sign to the start of the string
53085308
char *ValueStringPtr = strOut;
53095309
bool ValueIsPositive;

0 commit comments

Comments
 (0)