Code review actions (plus hopefully fix the linux CI)
This commit is contained in:
parent
9bd189a155
commit
92640fc29c
46 changed files with 155 additions and 109 deletions
|
@ -5,8 +5,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <boost/archive/binary_iarchive.hpp>
|
||||
#include "boost/archive/binary_oarchive.hpp"
|
||||
#include "boost/serialization/export.hpp"
|
||||
#include <boost/archive/binary_oarchive.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
|
||||
using iarchive = boost::archive::binary_iarchive;
|
||||
using oarchive = boost::archive::binary_oarchive;
|
||||
|
|
|
@ -41,13 +41,17 @@ public:
|
|||
}
|
||||
|
||||
std::size_t GetSize() const override {
|
||||
return static_cast<u32>(data.size());
|
||||
return data.size();
|
||||
}
|
||||
|
||||
std::vector<u8>& Vector() {
|
||||
return data;
|
||||
}
|
||||
|
||||
const std::vector<u8>& Vector() const {
|
||||
return data;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<u8> data;
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
|
|
|
@ -1,33 +1,37 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include <boost/icl/discrete_interval.hpp>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace boost::serialization {
|
||||
|
||||
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
||||
void save(Archive& ar, const boost::icl::discrete_interval<DomainT, Compare>& obj, const unsigned int file_version)
|
||||
{
|
||||
void save(Archive& ar, const boost::icl::discrete_interval<DomainT, Compare>& obj,
|
||||
const unsigned int file_version) {
|
||||
ar << obj.lower();
|
||||
ar << obj.upper();
|
||||
ar << obj.bounds()._bits;
|
||||
}
|
||||
|
||||
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
||||
void load(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj, const unsigned int file_version)
|
||||
{
|
||||
void load(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj,
|
||||
const unsigned int file_version) {
|
||||
DomainT upper, lower;
|
||||
boost::icl::bound_type bounds;
|
||||
ar >> upper;
|
||||
ar >> lower;
|
||||
ar >> upper;
|
||||
ar >> bounds;
|
||||
obj = boost::icl::discrete_interval(upper, lower, boost::icl::interval_bounds(bounds));
|
||||
}
|
||||
|
||||
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
||||
void serialize(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj, const unsigned int file_version)
|
||||
{
|
||||
void serialize(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj,
|
||||
const unsigned int file_version) {
|
||||
boost::serialization::split_free(ar, obj, file_version);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace boost::serialization
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
|
20
src/common/serialization/boost_interval_set.hpp
Normal file
20
src/common/serialization/boost_interval_set.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "common/serialization/boost_discrete_interval.hpp"
|
||||
|
||||
namespace boost::serialization {
|
||||
|
||||
template <class Archive, class T>
|
||||
void serialize(Archive& ar, boost::icl::interval_set<T>& obj, const unsigned int file_version) {
|
||||
using IntervalSet = boost::icl::interval_set<T>;
|
||||
// This works because interval_set has exactly one member of type ImplSetT
|
||||
static_assert(std::is_standard_layout_v<IntervalSet>);
|
||||
ar&*(reinterpret_cast<typename IntervalSet::ImplSetT*>(&obj));
|
||||
}
|
||||
|
||||
} // namespace boost::serialization
|
|
@ -186,7 +186,7 @@ private:
|
|||
void save(Archive& ar, const unsigned int file_version) const {
|
||||
const s64 idx = ToIndex(first);
|
||||
ar << idx;
|
||||
for (size_t i = 0; i < NUM_QUEUES; i++) {
|
||||
for (std::size_t i = 0; i < NUM_QUEUES; i++) {
|
||||
const s64 idx1 = ToIndex(queues[i].next_nonempty);
|
||||
ar << idx1;
|
||||
ar << queues[i].data;
|
||||
|
@ -198,7 +198,7 @@ private:
|
|||
s64 idx;
|
||||
ar >> idx;
|
||||
first = ToPointer(idx);
|
||||
for (auto i = 0; i < NUM_QUEUES; i++) {
|
||||
for (std::size_t i = 0; i < NUM_QUEUES; i++) {
|
||||
ar >> idx;
|
||||
queues[i].next_nonempty = ToPointer(idx);
|
||||
ar >> queues[i].data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue