Fix fmt errors.

This commit is contained in:
Jcw87 2020-02-15 12:18:52 -08:00
parent d0eef5eab7
commit b112d0ec58
14 changed files with 39 additions and 39 deletions

View File

@ -9,7 +9,7 @@ ALTTPFile::ALTTPFile(std::vector<ALTTPQuest*> quests, std::vector<ALTTPQuest*> b
void ALTTPFile::setQuest(atUint32 id, ALTTPQuest* val) {
if (id > m_quests.size()) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return;
}
@ -19,7 +19,7 @@ void ALTTPFile::setQuest(atUint32 id, ALTTPQuest* val) {
std::vector<ALTTPQuest*> ALTTPFile::questList() const { return m_quests; }
ALTTPQuest* ALTTPFile::quest(atUint32 id) const {
if (id > m_quests.size()) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return nullptr;
}

View File

@ -211,7 +211,7 @@ ALTTPDungeonItemFlags ALTTPFileReader::readDungeonFlags() {
flags.HyruleCastle = (flagsByte >> 6) & 1;
flags.SewerPassage = (flagsByte >> 7) & 1;
atDebug("{:x} {:x}", flags.flags1, flags.flags2);
atDebug(fmt("{:x} {:x}"), flags.flags1, flags.flags2);
return flags;
}

View File

@ -29,7 +29,7 @@ std::vector<ALTTPOverworldEvent*> ALTTPQuest::overworldEvents() const { return m
ALTTPOverworldEvent* ALTTPQuest::overworldEvent(atUint32 id) const {
if (id > m_overworldEvents.size() - 1) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return nullptr;
}
@ -126,7 +126,7 @@ void ALTTPQuest::setDungeonKeys(std::vector<atUint8> val) { m_dungeonKeys = val;
void ALTTPQuest::setDungeonKeys(atUint32 id, atUint8 val) {
if (id > m_dungeonKeys.size() - 1) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return;
}
@ -135,7 +135,7 @@ void ALTTPQuest::setDungeonKeys(atUint32 id, atUint8 val) {
atUint8 ALTTPQuest::dungeonKeys(atUint32 id) const {
if (id > m_dungeonKeys.size() - 1) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return 0;
}
@ -176,7 +176,7 @@ void ALTTPQuest::setOldManFlags(std::vector<atUint8> flags) { m_oldManFlags = fl
void ALTTPQuest::setOldManFlag(atUint32 id, atUint8 val) {
if (id > m_oldManFlags.size() - 1) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return;
}
@ -185,7 +185,7 @@ void ALTTPQuest::setOldManFlag(atUint32 id, atUint8 val) {
atUint8 ALTTPQuest::oldManFlag(atUint32 id) {
if (id > m_oldManFlags.size() - 1) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return 0;
}
return m_oldManFlags[id];
@ -201,7 +201,7 @@ void ALTTPQuest::setUnknown1(std::vector<atUint8> flags) { m_unknown1 = flags; }
void ALTTPQuest::setUnknown1(atUint32 id, atUint8 val) {
if (id > m_unknown1.size()) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return;
}
@ -210,7 +210,7 @@ void ALTTPQuest::setUnknown1(atUint32 id, atUint8 val) {
atUint8 ALTTPQuest::unknown1(atUint32 id) {
if (id > m_unknown1.size()) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return 0;
}
@ -223,7 +223,7 @@ void ALTTPQuest::setPlayerName(std::vector<atUint16> playerName) { m_playerName
void ALTTPQuest::setPlayerName(const std::string& playerName) {
if (playerName == std::string() || playerName.size() > 6) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return;
}
@ -401,7 +401,7 @@ void ALTTPQuest::setDungeonDeathTotals(std::vector<atUint16> val) { m_dungeonDea
void ALTTPQuest::setDungeonDeathTotal(atUint32 id, atUint16 val) {
if (id > m_dungeonDeathTotals.size()) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return;
}
@ -410,7 +410,7 @@ void ALTTPQuest::setDungeonDeathTotal(atUint32 id, atUint16 val) {
atUint16 ALTTPQuest::dungeonDeathTotal(atUint32 id) const {
if (id > m_dungeonDeathTotals.size()) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return 0;
}

View File

@ -19,7 +19,7 @@ void SkywardSwordFile::addQuest(athena::SkywardSwordQuest* q) {
SkywardSwordQuest* SkywardSwordFile::quest(atUint32 id) {
if (id > m_quests.size() - 1) {
atWarning("index out of range");
atWarning(fmt("index out of range"));
return nullptr;
}

View File

@ -17,14 +17,14 @@ SkywardSwordFile* SkywardSwordFileReader::read() {
SkywardSwordFile* file = NULL;
if (length() != 0xFBE0) {
atError("File not the expected size of 0xFBE0");
atError(fmt("File not the expected size of 0xFBE0"));
return nullptr;
}
atUint32 magic = readUint32();
if (magic != SkywardSwordFile::USMagic && magic != SkywardSwordFile::JAMagic && magic != SkywardSwordFile::EUMagic) {
atError("Not a valid Skyward Sword save file");
atError(fmt("Not a valid Skyward Sword save file"));
return nullptr;
}
@ -32,7 +32,7 @@ SkywardSwordFile* SkywardSwordFileReader::read() {
atUint32 headerSize = readUint32(); // Seems to be (headerSize - 1)
if (headerSize != 0x1D) {
atError("Invalid header size, Corrupted data?");
atError(fmt("Invalid header size, Corrupted data?"));
return nullptr;
}

View File

@ -14,7 +14,7 @@ SkywardSwordFileWriter::SkywardSwordFileWriter(const std::string& filename) : Me
void SkywardSwordFileWriter::write(SkywardSwordFile* file) {
if (!file) {
atError("file cannot be NULL");
atError(fmt("file cannot be NULL"));
return;
}
@ -31,7 +31,7 @@ void SkywardSwordFileWriter::write(SkywardSwordFile* file) {
for (SkywardSwordQuest* q : quests) {
if (q->length() != 0x53C0) {
atError("q->data() not 0x53C0 bytes in length");
atError(fmt("q->data() not 0x53C0 bytes in length"));
return;
}

View File

@ -43,7 +43,7 @@ atUint8* SkywardSwordQuest::skipData() const { return m_skipData.get(); }
void SkywardSwordQuest::setPlayerName(const std::string& name) {
if (name.length() > 8)
atDebug("WARNING: name cannot be greater than 8 characters, automatically truncating");
atDebug(fmt("WARNING: name cannot be greater than 8 characters, automatically truncating"));
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(name.c_str());
for (atUint32 i = 0; i < 8; i++) {
@ -57,7 +57,7 @@ void SkywardSwordQuest::setPlayerName(const std::string& name) {
utf8proc_int32_t wc;
utf8proc_ssize_t len = utf8proc_iterate(buf, -1, &wc);
if (len < 0) {
atError("invalid UTF-8 string");
atError(fmt("invalid UTF-8 string"));
return;
}
buf += len;

View File

@ -16,7 +16,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile() {
atUint32 magic = readUint32();
if (magic != Sakura::SpriteFile::Magic) {
atError("Not a valid Sakura Sprite container");
atError(fmt("Not a valid Sakura Sprite container"));
return nullptr;
}
@ -24,7 +24,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile() {
// TODO: Make this more verbose
if (version != Sakura::SpriteFile::Version) {
atError("Unsupported version");
atError(fmt("Unsupported version"));
return nullptr;
}
@ -51,7 +51,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile() {
// which require data to be 32 byte aligned, or it causes some issues.
// It's also convenient to have this, for later expansion.
atUint32 reserved = readUint32();
UNUSED(reserved);
//UNUSED(reserved);
// Next we have to load the textures
// If we tried to add them one at a time to the sprite container
@ -175,7 +175,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile() {
#endif
else {
atError("Sprite names cannot be empty");
atError(fmt("Sprite names cannot be empty"));
return nullptr;
}
}

View File

@ -11,7 +11,7 @@ SpriteFileWriter::SpriteFileWriter(std::string_view filepath) : MemoryCopyWriter
void SpriteFileWriter::writeFile(Sakura::SpriteFile* file) {
if (!file) {
atError("file cannot be NULL");
atError(fmt("file cannot be NULL"));
return;
}

View File

@ -78,7 +78,7 @@ bool WiiFile::isFile() const { return (m_type == WiiFile::File); }
void WiiFile::addChild(WiiFile* file) {
if (!isDirectory()) {
atWarning("{} is not a directory", filename());
atWarning(fmt("{} is not a directory"), filename());
return;
}

View File

@ -27,14 +27,14 @@ std::unique_ptr<WiiSave> WiiSaveReader::readSave() {
WiiSave* ret = new WiiSave;
if (length() < 0xF0C0) {
atError("Not a valid WiiSave");
atError(fmt("Not a valid WiiSave"));
return nullptr;
}
WiiBanner* banner = this->readBanner();
if (!banner) {
atError("Invalid banner");
atError(fmt("Invalid banner"));
return nullptr;
}
@ -42,14 +42,14 @@ std::unique_ptr<WiiSave> WiiSaveReader::readSave() {
atUint32 bkVer = readUint32();
if (bkVer != 0x00000070) {
atError("Invalid BacKup header size");
atError(fmt("Invalid BacKup header size"));
return nullptr;
}
atUint32 bkMagic = readUint32();
if (bkMagic != 0x426B0001) {
atError("Invalid BacKup header magic");
atError(fmt("Invalid BacKup header magic"));
return nullptr;
}
@ -130,7 +130,7 @@ WiiBanner* WiiSaveReader::readBanner() {
std::cerr << std::endl;
setData(oldData, oldLen);
seek(oldPos, SeekOrigin::Begin);
atError("MD5 Mismatch");
atError(fmt("MD5 Mismatch"));
return nullptr;
}
@ -158,7 +158,7 @@ WiiBanner* WiiSaveReader::readBanner() {
// Make sure to reset m_reader values back to the old ones.
setData(oldData, oldLen);
seek(oldPos, SeekOrigin::Begin);
atError("Invalid Header Magic");
atError(fmt("Invalid Header Magic"));
return nullptr;
}

View File

@ -30,7 +30,7 @@ WiiSaveWriter::WiiSaveWriter(const std::string& filename) : MemoryCopyWriter(fil
bool WiiSaveWriter::writeSave(WiiSave* save, atUint8* macAddress, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig,
atUint32 ngKeyId, const std::string& filepath) {
if (!save) {
atError("save cannot be NULL");
atError(fmt("save cannot be NULL"));
return false;
}

View File

@ -23,14 +23,14 @@ ZQuestFile* ZQuestFileReader::read() {
magic = readUint32();
if ((magic & 0x00FFFFFF) != (ZQuestFile::Magic & 0x00FFFFFF)) {
atError("Not a valid ZQuest file");
atError(fmt("Not a valid ZQuest file"));
return nullptr;
}
version = readUint32();
if (version > ZQuestFile::Version) {
atError("Unsupported ZQuest version");
atError(fmt("Unsupported ZQuest version"));
return nullptr;
}
@ -60,7 +60,7 @@ ZQuestFile* ZQuestFileReader::read() {
if (version >= ZQUEST_VERSION_CHECK(2, 0, 0)) {
if (checksum != athena::checksums::crc32(data.get(), compressedLen)) {
atError("Checksum mismatch, data corrupt");
atError(fmt("Checksum mismatch, data corrupt"));
return nullptr;
}
} else {
@ -75,7 +75,7 @@ ZQuestFile* ZQuestFileReader::read() {
if (dstLen != uncompressedLen) {
delete[] dst;
atError("Error decompressing data");
atError(fmt("Error decompressing data"));
return nullptr;
}

View File

@ -11,7 +11,7 @@ ZQuestFileWriter::ZQuestFileWriter(const std::string& filename) : MemoryCopyWrit
void ZQuestFileWriter::write(ZQuestFile* quest, bool compress) {
if (!quest) {
atError("quest cannot be NULL");
atError(fmt("quest cannot be NULL"));
return;
}