Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up save nomenclature #239

Open
luckytyphlosion opened this issue Aug 22, 2023 · 1 comment
Open

Fix up save nomenclature #239

luckytyphlosion opened this issue Aug 22, 2023 · 1 comment

Comments

@luckytyphlosion
Copy link
Member

It makes no sense. There are four structs: SaveArrayHeader, SaveArrayFooter, SaveChunkHeader, SaveChunkFooter. SaveChunkHeader isn't even defined in the same place as SaveChunkFooter.

static void CreateChunkFooter(SaveData *saveData, void *data, int idx, u32 size) {
    struct SaveArrayFooter *footer;

    footer = (struct SaveArrayFooter *)((u8 *)data + size);

    footer->magic = SAVE_CHUNK_MAGIC;
    footer->saveno = saveData->lastGoodSaveNo + 1;
    footer->size = size;
    footer->idx = idx;
    footer->crc = GF_CalcCRC16(data, size + offsetof(struct SaveArrayFooter, crc));
}

The function is named CreateChunkFooter yet it doesn't even use SaveChunkFooter.

Probably a bunch of other stuff, I could spend 15 minutes and find more inconsistencies but I don't think it's necessary to point out more stuff.

@red031000
Copy link
Member

makes sense to me 🥺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants