Fix remaining cpp20 issues (#3375)

This commit is contained in:
Ziemas 2024-02-18 02:16:46 +01:00 committed by GitHub
parent 4afefc5a82
commit 0011fb4b2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 10 additions and 17 deletions

View file

@ -1,6 +1,3 @@
# We define our own compilation flags here.
set(CMAKE_CXX_STANDARD 17)
# Set a more convenient ARM flag
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(ARM64_ARCH TRUE)

View file

@ -53,8 +53,8 @@ struct Ptr {
Ptr operator+(s32 diff) { return Ptr(offset + diff); }
s32 operator-(Ptr<T> x) { return offset - x.offset; }
Ptr operator-(s32 diff) { return Ptr(offset - diff); }
bool operator==(const Ptr<T>& x) { return offset == x.offset; }
bool operator!=(const Ptr<T>& x) { return offset != x.offset; }
bool operator==(const Ptr<T>& x) const { return offset == x.offset; }
bool operator!=(const Ptr<T>& x) const { return offset != x.offset; }
/*!
* Convert to a C pointer.

View file

@ -60,9 +60,9 @@ void mc_print(const std::string& str, Args&&... args) {
if (memcard_debug) {
fmt::print("[MC] ");
if (!str.empty() && str.back() == '\n') {
fmt::print(str, std::forward<Args>(args)...);
fmt::print(fmt::runtime(str), std::forward<Args>(args)...);
} else {
fmt::print(str + '\n', std::forward<Args>(args)...);
fmt::print(fmt::runtime(str + '\n'), std::forward<Args>(args)...);
}
}
}

View file

@ -1,5 +1,3 @@
set(CMAKE_CXX_STANDARD 17)
set(SOUND_SOURCES
989snd/player.cpp
989snd/midi_handler.cpp

View file

@ -1,5 +1,3 @@
set(CMAKE_CXX_STANDARD 17)
include(${CMAKE_CURRENT_LIST_DIR}/goalc/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/offline/CMakeLists.txt)

View file

@ -37,7 +37,7 @@ std::string escaped_string(const std::string& in) {
std::string CompilerTestRunner::test_file_name(std::string templateStr) {
const ::testing::TestInfo* const test_info =
::testing::UnitTest::GetInstance()->current_test_info();
std::string outFile = fmt::format(templateStr, test_info->name());
std::string outFile = fmt::format(fmt::runtime(templateStr), test_info->name());
std::replace(outFile.begin(), outFile.end(), '/', '_');
return outFile;
}

View file

@ -166,7 +166,7 @@ struct VectorFloatTestCase_TwoOperand : VectorFloatTestCase {
input1.setJson(data, "v1");
input2.setJson(data, "v2");
dest.setJson(data, "dest");
data["operation"] = fmt::format(func);
data["operation"] = fmt::format("{}", func);
if (destinationMask == -1) {
data["destinationMask"] = false;
} else {
@ -301,7 +301,7 @@ struct VectorFloatTestCase_SingleOperand : VectorFloatTestCase {
void setJson(nlohmann::json& data, std::string func) {
input1.setJson(data, "v1");
dest.setJson(data, "dest");
data["operation"] = fmt::format(func);
data["operation"] = fmt::format("{}", func);
if (destinationMask == -1) {
data["destinationMask"] = false;
} else {
@ -377,7 +377,7 @@ struct VectorFloatTestCase_TwoOperandACC : VectorFloatTestCase {
input2.setJson(data, "v2");
acc.setJson(data, "acc");
dest.setJson(data, "dest");
data["operation"] = fmt::format(func);
data["operation"] = fmt::format("{}", func);
if (destinationMask == -1) {
data["destinationMask"] = false;
} else {
@ -473,7 +473,7 @@ struct VectorFloatTestCase_TwoOperandQuotient : VectorFloatTestCase {
input1.setJson(data, "v1");
input2.setJson(data, "v2");
dest.setJson(data, "dest");
data["operation"] = fmt::format(func);
data["operation"] = fmt::format("{}", func);
data["ftf"] = fmt::format("{:b}", ftf);
data["fsf"] = fmt::format("{:b}", fsf);
}
@ -542,7 +542,7 @@ struct VectorFloatTestCase_OneOperandQuotient : VectorFloatTestCase {
void setJson(nlohmann::json& data, std::string func) {
input1.setJson(data, "v1");
dest.setJson(data, "dest");
data["operation"] = fmt::format(func);
data["operation"] = fmt::format("{}", func);
data["ftf"] = fmt::format("{:b}", ftf);
}
};