Add necessary headers and use %zu (#63)

This commit is contained in:
AltoXorg 2024-07-28 23:53:10 +08:00 committed by GitHub
parent 04c7d45920
commit 8747507cf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include <filesystem>
#include <fstream>
#include <list>
#include "../../contrib/xxHash/xxh3.h"
#include "../../common/rt64_load_types.cpp"
@ -345,7 +346,7 @@ void addRiceHash(const std::filesystem::path &directory, const std::string &hash
// Rice expects to hash at least this many bytes, even if it leaks into other parts of RAM.
uint32_t expectedSize = (height - 1) * bpl + (width << drawTile.siz >> 1);
if (expectedSize > rdramBytes.size()) {
fprintf(stderr, "Unable to hash %s. Expected %d bytes but got %llu bytes (%dX%d).\n", hashNameWithSuffix.c_str(), expectedSize, rdramBytes.size(), width, height);
fprintf(stderr, "Unable to hash %s. Expected %d bytes but got %zu bytes (%dX%d).\n", hashNameWithSuffix.c_str(), expectedSize, rdramBytes.size(), width, height);
return;
}
@ -615,4 +616,4 @@ int main(int argc, char *argv[]) {
}
return 0;
}
}

View File

@ -2,11 +2,16 @@
// RT64
//
#include <atomic>
#include <condition_variable>
#include <filesystem>
#include <fstream>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <set>
#include <thread>
#include <ddspp/ddspp.h>
#include <miniz/miniz.h>
@ -530,4 +535,4 @@ int main(int argc, char *argv[]) {
}
return 0;
}
}