clang format fixes etc.

This commit is contained in:
Hamish Milne 2020-03-31 18:27:33 +01:00
parent 92640fc29c
commit f156fdd332
7 changed files with 30 additions and 16 deletions

View file

@ -5,16 +5,34 @@
#pragma once #pragma once
#include <boost/icl/interval_set.hpp> #include <boost/icl/interval_set.hpp>
#include <boost/serialization/split_free.hpp>
#include "common/serialization/boost_discrete_interval.hpp" #include "common/serialization/boost_discrete_interval.hpp"
namespace boost::serialization { namespace boost::serialization {
template <class Archive, class T> template <class Archive, class T>
void serialize(Archive& ar, boost::icl::interval_set<T>& obj, const unsigned int file_version) { void save(Archive& ar, const boost::icl::interval_set<T>& set, const unsigned int file_version) {
using IntervalSet = boost::icl::interval_set<T>; ar << static_cast<u64>(set.size());
// This works because interval_set has exactly one member of type ImplSetT for (auto& v : set) {
static_assert(std::is_standard_layout_v<IntervalSet>); ar << v;
ar&*(reinterpret_cast<typename IntervalSet::ImplSetT*>(&obj)); }
}
template <class Archive, class T>
void load(Archive& ar, boost::icl::interval_set<T>& set, const unsigned int file_version) {
u64 count{};
ar >> count;
set.clear();
for (u64 i = 0; i < count; i++) {
T value{};
ar >> value;
set.insert(value);
}
}
template <class Archive, class T>
void serialize(Archive& ar, boost::icl::interval_set<T>& set, const unsigned int file_version) {
boost::serialization::split_free(ar, set, file_version);
} }
} // namespace boost::serialization } // namespace boost::serialization

View file

@ -5,7 +5,6 @@
#pragma once #pragma once
#include <optional> #include <optional>
#include <type_traits>
#include <boost/icl/interval_set.hpp> #include <boost/icl/interval_set.hpp>
#include <boost/serialization/set.hpp> #include <boost/serialization/set.hpp>
#include "common/common_types.h" #include "common/common_types.h"

View file

@ -6,8 +6,8 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <boost/serialization/export.hpp>
#include <boost/serialization/base_object.hpp> #include <boost/serialization/base_object.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
#include "common/common_types.h" #include "common/common_types.h"

View file

@ -5,8 +5,8 @@
#include <tuple> #include <tuple>
#include <boost/serialization/base_object.hpp> #include <boost/serialization/base_object.hpp>
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
#include <boost/serialization/vector.hpp>
#include "common/archives.h" #include "common/archives.h"
#include "common/assert.h" #include "common/assert.h"
#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_port.h"

View file

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <boost/serialization/unique_ptr.hpp>
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/unique_ptr.hpp>
#include <cryptopp/base64.h> #include <cryptopp/base64.h>
#include <cryptopp/hmac.h> #include <cryptopp/hmac.h>
#include <cryptopp/sha.h> #include <cryptopp/sha.h>
@ -1361,8 +1361,7 @@ void Module::CheckAndUpdateFile(const CecDataPathType path_type, const u32 ncch_
case CecDataPathType::MboxData: case CecDataPathType::MboxData:
case CecDataPathType::MboxIcon: case CecDataPathType::MboxIcon:
case CecDataPathType::MboxTitle: case CecDataPathType::MboxTitle:
default: { default: {}
}
} }
} }

View file

@ -24,8 +24,7 @@ static std::shared_ptr<Object> MakeObject(Kernel::KernelSystem& kernel) {
TEST_CASE("HLERequestContext::PopulateFromIncomingCommandBuffer", "[core][kernel]") { TEST_CASE("HLERequestContext::PopulateFromIncomingCommandBuffer", "[core][kernel]") {
Core::Timing timing(1, 100); Core::Timing timing(1, 100);
Memory::MemorySystem memory; Memory::MemorySystem memory;
Kernel::KernelSystem kernel( Kernel::KernelSystem kernel(memory, timing, [] {}, 0, 1, 0);
memory, timing, [] {}, 0, 1, 0);
auto [server, client] = kernel.CreateSessionPair(); auto [server, client] = kernel.CreateSessionPair();
HLERequestContext context(kernel, std::move(server), nullptr); HLERequestContext context(kernel, std::move(server), nullptr);
@ -240,8 +239,7 @@ TEST_CASE("HLERequestContext::PopulateFromIncomingCommandBuffer", "[core][kernel
TEST_CASE("HLERequestContext::WriteToOutgoingCommandBuffer", "[core][kernel]") { TEST_CASE("HLERequestContext::WriteToOutgoingCommandBuffer", "[core][kernel]") {
Core::Timing timing(1, 100); Core::Timing timing(1, 100);
Memory::MemorySystem memory; Memory::MemorySystem memory;
Kernel::KernelSystem kernel( Kernel::KernelSystem kernel(memory, timing, [] {}, 0, 1, 0);
memory, timing, [] {}, 0, 1, 0);
auto [server, client] = kernel.CreateSessionPair(); auto [server, client] = kernel.CreateSessionPair();
HLERequestContext context(kernel, std::move(server), nullptr); HLERequestContext context(kernel, std::move(server), nullptr);