From f3e9fb4f707207854bd6d1a713a12f99ce192f43 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 16 Aug 2014 18:48:27 -0700 Subject: [PATCH] * Fix build --- Athena.pri | 2 +- include/Athena/Utility.hpp | 4 ++++ src/Athena/Utility.cpp | 4 ++-- src/Athena/ZQuestFileReader.cpp | 4 +--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Athena.pri b/Athena.pri index e3ac840..68c2863 100644 --- a/Athena.pri +++ b/Athena.pri @@ -45,7 +45,7 @@ SOURCES += \ $$PWD/src/sha1.cpp \ $$PWD/src/aes.c \ $$PWD/src/lzo.c \ - Athena/src/Athena/PHYSFSFileReader.cpp + $$PWD/src/Athena/PHYSFSFileReader.cpp win32:SOURCES += $$PWD/src/win32_largefilewrapper.c HEADERS += \ diff --git a/include/Athena/Utility.hpp b/include/Athena/Utility.hpp index 2e3f910..a636d9b 100644 --- a/include/Athena/Utility.hpp +++ b/include/Athena/Utility.hpp @@ -40,7 +40,11 @@ double swapDouble(double val); bool isSystemBigEndian(); +<<<<<<< Updated upstream void fillRandom(atUint8 * rndArea, atUint64 count); +======= +void fillRandom(atUint8 * rndArea, atUint8 count); +>>>>>>> Stashed changes std::vector split(const std::string &s, char delim); std::string join(const std::vector& elems, const std::string& delims); diff --git a/src/Athena/Utility.cpp b/src/Athena/Utility.cpp index 62c65e3..b6ed91b 100644 --- a/src/Athena/Utility.cpp +++ b/src/Athena/Utility.cpp @@ -29,7 +29,7 @@ namespace utility { bool isEmpty(atInt8* buf, atUint32 size) { - return buf[0] == 0 && !memcmp(buf, buf + 1, size - 1); + return !memcmp(buf, buf + 1, size - 1); } atUint16 swapU16(atUint16 val ) @@ -73,7 +73,7 @@ atInt64 swap64(atInt64 val) bool isSystemBigEndian() { - atUint8* test = (atUint8*)"\xFE\xFF"; + static atUint8* test = (atUint8*)"\xFE\xFF"; return (*(atUint16*)test == 0xFEFF); } diff --git a/src/Athena/ZQuestFileReader.cpp b/src/Athena/ZQuestFileReader.cpp index a31da79..683a144 100644 --- a/src/Athena/ZQuestFileReader.cpp +++ b/src/Athena/ZQuestFileReader.cpp @@ -46,7 +46,7 @@ ZQuestFile *ZQuestFileReader::read() ZQuestFile::Game game = ZQuestFile::NoGame; std::string gameString; atUint16 BOM; - atUint32 checksum; + atUint32 checksum = 0; atUint8* data; magic = base::readUint32(); @@ -81,7 +81,6 @@ ZQuestFile *ZQuestFileReader::read() { game = (ZQuestFile::Game)base::readUint32(); BOM = base::readUint16(); - std::cerr << "Test" << std::endl; base::seek(0x0A); } @@ -110,7 +109,6 @@ ZQuestFile *ZQuestFileReader::read() { delete[] dst; delete[] data; - // TODO: Make proper exception THROW_INVALID_DATA_EXCEPTION("Error decompressing data"); }