Skip to content

Commit

Permalink
rename check info->valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ravepossum committed Apr 1, 2024
1 parent 784d09b commit bd65ac1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/savedata.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ typedef struct SaveData {
} SaveData;

typedef struct SaveCheckInfo {
BOOL isValid;
BOOL valid;
u32 globalCounter;
u32 blockCounter;
} SaveCheckInfo;
Expand Down
10 changes: 5 additions & 5 deletions src/savedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void SaveData_SaveStateCancel (SaveData *saveData)

static void SaveData_CheckInfoInit (SaveCheckInfo *checkInfo)
{
checkInfo->isValid = FALSE;
checkInfo->valid = FALSE;
checkInfo->globalCounter = 0;
checkInfo->blockCounter = 0;
}
Expand Down Expand Up @@ -360,7 +360,7 @@ static void SaveBlockFooter_CheckInfo (SaveCheckInfo *checkInfo, SaveData *saveD
{
SaveBlockFooter *footer = SaveBlockFooter_Ptr(saveData, bodyAddress, blockID);

checkInfo->isValid = SaveBlockFooter_Validate(saveData, bodyAddress, blockID);
checkInfo->valid = SaveBlockFooter_Validate(saveData, bodyAddress, blockID);
checkInfo->globalCounter = footer->saveCounter;
checkInfo->blockCounter = footer->blockCounter;
}
Expand Down Expand Up @@ -399,7 +399,7 @@ static int SaveCheckInfo_CompareSectors (const SaveCheckInfo *checkInfo1, const
int globalDiff = SaveCheckInfo_CompareCounters(checkInfo1->globalCounter, checkInfo2->globalCounter);
int blockDiff = SaveCheckInfo_CompareCounters(checkInfo1->blockCounter, checkInfo2->blockCounter);

if (checkInfo1->isValid && checkInfo2->isValid) {
if (checkInfo1->valid && checkInfo2->valid) {
if (globalDiff > 0) {
GF_ASSERT(blockDiff > 0);
*currentSector = SECTOR_ID_PRIMARY;
Expand All @@ -421,11 +421,11 @@ static int SaveCheckInfo_CompareSectors (const SaveCheckInfo *checkInfo1, const

return SECTOR_RESULT_VALID;

} else if (checkInfo1->isValid && !checkInfo2->isValid) {
} else if (checkInfo1->valid && !checkInfo2->valid) {
*currentSector = SECTOR_ID_PRIMARY;
*staleSector = SECTOR_ID_ERROR;
return SECTOR_RESULT_PARTIAL_VALID;
} else if (!checkInfo1->isValid && checkInfo2->isValid) {
} else if (!checkInfo1->valid && checkInfo2->valid) {
*currentSector = SECTOR_ID_BACKUP;
*staleSector = SECTOR_ID_ERROR;
return SECTOR_RESULT_PARTIAL_VALID;
Expand Down

0 comments on commit bd65ac1

Please sign in to comment.