Revert style changes

This commit is contained in:
Eduardo Quezada 2022-08-15 20:41:12 -04:00
parent 44b26cc8aa
commit 7b0c8ec972
16 changed files with 89 additions and 89 deletions

View File

@ -301,7 +301,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
sTempTextPrinter.textSpeed = 0; sTempTextPrinter.textSpeed = 0;
// Render all text (up to limit) at once // Render all text (up to limit) at once
for (j = 0; j < 0x400; j++) for (j = 0; j < 0x400; ++j)
{ {
if (RenderFont(&sTempTextPrinter) == RENDER_FINISH) if (RenderFont(&sTempTextPrinter) == RENDER_FINISH)
break; break;
@ -322,7 +322,7 @@ void RunTextPrinters(void)
if (!gDisableTextPrinters) if (!gDisableTextPrinters)
{ {
for (i = 0; i < NUM_TEXT_PRINTERS; i++) for (i = 0; i < NUM_TEXT_PRINTERS; ++i)
{ {
if (sTextPrinters[i].active) if (sTextPrinters[i].active)
{ {
@ -1318,7 +1318,7 @@ static u32 (*GetFontWidthFunc(u8 fontId))(u16, bool32)
{ {
u32 i; u32 i;
for (i = 0; i < ARRAY_COUNT(sGlyphWidthFuncs); i++) for (i = 0; i < ARRAY_COUNT(sGlyphWidthFuncs); ++i)
{ {
if (fontId == sGlyphWidthFuncs[i].fontId) if (fontId == sGlyphWidthFuncs[i].fontId)
return sGlyphWidthFuncs[i].func; return sGlyphWidthFuncs[i].func;

View File

@ -38,7 +38,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
u8 *allocatedTilemapBuffer; u8 *allocatedTilemapBuffer;
int allocatedBaseBlock; int allocatedBaseBlock;
for (i = 0; i < NUM_BACKGROUNDS; i++) for (i = 0; i < NUM_BACKGROUNDS; ++i)
{ {
bgTilemapBuffer = GetBgTilemapBuffer(i); bgTilemapBuffer = GetBgTilemapBuffer(i);
if (bgTilemapBuffer != NULL) if (bgTilemapBuffer != NULL)
@ -47,7 +47,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
gWindowBgTilemapBuffers[i] = bgTilemapBuffer; gWindowBgTilemapBuffers[i] = bgTilemapBuffer;
} }
for (i = 0; i < WINDOWS_MAX; i++) for (i = 0; i < WINDOWS_MAX; ++i)
{ {
gWindows[i].window = sDummyWindowTemplate; gWindows[i].window = sDummyWindowTemplate;
gWindows[i].tileData = NULL; gWindows[i].tileData = NULL;
@ -76,7 +76,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
return FALSE; return FALSE;
} }
for (j = 0; j < attrib; j++) for (j = 0; j < attrib; ++j)
allocatedTilemapBuffer[j] = 0; allocatedTilemapBuffer[j] = 0;
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer; gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
@ -151,7 +151,7 @@ u16 AddWindow(const struct WindowTemplate *template)
if (allocatedTilemapBuffer == NULL) if (allocatedTilemapBuffer == NULL)
return WINDOW_NONE; return WINDOW_NONE;
for (i = 0; i < attrib; i++) for (i = 0; i < attrib; ++i)
allocatedTilemapBuffer[i] = 0; allocatedTilemapBuffer[i] = 0;
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer; gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
@ -249,7 +249,7 @@ void FreeAllWindowBuffers(void)
{ {
int i; int i;
for (i = 0; i < NUM_BACKGROUNDS; i++) for (i = 0; i < NUM_BACKGROUNDS; ++i)
{ {
if (gWindowBgTilemapBuffers[i] != NULL && gWindowBgTilemapBuffers[i] != DummyWindowBgTilemap) if (gWindowBgTilemapBuffers[i] != NULL && gWindowBgTilemapBuffers[i] != DummyWindowBgTilemap)
{ {
@ -258,7 +258,7 @@ void FreeAllWindowBuffers(void)
} }
} }
for (i = 0; i < WINDOWS_MAX; i++) for (i = 0; i < WINDOWS_MAX; ++i)
{ {
if (gWindows[i].tileData != NULL) if (gWindows[i].tileData != NULL)
{ {
@ -342,7 +342,7 @@ void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 h
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE); u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
int i; int i;
for (i = 0; i < height; i++) for (i = 0; i < height; ++i)
{ {
WriteSequenceToBgTilemapBuffer( WriteSequenceToBgTilemapBuffer(
windowLocal.window.bg, windowLocal.window.bg,
@ -379,7 +379,7 @@ void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height)
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE); u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
int i; int i;
for (i = 0; i < height; i++) for (i = 0; i < height; ++i)
{ {
WriteSequenceToBgTilemapBuffer( WriteSequenceToBgTilemapBuffer(
windowLocal.window.bg, windowLocal.window.bg,

View File

@ -27,8 +27,8 @@
#include "constants/battle_palace.h" #include "constants/battle_palace.h"
extern const u8 gBattlePalaceNatureToMoveTarget[]; extern const u8 gBattlePalaceNatureToMoveTarget[];
extern const u8 *const gBattleAnims_General[]; extern const u8 * const gBattleAnims_General[];
extern const u8 *const gBattleAnims_Special[]; extern const u8 * const gBattleAnims_Special[];
extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow;
extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow;

View File

@ -557,7 +557,7 @@ const u8 gStatusConditionString_IceJpn[] = _("こおり$$$$");
const u8 gStatusConditionString_ConfusionJpn[] = _("こんらん$$$"); const u8 gStatusConditionString_ConfusionJpn[] = _("こんらん$$$");
const u8 gStatusConditionString_LoveJpn[] = _("メロメロ$$$"); const u8 gStatusConditionString_LoveJpn[] = _("メロメロ$$$");
const u8 *const gStatusConditionStringsTable[][2] = const u8 * const gStatusConditionStringsTable[][2] =
{ {
{gStatusConditionString_PoisonJpn, gText_Poison}, {gStatusConditionString_PoisonJpn, gText_Poison},
{gStatusConditionString_SleepJpn, gText_Sleep}, {gStatusConditionString_SleepJpn, gText_Sleep},

View File

@ -431,7 +431,7 @@ static const u8 sText_SpDef2[] = _("SP. DEF");
static const u8 sText_Accuracy[] = _("accuracy"); static const u8 sText_Accuracy[] = _("accuracy");
static const u8 sText_Evasiveness[] = _("evasiveness"); static const u8 sText_Evasiveness[] = _("evasiveness");
const u8 *const gStatNamesTable[NUM_BATTLE_STATS] = const u8 * const gStatNamesTable[NUM_BATTLE_STATS] =
{ {
[STAT_HP] = sText_HP2, [STAT_HP] = sText_HP2,
[STAT_ATK] = sText_Attack2, [STAT_ATK] = sText_Attack2,
@ -449,7 +449,7 @@ static const u8 sText_PokeblockWasTooSweet[] = _("was too sweet!");
static const u8 sText_PokeblockWasTooBitter[] = _("was too bitter!"); static const u8 sText_PokeblockWasTooBitter[] = _("was too bitter!");
static const u8 sText_PokeblockWasTooSour[] = _("was too sour!"); static const u8 sText_PokeblockWasTooSour[] = _("was too sour!");
const u8 *const gPokeblockWasTooXStringTable[FLAVOR_COUNT] = const u8 * const gPokeblockWasTooXStringTable[FLAVOR_COUNT] =
{ {
[FLAVOR_SPICY] = sText_PokeblockWasTooSpicy, [FLAVOR_SPICY] = sText_PokeblockWasTooSpicy,
[FLAVOR_DRY] = sText_PokeblockWasTooDry, [FLAVOR_DRY] = sText_PokeblockWasTooDry,
@ -514,7 +514,7 @@ static const u8 sText_Trainer2WinText[];
static const u8 sText_TwoInGameTrainersDefeated[]; static const u8 sText_TwoInGameTrainersDefeated[];
static const u8 sText_Trainer2LoseText[]; static const u8 sText_Trainer2LoseText[];
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_START] = const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_START] =
{ {
[STRINGID_TRAINER1LOSETEXT - BATTLESTRINGS_TABLE_START] = sText_Trainer1LoseText, [STRINGID_TRAINER1LOSETEXT - BATTLESTRINGS_TABLE_START] = sText_Trainer1LoseText,
[STRINGID_PKMNGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_PkmnGainedEXP, [STRINGID_PKMNGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_PkmnGainedEXP,
@ -1293,7 +1293,7 @@ static const u8 sText_SpAtk[] = _("SP. ATK");
static const u8 sText_SpDef[] = _("SP. DEF"); static const u8 sText_SpDef[] = _("SP. DEF");
// Unused // Unused
static const u8 *const sStatNamesTable2[] = static const u8 * const sStatNamesTable2[] =
{ {
sText_HP, sText_SpAtk, sText_Attack, sText_HP, sText_SpAtk, sText_Attack,
sText_SpDef, sText_Defense, sText_Speed sText_SpDef, sText_Defense, sText_Speed
@ -1405,7 +1405,7 @@ static const u8 sText_LostToOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} lost t
static const u8 sText_TiedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} tied the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); static const u8 sText_TiedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} tied the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!");
static const u8 sText_RefCommenceBattle[] = _("REFEREE: {B_PLAYER_MON1_NAME} VS {B_OPPONENT_MON1_NAME}!\nCommence battling!"); static const u8 sText_RefCommenceBattle[] = _("REFEREE: {B_PLAYER_MON1_NAME} VS {B_OPPONENT_MON1_NAME}!\nCommence battling!");
const u8 *const gRefereeStringsTable[] = const u8 * const gRefereeStringsTable[] =
{ {
[B_MSG_REF_NOTHING_IS_DECIDED] = sText_RefIfNothingIsDecided, [B_MSG_REF_NOTHING_IS_DECIDED] = sText_RefIfNothingIsDecided,
[B_MSG_REF_THATS_IT] = sText_RefThatsIt, [B_MSG_REF_THATS_IT] = sText_RefThatsIt,

View File

@ -1223,7 +1223,7 @@ u8 DoFieldEndTurnEffects(void)
if (effect != 0) if (effect != 0)
break; break;
} }
if (!effect) if (effect == 0)
{ {
gBattleStruct->turnCountersTracker++; gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0; gBattleStruct->turnSideTracker = 0;
@ -1249,7 +1249,7 @@ u8 DoFieldEndTurnEffects(void)
if (effect != 0) if (effect != 0)
break; break;
} }
if (!effect) if (effect == 0)
{ {
gBattleStruct->turnCountersTracker++; gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0; gBattleStruct->turnSideTracker = 0;
@ -1272,7 +1272,7 @@ u8 DoFieldEndTurnEffects(void)
if (effect != 0) if (effect != 0)
break; break;
} }
if (!effect) if (effect == 0)
{ {
gBattleStruct->turnCountersTracker++; gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0; gBattleStruct->turnSideTracker = 0;
@ -1296,7 +1296,7 @@ u8 DoFieldEndTurnEffects(void)
if (effect != 0) if (effect != 0)
break; break;
} }
if (!effect) if (effect == 0)
{ {
gBattleStruct->turnCountersTracker++; gBattleStruct->turnCountersTracker++;
gBattleStruct->turnSideTracker = 0; gBattleStruct->turnSideTracker = 0;
@ -1318,7 +1318,7 @@ u8 DoFieldEndTurnEffects(void)
if (effect != 0) if (effect != 0)
break; break;
} }
if (!effect) if (effect == 0)
{ {
gBattleStruct->turnCountersTracker++; gBattleStruct->turnCountersTracker++;
} }

View File

@ -226,7 +226,7 @@ bool8 SetUpFieldMove_Cut(void)
y = gPlayerFacingPosition.y + sHyperCutStruct[i].y; y = gPlayerFacingPosition.y + sHyperCutStruct[i].y;
tileCuttable = TRUE; tileCuttable = TRUE;
for (j = 0; j < 2; j++) for (j = 0; j < 2; ++j)
{ {
if (sHyperCutStruct[i].unk2[j] == 0) break; // one line required to match -g if (sHyperCutStruct[i].unk2[j] == 0) break; // one line required to match -g
if (cutTiles[(u8)(sHyperCutStruct[i].unk2[j] - 1)] == FALSE) if (cutTiles[(u8)(sHyperCutStruct[i].unk2[j] - 1)] == FALSE)

View File

@ -164,7 +164,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
gRfuFixed = (void *)APIBuffer + 0xdc; // + sizeof(*gRfuStatic) gRfuFixed = (void *)APIBuffer + 0xdc; // + sizeof(*gRfuStatic)
gRfuSlotStatusNI[0] = (void *)APIBuffer + 0x1bc; // + sizeof(*gRfuFixed) gRfuSlotStatusNI[0] = (void *)APIBuffer + 0x1bc; // + sizeof(*gRfuFixed)
gRfuSlotStatusUNI[0] = (void *)APIBuffer + 0x37c; // + sizeof(*gRfuSlotStatusNI[0]) * RFU_CHILD_MAX gRfuSlotStatusUNI[0] = (void *)APIBuffer + 0x37c; // + sizeof(*gRfuSlotStatusNI[0]) * RFU_CHILD_MAX
for (i = 1; i < RFU_CHILD_MAX; i++) for (i = 1; i < RFU_CHILD_MAX; ++i)
{ {
gRfuSlotStatusNI[i] = &gRfuSlotStatusNI[i - 1][1]; gRfuSlotStatusNI[i] = &gRfuSlotStatusNI[i - 1][1];
gRfuSlotStatusUNI[i] = &gRfuSlotStatusUNI[i - 1][1]; gRfuSlotStatusUNI[i] = &gRfuSlotStatusUNI[i - 1][1];
@ -173,7 +173,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
gRfuFixed->STWIBuffer = (struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1]; gRfuFixed->STWIBuffer = (struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1];
STWI_init_all((struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1], sioIntrTable_p, copyInterruptToRam); STWI_init_all((struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1], sioIntrTable_p, copyInterruptToRam);
rfu_STC_clearAPIVariables(); rfu_STC_clearAPIVariables();
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
gRfuSlotStatusNI[i]->recvBuffer = NULL; gRfuSlotStatusNI[i]->recvBuffer = NULL;
gRfuSlotStatusNI[i]->recvBufferSize = 0; gRfuSlotStatusNI[i]->recvBufferSize = 0;
@ -214,7 +214,7 @@ static void rfu_STC_clearAPIVariables(void)
gRfuLinkStatus->parentChild = MODE_NEUTRAL; gRfuLinkStatus->parentChild = MODE_NEUTRAL;
rfu_clearAllSlot(); rfu_clearAllSlot();
gRfuStatic->SCStartFlag = 0; gRfuStatic->SCStartFlag = 0;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
gRfuStatic->cidBak[i] = 0; gRfuStatic->cidBak[i] = 0;
REG_IME = IMEBackup; REG_IME = IMEBackup;
} }
@ -294,7 +294,7 @@ static void rfu_CB_defaultCallback(u8 reqCommand, u16 reqResult)
if (gRfuStatic->flags & 8) if (gRfuStatic->flags & 8)
gRfuFixed->reqCallback(reqCommand, reqResult); gRfuFixed->reqCallback(reqCommand, reqResult);
bmSlotFlags = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag; bmSlotFlags = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
if ((bmSlotFlags >> i) & 1) if ((bmSlotFlags >> i) & 1)
rfu_STC_removeLinkData(i, 1); rfu_STC_removeLinkData(i, 1);
gRfuLinkStatus->parentChild = MODE_NEUTRAL; gRfuLinkStatus->parentChild = MODE_NEUTRAL;
@ -351,7 +351,7 @@ u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
// The size of struct RfuLinkStatus is 180 // The size of struct RfuLinkStatus is 180
checksum = 0; checksum = 0;
for (i = 0; i < 180/2; i++) for (i = 0; i < 180/2; ++i)
checksum += *mb_buff_iwram_p++; checksum += *mb_buff_iwram_p++;
if (checksum != *(u16 *)0x30000FA) if (checksum != *(u16 *)0x30000FA)
return 1; return 1;
@ -455,11 +455,11 @@ void rfu_REQ_configGameData(u8 mbootFlag, u16 serialNo, const u8 *gname, const u
packet[1] = serialNo >> 8; packet[1] = serialNo >> 8;
if (mbootFlag != 0) if (mbootFlag != 0)
packet[1] = (serialNo >> 8) | 0x80; packet[1] = (serialNo >> 8) | 0x80;
for (i = 2; i < 15; i++) for (i = 2; i < 15; ++i)
packet[i] = *gname++; packet[i] = *gname++;
check_sum = 0; check_sum = 0;
unameBackup = uname; unameBackup = uname;
for (i = 0; i < 8; i++) for (i = 0; i < 8; ++i)
{ {
check_sum += *unameBackup++; check_sum += *unameBackup++;
check_sum += *gnameBackup++; check_sum += *gnameBackup++;
@ -493,10 +493,10 @@ static void rfu_CB_configGameData(u8 reqCommand, u16 reqResult)
{ {
gRfuLinkStatus->my.mbootFlag = 0; gRfuLinkStatus->my.mbootFlag = 0;
} }
for (i = 0; i < RFU_GAME_NAME_LENGTH; i++) for (i = 0; i < RFU_GAME_NAME_LENGTH; ++i)
gRfuLinkStatus->my.gname[i] = *gname_uname_p++; gRfuLinkStatus->my.gname[i] = *gname_uname_p++;
++gname_uname_p; ++gname_uname_p;
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) for (i = 0; i < PLAYER_NAME_LENGTH + 1; ++i)
gRfuLinkStatus->my.uname[i] = *gname_uname_p++; gRfuLinkStatus->my.uname[i] = *gname_uname_p++;
} }
rfu_STC_REQ_callback(reqCommand, reqResult); rfu_STC_REQ_callback(reqCommand, reqResult);
@ -546,7 +546,7 @@ static void rfu_STC_clearLinkStatus(u8 parentChild)
CpuFill16(0, gRfuLinkStatus->partner, sizeof(gRfuLinkStatus->partner)); CpuFill16(0, gRfuLinkStatus->partner, sizeof(gRfuLinkStatus->partner));
gRfuLinkStatus->findParentCount = 0; gRfuLinkStatus->findParentCount = 0;
} }
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
gRfuLinkStatus->strength[i] = 0; gRfuLinkStatus->strength[i] = 0;
gRfuLinkStatus->connCount = 0; gRfuLinkStatus->connCount = 0;
gRfuLinkStatus->connSlotFlag = 0; gRfuLinkStatus->connSlotFlag = 0;
@ -609,7 +609,7 @@ static void rfu_STC_readChildList(void)
if (STWI_poll_CommandEnd() == 0) if (STWI_poll_CommandEnd() == 0)
{ {
data_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4]; data_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
true_slots[i] = *data_p++; true_slots[i] = *data_p++;
} }
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0] = stwiParam; gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0] = stwiParam;
@ -696,7 +696,7 @@ static void rfu_STC_readParentCandidateList(void)
numSlots = packet_p[1]; numSlots = packet_p[1];
packet_p += 4; packet_p += 4;
gRfuLinkStatus->findParentCount = 0; gRfuLinkStatus->findParentCount = 0;
for (i = 0; i < RFU_CHILD_MAX && numSlots != 0; i++) for (i = 0; i < RFU_CHILD_MAX && numSlots != 0; ++i)
{ {
numSlots -= 7; numSlots -= 7;
uname_p = packet_p + 6; uname_p = packet_p + 6;
@ -704,7 +704,7 @@ static void rfu_STC_readParentCandidateList(void)
check_sum = ~*packet_p; check_sum = ~*packet_p;
++packet_p; ++packet_p;
my_check_sum = 0; my_check_sum = 0;
for (j = 0; j < 8; j++) for (j = 0; j < 8; ++j)
{ {
my_check_sum += *packet_p++; my_check_sum += *packet_p++;
my_check_sum += *uname_p++; my_check_sum += *uname_p++;
@ -723,10 +723,10 @@ static void rfu_STC_readParentCandidateList(void)
else else
target->mbootFlag = 0; target->mbootFlag = 0;
packet_p += 2; packet_p += 2;
for (j = 0; j < RFU_GAME_NAME_LENGTH; j++) for (j = 0; j < RFU_GAME_NAME_LENGTH; ++j)
target->gname[j] = *packet_p++; target->gname[j] = *packet_p++;
++packet_p; ++packet_p;
for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++) for (j = 0; j < PLAYER_NAME_LENGTH + 1; ++j)
target->uname[j] = *packet_p++; target->uname[j] = *packet_p++;
++gRfuLinkStatus->findParentCount; ++gRfuLinkStatus->findParentCount;
} }
@ -737,7 +737,7 @@ void rfu_REQ_startConnectParent(u16 pid)
{ {
u16 result = 0; u16 result = 0;
u8 i; u8 i;
for (i = 0; i < RFU_CHILD_MAX && gRfuLinkStatus->partner[i].id != pid; i++) for (i = 0; i < RFU_CHILD_MAX && gRfuLinkStatus->partner[i].id != pid; ++i)
; ;
if (i == RFU_CHILD_MAX) if (i == RFU_CHILD_MAX)
result = ERR_PID_NOT_FOUND; result = ERR_PID_NOT_FOUND;
@ -782,7 +782,7 @@ static void rfu_CB_pollConnectParent(u8 reqCommand, u16 reqResult)
++gRfuLinkStatus->connCount; ++gRfuLinkStatus->connCount;
gRfuLinkStatus->parentChild = MODE_CHILD; gRfuLinkStatus->parentChild = MODE_CHILD;
gRfuStatic->flags |= 0x80; gRfuStatic->flags |= 0x80;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
if (gRfuLinkStatus->partner[i].id == gRfuStatic->tryPid) if (gRfuLinkStatus->partner[i].id == gRfuStatic->tryPid)
{ {
@ -868,7 +868,7 @@ u16 rfu_syncVBlank(void)
{ {
gRfuStatic->flags &= 0xFB; gRfuStatic->flags &= 0xFB;
bmSlotFlag = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag; bmSlotFlag = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
if ((bmSlotFlag >> i) & 1) if ((bmSlotFlag >> i) & 1)
rfu_STC_removeLinkData(i, 1); rfu_STC_removeLinkData(i, 1);
gRfuLinkStatus->parentChild = MODE_NEUTRAL; gRfuLinkStatus->parentChild = MODE_NEUTRAL;
@ -921,7 +921,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
newLinkLossFlag ^= gRfuLinkStatus->connSlotFlag; newLinkLossFlag ^= gRfuLinkStatus->connSlotFlag;
*bmLinkLossSlot = newLinkLossFlag & gRfuLinkStatus->connSlotFlag; *bmLinkLossSlot = newLinkLossFlag & gRfuLinkStatus->connSlotFlag;
*linkLossReason = REASON_LINK_LOSS; *linkLossReason = REASON_LINK_LOSS;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
if ((*bmLinkLossSlot >> i) & 1) if ((*bmLinkLossSlot >> i) & 1)
{ {
@ -941,7 +941,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
if (reqResult == 0) if (reqResult == 0)
{ {
packet_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4]; packet_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
gRfuLinkStatus->strength[i] = *packet_p++; gRfuLinkStatus->strength[i] = *packet_p++;
to_req_disconnect = 0; to_req_disconnect = 0;
i = 0; i = 0;
@ -951,7 +951,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
rfu_STC_REQ_callback(ID_LINK_STATUS_REQ, reqResult); rfu_STC_REQ_callback(ID_LINK_STATUS_REQ, reqResult);
return reqResult; return reqResult;
} }
for (; i < RFU_CHILD_MAX; i++) for (; i < RFU_CHILD_MAX; ++i)
{ {
#if LIBRFU_VERSION >= 1026 #if LIBRFU_VERSION >= 1026
if (gRfuStatic->lsFixedCount[i] != 0) if (gRfuStatic->lsFixedCount[i] != 0)
@ -1128,7 +1128,7 @@ static void rfu_CB_disconnect(u8 reqCommand, u16 reqResult)
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[8] = gRfuStatic->recoveryBmSlot; gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[8] = gRfuStatic->recoveryBmSlot;
if (reqResult == 0) if (reqResult == 0)
{ {
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
bm_slot_flag = 1 << i; bm_slot_flag = 1 << i;
if (bm_slot_flag & gRfuStatic->recoveryBmSlot) if (bm_slot_flag & gRfuStatic->recoveryBmSlot)
@ -1153,7 +1153,7 @@ void rfu_REQ_CHILD_startConnectRecovery(u8 bmRecoverySlot)
u8 i; u8 i;
gRfuStatic->recoveryBmSlot = bmRecoverySlot; gRfuStatic->recoveryBmSlot = bmRecoverySlot;
for (i = 0; i < RFU_CHILD_MAX && !((bmRecoverySlot >> i) & 1); i++) for (i = 0; i < RFU_CHILD_MAX && !((bmRecoverySlot >> i) & 1); ++i)
; ;
STWI_set_Callback_M(rfu_STC_REQ_callback); STWI_set_Callback_M(rfu_STC_REQ_callback);
// if i == 4, gRfuLinkStatus->partner[i].id becomes gRfuLinkStatus->my.id // if i == 4, gRfuLinkStatus->partner[i].id becomes gRfuLinkStatus->my.id
@ -1174,7 +1174,7 @@ static void rfu_CB_CHILD_pollConnectRecovery(u8 reqCommand, u16 reqResult)
if (reqResult == 0 && gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4] == 0 && gRfuStatic->recoveryBmSlot) if (reqResult == 0 && gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4] == 0 && gRfuStatic->recoveryBmSlot)
{ {
gRfuLinkStatus->parentChild = MODE_CHILD; gRfuLinkStatus->parentChild = MODE_CHILD;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
bm_slot_flag = 1 << i; bm_slot_flag = 1 << i;
rfuLinkStatus = gRfuLinkStatus; // ??? rfuLinkStatus = gRfuLinkStatus; // ???
@ -1256,7 +1256,7 @@ void rfu_clearAllSlot(void)
u16 IMEBackup = REG_IME; u16 IMEBackup = REG_IME;
REG_IME = 0; REG_IME = 0;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
CpuFill16(0, gRfuSlotStatusNI[i], 2 * sizeof(struct NIComm)); CpuFill16(0, gRfuSlotStatusNI[i], 2 * sizeof(struct NIComm));
CpuFill16(0, gRfuSlotStatusUNI[i], sizeof(struct UNISend) + sizeof(struct UNIRecv)); CpuFill16(0, gRfuSlotStatusUNI[i], sizeof(struct UNISend) + sizeof(struct UNIRecv));
@ -1324,7 +1324,7 @@ u16 rfu_clearSlot(u8 connTypeFlag, u8 slotStatusIndex)
if (NI_comm->state & SLOT_BUSY_FLAG) if (NI_comm->state & SLOT_BUSY_FLAG)
{ {
rfu_STC_releaseFrame(slotStatusIndex, send_recv, NI_comm); rfu_STC_releaseFrame(slotStatusIndex, send_recv, NI_comm);
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
if ((NI_comm->bmSlotOrg >> i) & 1) if ((NI_comm->bmSlotOrg >> i) & 1)
NI_comm->failCounter = 0; NI_comm->failCounter = 0;
} }
@ -1450,7 +1450,7 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
slotStatus_NI->send.src = src; slotStatus_NI->send.src = src;
slotStatus_NI->send.ack = 0; slotStatus_NI->send.ack = 0;
slotStatus_NI->send.phase = 0; slotStatus_NI->send.phase = 0;
for (i = 0; i < WINDOW_COUNT; i++) for (i = 0; i < WINDOW_COUNT; ++i)
{ {
slotStatus_NI->send.recvAckFlag[i] = 0; slotStatus_NI->send.recvAckFlag[i] = 0;
slotStatus_NI->send.n[i] = 1; slotStatus_NI->send.n[i] = 1;
@ -1503,7 +1503,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
{ {
imeBak = REG_IME; imeBak = REG_IME;
REG_IME = 0; REG_IME = 0;
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
if ((connType >> i) & 1) if ((connType >> i) & 1)
gRfuSlotStatusNI[i]->send.failCounter = 0; gRfuSlotStatusNI[i]->send.failCounter = 0;
@ -1536,7 +1536,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
if (gRfuSlotStatusUNI[slotStatusIndex]->send.state != SLOT_STATE_SEND_UNI) if (gRfuSlotStatusUNI[slotStatusIndex]->send.state != SLOT_STATE_SEND_UNI)
return ERR_SLOT_NOT_SENDING; return ERR_SLOT_NOT_SENDING;
for (bmSlot = 0, i = 0; i < RFU_CHILD_MAX; i++) for (bmSlot = 0, i = 0; i < RFU_CHILD_MAX; ++i)
if (i != slotStatusIndex) if (i != slotStatusIndex)
bmSlot |= gRfuSlotStatusUNI[i]->send.bmSlot; bmSlot |= gRfuSlotStatusUNI[i]->send.bmSlot;
if (bmNewTgtSlot & bmSlot) if (bmNewTgtSlot & bmSlot)
@ -1695,7 +1695,7 @@ static void rfu_CB_sendData(UNUSED u8 reqCommand, u16 reqResult)
if (reqResult == 0) if (reqResult == 0)
{ {
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
if (gRfuSlotStatusUNI[i]->send.dataReadyFlag) if (gRfuSlotStatusUNI[i]->send.dataReadyFlag)
gRfuSlotStatusUNI[i]->send.dataReadyFlag = 0; gRfuSlotStatusUNI[i]->send.dataReadyFlag = 0;
@ -1739,7 +1739,7 @@ static void rfu_constructSendLLFrame(void)
gRfuLinkStatus->LLFReadyFlag = 0; gRfuLinkStatus->LLFReadyFlag = 0;
pakcketSize = 0; pakcketSize = 0;
llf_p = (u8 *)&gRfuFixed->LLFBuffer[1]; llf_p = (u8 *)&gRfuFixed->LLFBuffer[1];
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
currSize = 0; currSize = 0;
if (gRfuSlotStatusNI[i]->send.state & SLOT_BUSY_FLAG) if (gRfuSlotStatusNI[i]->send.state & SLOT_BUSY_FLAG)
@ -1815,7 +1815,7 @@ static u16 rfu_STC_NI_constructLLSF(u8 bm_slot_id, u8 **dest_pp, struct NIComm *
if (gRfuLinkStatus->parentChild == MODE_PARENT) if (gRfuLinkStatus->parentChild == MODE_PARENT)
frame |= NI_comm->bmSlot << 18; frame |= NI_comm->bmSlot << 18;
frame8_p = (u8 *)&frame; frame8_p = (u8 *)&frame;
for (i = 0; i < llsf->frameSize; i++) for (i = 0; i < llsf->frameSize; ++i)
*(*dest_pp)++ = *frame8_p++; *(*dest_pp)++ = *frame8_p++;
if (size != 0) if (size != 0)
{ {
@ -1853,7 +1853,7 @@ static u16 rfu_STC_UNI_constructLLSF(u8 bm_slot_id, u8 **dest_p)
if (gRfuLinkStatus->parentChild == MODE_PARENT) if (gRfuLinkStatus->parentChild == MODE_PARENT)
frame |= UNI_send->bmSlot << 18; frame |= UNI_send->bmSlot << 18;
frame8_p = (u8 *)&frame; frame8_p = (u8 *)&frame;
for (i = 0; i < llsf->frameSize; i++) for (i = 0; i < llsf->frameSize; ++i)
*(*dest_p)++ = *frame8_p++; *(*dest_p)++ = *frame8_p++;
src_p = UNI_send->src; src_p = UNI_send->src;
gRfuFixed->fastCopyPtr(&src_p, dest_p, UNI_send->payloadSize); gRfuFixed->fastCopyPtr(&src_p, dest_p, UNI_send->payloadSize);
@ -1888,7 +1888,7 @@ static void rfu_CB_recvData(u8 reqCommand, u16 reqResult)
rfu_STC_PARENT_analyzeRecvPacket(); rfu_STC_PARENT_analyzeRecvPacket();
else else
rfu_STC_CHILD_analyzeRecvPacket(); rfu_STC_CHILD_analyzeRecvPacket();
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
slotStatusNI = gRfuSlotStatusNI[i]; slotStatusNI = gRfuSlotStatusNI[i];
if (slotStatusNI->recv.state == SLOT_STATE_RECV_LAST && !((gRfuStatic->NIEndRecvFlag >> i) & 1)) if (slotStatusNI->recv.state == SLOT_STATE_RECV_LAST && !((gRfuStatic->NIEndRecvFlag >> i) & 1))
@ -1972,7 +1972,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
if (last_frame < llsf_p->frameSize) if (last_frame < llsf_p->frameSize)
return last_frame; return last_frame;
frames = 0; frames = 0;
for (i = 0; i < llsf_p->frameSize; i++) for (i = 0; i < llsf_p->frameSize; ++i)
frames |= *src++ << 8 * i; frames |= *src++ << 8 * i;
llsf_NI.recvFirst = (frames >> llsf_p->recvFirstShift) & llsf_p->recvFirstMask; llsf_NI.recvFirst = (frames >> llsf_p->recvFirstShift) & llsf_p->recvFirstMask;
llsf_NI.connSlotFlag = (frames >> llsf_p->connSlotFlagShift) & llsf_p->connSlotFlagMask; llsf_NI.connSlotFlag = (frames >> llsf_p->connSlotFlagShift) & llsf_p->connSlotFlagMask;
@ -1998,7 +1998,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
} }
else else
{ {
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
if (((gRfuSlotStatusNI[i]->send.bmSlot >> slot_id) & 1) if (((gRfuSlotStatusNI[i]->send.bmSlot >> slot_id) & 1)
&& ((gRfuLinkStatus->sendSlotNIFlag >> slot_id) & 1)) && ((gRfuLinkStatus->sendSlotNIFlag >> slot_id) & 1))
break; break;
@ -2013,7 +2013,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
if (conSlots) if (conSlots)
{ {
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; ++i)
{ {
if ((conSlots >> i) & 1) if ((conSlots >> i) & 1)
{ {
@ -2104,7 +2104,7 @@ static void rfu_STC_NI_receive_Sender(u8 NI_slot, u8 bm_flag, const struct RfuLo
NI_comm->phase = 0; NI_comm->phase = 0;
if (NI_comm->state == SLOT_STATE_SEND_START) if (NI_comm->state == SLOT_STATE_SEND_START)
{ {
for (i = 0; i < WINDOW_COUNT; i++) for (i = 0; i < WINDOW_COUNT; ++i)
{ {
NI_comm->n[i] = 1; NI_comm->n[i] = 1;
NI_comm->now_p[i] = NI_comm->src + NI_comm->payloadSize * i; NI_comm->now_p[i] = NI_comm->src + NI_comm->payloadSize * i;

View File

@ -208,13 +208,13 @@ void STWI_send_GameConfigREQ(const u8 *serial_gname, const u8 *uname)
*(u16 *)packetBytes = *(u16 *)serial_gname; *(u16 *)packetBytes = *(u16 *)serial_gname;
packetBytes += sizeof(u16); packetBytes += sizeof(u16);
serial_gname += sizeof(u16); serial_gname += sizeof(u16);
for (i = 0; i < 14; i++) for (i = 0; i < 14; ++i)
{ {
*packetBytes = *serial_gname; *packetBytes = *serial_gname;
++packetBytes; ++packetBytes;
++serial_gname; ++serial_gname;
} }
for (i = 0; i < 8; i++) for (i = 0; i < 8; ++i)
{ {
*packetBytes = *uname; *packetBytes = *uname;
++packetBytes; ++packetBytes;

View File

@ -186,7 +186,7 @@ static const u8 sText_PyramidFloor6[] = _("PYRAMID FLOOR 6");
static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7");
static const u8 sText_Pyramid[] = _("PYRAMID"); static const u8 sText_Pyramid[] = _("PYRAMID");
static const u8 *const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE + 1] = static const u8 * const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE + 1] =
{ {
sText_PyramidFloor1, sText_PyramidFloor1,
sText_PyramidFloor2, sText_PyramidFloor2,

View File

@ -46,7 +46,7 @@ static const u16 sDefaultBardSongLyrics[BARD_SONG_LENGTH] = {
EC_WORD_DANCE EC_WORD_DANCE
}; };
static const u8 *const sGiddyAdjectives[] = { static const u8 * const sGiddyAdjectives[] = {
GiddyText_SoPretty, GiddyText_SoPretty,
GiddyText_SoDarling, GiddyText_SoDarling,
GiddyText_SoRelaxed, GiddyText_SoRelaxed,
@ -60,7 +60,7 @@ static const u8 *const sGiddyAdjectives[] = {
// Non-random lines Giddy can say. Not all are strictly // Non-random lines Giddy can say. Not all are strictly
// questions, but most are, and the player will receive // questions, but most are, and the player will receive
// a Yes/No prompt afterwards regardless. // a Yes/No prompt afterwards regardless.
static const u8 *const sGiddyQuestions[GIDDY_MAX_QUESTIONS] = { static const u8 * const sGiddyQuestions[GIDDY_MAX_QUESTIONS] = {
GiddyText_ISoWantToGoOnAVacation, GiddyText_ISoWantToGoOnAVacation,
GiddyText_IBoughtCrayonsWith120Colors, GiddyText_IBoughtCrayonsWith120Colors,
GiddyText_WouldntItBeNiceIfWeCouldFloat, GiddyText_WouldntItBeNiceIfWeCouldFloat,

View File

@ -15,7 +15,7 @@ struct GFRomHeader
const struct CompressedSpriteSheet * monBackPics; const struct CompressedSpriteSheet * monBackPics;
const struct CompressedSpritePalette * monNormalPalettes; const struct CompressedSpritePalette * monNormalPalettes;
const struct CompressedSpritePalette * monShinyPalettes; const struct CompressedSpritePalette * monShinyPalettes;
const u8 *const * monIcons; const u8 * const * monIcons;
const u8 * monIconPaletteIds; const u8 * monIconPaletteIds;
const struct SpritePalette * monIconPalettes; const struct SpritePalette * monIconPalettes;
const u8 (* monSpeciesNames)[]; const u8 (* monSpeciesNames)[];
@ -62,7 +62,7 @@ struct GFRomHeader
u32 unk18; u32 unk18;
const struct BaseStats * baseStats; const struct BaseStats * baseStats;
const u8 (* abilityNames)[]; const u8 (* abilityNames)[];
const u8 *const * abilityDescriptions; const u8 * const * abilityDescriptions;
const struct Item * items; const struct Item * items;
const struct BattleMove * moves; const struct BattleMove * moves;
const struct CompressedSpriteSheet * ballGfx; const struct CompressedSpriteSheet * ballGfx;

View File

@ -84,7 +84,7 @@ static const u8 sScriptConditionTable[6][3] =
1, 0, 1, // != 1, 0, 1, // !=
}; };
static u8 *const sScriptStringVars[] = static u8 * const sScriptStringVars[] =
{ {
gStringVar1, gStringVar1,
gStringVar2, gStringVar2,

View File

@ -15,7 +15,7 @@
#include "task.h" #include "task.h"
#include "script_menu.h" #include "script_menu.h"
static const u8 *const sDefaultTraderNames[NUM_TRADER_ITEMS] = static const u8 * const sDefaultTraderNames[NUM_TRADER_ITEMS] =
{ {
gText_Tristan, gText_Tristan,
gText_Philip, gText_Philip,

View File

@ -2811,7 +2811,7 @@ class Renderer {
if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) { if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) {
popArgs -= 1; popArgs -= 1;
} }
for (unsigned int i = 0; i < popArgs; i++) { for (unsigned int i = 0; i < popArgs; ++i) {
m_stack.pop_back(); m_stack.pop_back();
} }
} }
@ -2925,7 +2925,7 @@ class Renderer {
void render_to(std::ostream& os, const Template& tmpl, const json& data) { void render_to(std::ostream& os, const Template& tmpl, const json& data) {
m_data = &data; m_data = &data;
for (size_t i = 0; i < tmpl.bytecodes.size(); i++) { for (size_t i = 0; i < tmpl.bytecodes.size(); ++i) {
const auto& bc = tmpl.bytecodes[i]; const auto& bc = tmpl.bytecodes[i];
switch (bc.op) { switch (bc.op) {

View File

@ -1438,7 +1438,7 @@ auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
priority_tag<2> /*unused*/) priority_tag<2> /*unused*/)
-> decltype(j.template get<T>(), void()) -> decltype(j.template get<T>(), void())
{ {
for (std::size_t i = 0; i < N; i++) for (std::size_t i = 0; i < N; ++i)
{ {
arr[i] = j.at(i).template get<T>(); arr[i] = j.at(i).template get<T>();
} }
@ -4301,7 +4301,7 @@ class binary_reader
if (len != std::size_t(-1)) if (len != std::size_t(-1))
{ {
for (std::size_t i = 0; i < len; i++) for (std::size_t i = 0; i < len; ++i)
{ {
if (JSON_UNLIKELY(not parse_cbor_internal())) if (JSON_UNLIKELY(not parse_cbor_internal()))
{ {
@ -4338,7 +4338,7 @@ class binary_reader
string_t key; string_t key;
if (len != std::size_t(-1)) if (len != std::size_t(-1))
{ {
for (std::size_t i = 0; i < len; i++) for (std::size_t i = 0; i < len; ++i)
{ {
get(); get();
if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
@ -4832,7 +4832,7 @@ class binary_reader
return false; return false;
} }
for (std::size_t i = 0; i < len; i++) for (std::size_t i = 0; i < len; ++i)
{ {
if (JSON_UNLIKELY(not parse_msgpack_internal())) if (JSON_UNLIKELY(not parse_msgpack_internal()))
{ {
@ -4855,7 +4855,7 @@ class binary_reader
} }
string_t key; string_t key;
for (std::size_t i = 0; i < len; i++) for (std::size_t i = 0; i < len; ++i)
{ {
get(); get();
if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key)))
@ -5190,7 +5190,7 @@ class binary_reader
{ {
if (size_and_type.second != 'N') if (size_and_type.second != 'N')
{ {
for (std::size_t i = 0; i < size_and_type.first; i++) for (std::size_t i = 0; i < size_and_type.first; ++i)
{ {
if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second))) if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second)))
{ {
@ -5201,7 +5201,7 @@ class binary_reader
} }
else else
{ {
for (std::size_t i = 0; i < size_and_type.first; i++) for (std::size_t i = 0; i < size_and_type.first; ++i)
{ {
if (JSON_UNLIKELY(not parse_ubjson_internal())) if (JSON_UNLIKELY(not parse_ubjson_internal()))
{ {
@ -5251,7 +5251,7 @@ class binary_reader
if (size_and_type.second != 0) if (size_and_type.second != 0)
{ {
for (std::size_t i = 0; i < size_and_type.first; i++) for (std::size_t i = 0; i < size_and_type.first; ++i)
{ {
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
{ {
@ -5266,7 +5266,7 @@ class binary_reader
} }
else else
{ {
for (std::size_t i = 0; i < size_and_type.first; i++) for (std::size_t i = 0; i < size_and_type.first; ++i)
{ {
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
{ {
@ -5356,7 +5356,7 @@ class binary_reader
{ {
// step 1: read input into array with system's byte order // step 1: read input into array with system's byte order
std::array<std::uint8_t, sizeof(NumberType)> vec; std::array<std::uint8_t, sizeof(NumberType)> vec;
for (std::size_t i = 0; i < sizeof(NumberType); i++) for (std::size_t i = 0; i < sizeof(NumberType); ++i)
{ {
get(); get();
if (JSON_UNLIKELY(not unexpect_eof(format, "number"))) if (JSON_UNLIKELY(not unexpect_eof(format, "number")))
@ -6705,7 +6705,7 @@ scan_number_done:
token_type return_type) token_type return_type)
{ {
assert(current == literal_text[0]); assert(current == literal_text[0]);
for (std::size_t i = 1; i < length; i++) for (std::size_t i = 1; i < length; ++i)
{ {
if (JSON_UNLIKELY(get() != literal_text[i])) if (JSON_UNLIKELY(get() != literal_text[i]))
{ {
@ -9235,7 +9235,7 @@ class json_pointer
else else
{ {
// iterate array and use index as reference string // iterate array and use index as reference string
for (std::size_t i = 0; i < value.m_value.array->size(); i++) for (std::size_t i = 0; i < value.m_value.array->size(); ++i)
{ {
flatten(reference_string + "/" + std::to_string(i), flatten(reference_string + "/" + std::to_string(i),
value.m_value.array->operator[](i), result); value.m_value.array->operator[](i), result);
@ -12183,7 +12183,7 @@ class serializer
// first n-1 elements // first n-1 elements
for (auto i = val.m_value.array->cbegin(); for (auto i = val.m_value.array->cbegin();
i != val.m_value.array->cend() - 1; i++) i != val.m_value.array->cend() - 1; ++i)
{ {
o->write_characters(indent_string.c_str(), new_indent); o->write_characters(indent_string.c_str(), new_indent);
dump(*i, true, ensure_ascii, indent_step, new_indent); dump(*i, true, ensure_ascii, indent_step, new_indent);
@ -12205,7 +12205,7 @@ class serializer
// first n-1 elements // first n-1 elements
for (auto i = val.m_value.array->cbegin(); for (auto i = val.m_value.array->cbegin();
i != val.m_value.array->cend() - 1; i++) i != val.m_value.array->cend() - 1; ++i)
{ {
dump(*i, false, ensure_ascii, indent_step, current_indent); dump(*i, false, ensure_ascii, indent_step, current_indent);
o->write_character(','); o->write_character(',');
@ -12302,7 +12302,7 @@ class serializer
std::size_t bytes_after_last_accept = 0; std::size_t bytes_after_last_accept = 0;
std::size_t undumped_chars = 0; std::size_t undumped_chars = 0;
for (std::size_t i = 0; i < s.size(); i++) for (std::size_t i = 0; i < s.size(); ++i)
{ {
const auto byte = static_cast<uint8_t>(s[i]); const auto byte = static_cast<uint8_t>(s[i]);