Wrap long lines to fit within 80 columns across the codebase

Pure whitespace/line-break reformatting (braces, newlines, and line
continuations matching this codebase's existing wrap conventions) - no
logic, string content, or identifiers changed anywhere. Confirmed via
diff against the pre-change tree and by rebuilding + re-running the
affected test suites, which produce identical pass/fail results.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-09-05 13:13:10 -05:00
co-authored by Claude Sonnet 5
parent de53bebeb8
commit cebd3d81e7
70 changed files with 1025 additions and 425 deletions
+32 -12
View File
@@ -17,7 +17,8 @@ static const cutsceneitem_t CUTSCENE_TEST_SCRATCH_ITEMS[] = {
// reach PRE_ROUND on its own to satisfy the wait.
CUTSCENE_BATTLE_WAIT_STATE(BATTLE_STATE_PRE_ROUND),
CUTSCENE_SET_PAUSE(CUTSCENE_PAUSE_BATTLE),
CUTSCENE_BATTLE_FORCE_ACTION(2, 0),// enemy (slot 2) forced onto allyA (slot 0)
// enemy (slot 2) forced onto allyA (slot 0)
CUTSCENE_BATTLE_FORCE_ACTION(2, 0),
CUTSCENE_SET_PAUSE(CUTSCENE_PAUSE_NONE)
};
static const cutscene_t CUTSCENE_TEST_SCRATCH = {
@@ -45,8 +46,12 @@ static void test_battleStartEntersOpeningThenPreRound(void **state) {
battleInit();
addFighter(BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 10, 0, 10, 20);
addFighter(BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 10, 0, 5, 20);
addFighter(
BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 10, 0, 10, 20
);
addFighter(
BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 10, 0, 5, 20
);
battleStart(BATTLE_ENCOUNTER_REGULAR, true);
assert_int_equal(BATTLE.state, BATTLE_STATE_OPENING);
@@ -231,8 +236,12 @@ static void test_battleFleeEndsInStateEndedImmediately(void **state) {
battleInit();
addFighter(BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 5, 0, 10, 20);
addFighter(BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 5, 0, 5, 20);
addFighter(
BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 5, 0, 10, 20
);
addFighter(
BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 5, 0, 5, 20
);
battleStart(BATTLE_ENCOUNTER_REGULAR, true);
battleUpdate();// OPENING -> PRE_ROUND
@@ -247,8 +256,12 @@ static void test_battleFleeUnavailableIsIgnored(void **state) {
battleInit();
addFighter(BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 5, 0, 10, 20);
addFighter(BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 5, 0, 5, 20);
addFighter(
BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 5, 0, 10, 20
);
addFighter(
BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 5, 0, 5, 20
);
battleStart(BATTLE_ENCOUNTER_REGULAR, false);
battleUpdate();// OPENING -> PRE_ROUND
@@ -279,7 +292,9 @@ static void test_battleOnStateChangedFiresAcrossFullRound(void **state) {
stateChangedCount = 0;
BATTLE.onStateChanged = recordStateChanged;
addFighter(BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 1, 0, 10, 100);
addFighter(
BATTLE_FIGHTER_TEAM_ALLY, BATTLE_FIGHTER_CONTROLLER_PLAYER, 1, 0, 10, 100
);
battlefighter_t *enemy = addFighter(
BATTLE_FIGHTER_TEAM_ENEMY, BATTLE_FIGHTER_CONTROLLER_AI, 1, 0, 5, 100
);
@@ -410,10 +425,13 @@ static void test_battleCutsceneForceActionOverridesTarget(void **state) {
battlePlayerAttack(enemy->id);// allyA -> AI_SELECTION would be next...
assert_ptr_equal(battleGetCurrentFighter(), allyB);
battlePlayerAttack(enemy->id);// ...but AI_SELECTION must skip the enemy,
assert_int_equal(BATTLE.state, BATTLE_STATE_AI_SELECTION);// since it's decided
// since it's decided
assert_int_equal(BATTLE.state, BATTLE_STATE_AI_SELECTION);
battleUpdate();// AI_SELECTION: enemy already decided, skipped -> MOVES_EXECUTING
assert_int_equal(BATTLE.actions[enemy->id].targetIndex, allyA->id);// untouched
// AI_SELECTION: enemy already decided, skipped -> MOVES_EXECUTING
battleUpdate();
// untouched
assert_int_equal(BATTLE.actions[enemy->id].targetIndex, allyA->id);
battleUpdate();// allyA attacks enemy
battleUpdate();// allyB attacks enemy
@@ -435,7 +453,9 @@ int main(int argc, char** argv) {
cmocka_unit_test(test_battleFleeEndsInStateEndedImmediately),
cmocka_unit_test(test_battleFleeUnavailableIsIgnored),
cmocka_unit_test(test_battleOnStateChangedFiresAcrossFullRound),
cmocka_unit_test(test_battleOnActionDecidedFiresPerFighterRegardlessOfSource),
cmocka_unit_test(
test_battleOnActionDecidedFiresPerFighterRegardlessOfSource
),
cmocka_unit_test(test_battleCutsceneForceActionOverridesTarget),
};
+2 -1
View File
@@ -54,7 +54,8 @@ static void test_cutsceneCallbackFiresOnStartWithUserData(void **state) {
static void test_cutsceneCallbackNullIsNoop(void **state) {
callbackCallCount = 0;
cutsceneitem_t item = { .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = NULL };
cutsceneitem_t item =
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = NULL };
cutsceneitemdata_t data;
cutsceneCallbackStart(&item, &data);// should not crash
+5 -2
View File
@@ -60,7 +60,8 @@ static void test_cutsceneMapAreaRemoveResolvesLastCreatedSentinel(
cutsceneMapAreaAddStart(&addItem, &data);
uint8_t id = CUTSCENE_SYSTEM.areaLastCreated;
cutsceneitem_t removeItem = CUTSCENE_MAP_AREA_REMOVE(CUTSCENE_AREA_LAST_CREATED);
cutsceneitem_t removeItem =
CUTSCENE_MAP_AREA_REMOVE(CUTSCENE_AREA_LAST_CREATED);
cutsceneMapAreaRemoveStart(&removeItem, &data);
assert_null(MAP_AREAS[id].callback);
}
@@ -135,7 +136,9 @@ int main(int argc, char** argv) {
cmocka_unit_test(test_cutsceneMapAreaRemoveClearsSlot),
cmocka_unit_test(test_cutsceneMapAreaRemoveResolvesLastCreatedSentinel),
cmocka_unit_test(test_cutsceneMapAreaWaitCompletesWhenTriggerCountChanges),
cmocka_unit_test(test_cutsceneMapAreaWaitCompletesWhenAnyWatchedAreaChanges),
cmocka_unit_test(
test_cutsceneMapAreaWaitCompletesWhenAnyWatchedAreaChanges
),
cmocka_unit_test(test_cutsceneMapAreaWaitResolvesLastCreatedSentinel),
};
+3 -1
View File
@@ -126,7 +126,9 @@ static void test_cutsceneSystemGetEntityDirectIndexUpdatesLastRef(
entity_t *resolved = cutsceneSystemGetEntity(2);
assert_ptr_equal(resolved, &ENTITIES[2]);
// Resolving by direct index also updates LAST_REF.
assert_ptr_equal(cutsceneSystemGetEntity(CUTSCENE_ENTITY_LAST_REF), &ENTITIES[2]);
assert_ptr_equal(
cutsceneSystemGetEntity(CUTSCENE_ENTITY_LAST_REF), &ENTITIES[2]
);
}
static void test_cutsceneSystemGetAreaId(void **state) {
+3 -1
View File
@@ -10,7 +10,9 @@
#include "rpg/overworld/map.h"
#include "rpg/overworld/worldpos.h"
static void setTile(const worldpos_t pos, const tileshape_t shape, const uint8_t z) {
static void setTile(
const worldpos_t pos, const tileshape_t shape, const uint8_t z
) {
chunktileindex_t index = worldPosToChunkTileIndex(&pos);
MAP.chunks[0].tiles[index] = (tile_t){ .shape = shape, .z = z };
}
+3 -1
View File
@@ -57,7 +57,9 @@ static void test_entityInteractWithPrintTurnsNpcToFacePlayer(void **state) {
entityInteractWith(player, target);
assert_true(uiTextboxMainIsActive());
assert_int_equal(target->data.npc.interactState, NPC_INTERACT_STATE_CONVERSING);
assert_int_equal(
target->data.npc.interactState, NPC_INTERACT_STATE_CONVERSING
);
// NPC turns to face the opposite of the player's facing direction.
assert_int_equal(target->direction, entityDirGetOpposite(player->direction));
}
+6 -2
View File
@@ -33,7 +33,9 @@ static void test_mapAreaInit(void **state) {
const worldpos_t max = { 0, 0, 0 };
// min/max should be normalized regardless of argument order.
mapAreaInit(&area, min, max, recordCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL);
mapAreaInit(
&area, min, max, recordCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
assert_int_equal(area.min.x, 0);
assert_int_equal(area.min.y, 0);
assert_int_equal(area.max.x, 5);
@@ -56,7 +58,9 @@ static void test_mapAreaIsInside(void **state) {
assert_true(mapAreaIsInside(&area, (worldpos_t){ 5, 5, 0 }));
assert_true(mapAreaIsInside(&area, (worldpos_t){ 0, 0, 0 }));// inclusive min
assert_true(mapAreaIsInside(&area, (worldpos_t){ 10, 10, 0 }));// inclusive max
assert_true(
mapAreaIsInside(&area, (worldpos_t){ 10, 10, 0 })
);// inclusive max
assert_false(mapAreaIsInside(&area, (worldpos_t){ 11, 5, 0 }));
assert_false(mapAreaIsInside(&area, (worldpos_t){ 5, 5, 1 }));
}