summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-09-19 03:01:46 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2016-09-19 06:14:25 +0200
commit396a8d91a4423d9c793eeff0798d544613647511 (patch)
treee0203961233db1ffcbbca2e15154d71d142c5822 /src/common
parentTweak formatting settings (diff)
downloadyuzu-396a8d91a4423d9c793eeff0798d544613647511.tar
yuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.gz
yuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.bz2
yuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.lz
yuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.xz
yuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.zst
yuzu-396a8d91a4423d9c793eeff0798d544613647511.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/bit_set.h18
-rw-r--r--src/common/chunk_file.h9
-rw-r--r--src/common/code_block.h3
-rw-r--r--src/common/common_funcs.h3
-rw-r--r--src/common/emu_window.h7
-rw-r--r--src/common/file_util.cpp3
-rw-r--r--src/common/math_util.h6
-rw-r--r--src/common/profiler.cpp3
-rw-r--r--src/common/scope_exit.h3
-rw-r--r--src/common/swap.h3
-rw-r--r--src/common/synchronized_wrapper.h3
-rw-r--r--src/common/thread.h6
-rw-r--r--src/common/vector_math.h18
-rw-r--r--src/common/x64/emitter.cpp2
-rw-r--r--src/common/x64/emitter.h6
15 files changed, 32 insertions, 61 deletions
diff --git a/src/common/bit_set.h b/src/common/bit_set.h
index b83cbbb36..c48b3b769 100644
--- a/src/common/bit_set.h
+++ b/src/common/bit_set.h
@@ -102,10 +102,8 @@ public:
// A reference to a particular bit, returned from operator[].
class Ref {
public:
- Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) {
- }
- Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {
- }
+ Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) {}
+ Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {}
operator bool() const {
return (m_bs->m_val & m_mask) != 0;
}
@@ -122,10 +120,8 @@ public:
// A STL-like iterator is required to be able to use range-based for loops.
class Iterator {
public:
- Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {
- }
- Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {
- }
+ Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {}
+ Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {}
Iterator& operator=(Iterator other) {
new (this) Iterator(other);
return *this;
@@ -160,10 +156,8 @@ public:
int m_bit;
};
- BitSet() : m_val(0) {
- }
- explicit BitSet(IntTy val) : m_val(val) {
- }
+ BitSet() : m_val(0) {}
+ explicit BitSet(IntTy val) : m_val(val) {}
BitSet(std::initializer_list<int> init) {
m_val = 0;
for (int bit : init)
diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h
index 3b36c0a9e..2bf3c774b 100644
--- a/src/common/chunk_file.h
+++ b/src/common/chunk_file.h
@@ -50,8 +50,7 @@ class PointerWrap;
class PointerWrapSection {
public:
PointerWrapSection(PointerWrap& p, int ver, const char* title)
- : p_(p), ver_(ver), title_(title) {
- }
+ : p_(p), ver_(ver), title_(title) {}
~PointerWrapSection();
bool operator==(const int& v) const {
@@ -134,11 +133,9 @@ public:
Error error;
public:
- PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) {
- }
+ PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) {}
PointerWrap(unsigned char** ptr_, int mode_)
- : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) {
- }
+ : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) {}
PointerWrapSection Section(const char* title, int ver) {
return Section(title, ver, ver);
diff --git a/src/common/code_block.h b/src/common/code_block.h
index 58696737e..099088925 100644
--- a/src/common/code_block.h
+++ b/src/common/code_block.h
@@ -27,8 +27,7 @@ protected:
size_t region_size;
public:
- CodeBlock() : region(nullptr), region_size(0) {
- }
+ CodeBlock() : region(nullptr), region_size(0) {}
virtual ~CodeBlock() {
if (region)
FreeCodeSpace();
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index ad5bdbc08..7032c2117 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -86,8 +86,7 @@ inline u64 _rotr64(u64 x, unsigned int shift) {
extern "C" {
__declspec(dllimport) void __stdcall DebugBreak(void);
}
-#define Crash() \
- { DebugBreak(); }
+#define Crash() DebugBreak()
// cstdlib provides these on MSVC
#define rotr _rotr
diff --git a/src/common/emu_window.h b/src/common/emu_window.h
index de8badd4f..20131300d 100644
--- a/src/common/emu_window.h
+++ b/src/common/emu_window.h
@@ -229,8 +229,7 @@ protected:
circle_pad_y = 0;
touch_pressed = false;
}
- virtual ~EmuWindow() {
- }
+ virtual ~EmuWindow() {}
/**
* Processes any pending configuration changes from the last SetConfig call.
@@ -272,8 +271,8 @@ private:
* For the request to be honored, EmuWindow implementations will usually reimplement this
* function.
*/
- virtual void
- OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) {
+ virtual void OnMinimalClientAreaChangeRequest(
+ const std::pair<unsigned, unsigned>& minimal_size) {
// By default, ignore this request and do nothing.
}
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index c8723a4b3..96afe2ca0 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -828,8 +828,7 @@ void SplitFilename83(const std::string& filename, std::array<char, 9>& short_nam
}
}
-IOFile::IOFile() {
-}
+IOFile::IOFile() {}
IOFile::IOFile(const std::string& filename, const char openmode[]) {
Open(filename, openmode);
diff --git a/src/common/math_util.h b/src/common/math_util.h
index 696bd43ea..41d89666c 100644
--- a/src/common/math_util.h
+++ b/src/common/math_util.h
@@ -27,12 +27,10 @@ struct Rectangle {
T right;
T bottom;
- Rectangle() {
- }
+ Rectangle() {}
Rectangle(T left, T top, T right, T bottom)
- : left(left), top(top), right(right), bottom(bottom) {
- }
+ : left(left), top(top), right(right), bottom(bottom) {}
T GetWidth() const {
return std::abs(static_cast<typename std::make_signed<T>::type>(right - left));
diff --git a/src/common/profiler.cpp b/src/common/profiler.cpp
index 992ec25b2..231a0afc1 100644
--- a/src/common/profiler.cpp
+++ b/src/common/profiler.cpp
@@ -14,8 +14,7 @@ namespace Common {
namespace Profiling {
ProfilingManager::ProfilingManager()
- : last_frame_end(Clock::now()), this_frame_start(Clock::now()) {
-}
+ : last_frame_end(Clock::now()), this_frame_start(Clock::now()) {}
void ProfilingManager::BeginFrame() {
this_frame_start = Clock::now();
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 73b2a262e..072ab285d 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -10,8 +10,7 @@
namespace detail {
template <typename Func>
struct ScopeExitHelper {
- explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {
- }
+ explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {}
~ScopeExitHelper() {
func();
}
diff --git a/src/common/swap.h b/src/common/swap.h
index 1794144fb..72c50d789 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -168,8 +168,7 @@ public:
return swap(value);
}
swap_struct_t() = default;
- swap_struct_t(const T& v) : value(swap(v)) {
- }
+ swap_struct_t(const T& v) : value(swap(v)) {}
template <typename S>
swapped_t& operator=(const S& source) {
diff --git a/src/common/synchronized_wrapper.h b/src/common/synchronized_wrapper.h
index 8dc4ddeac..04b4f2e51 100644
--- a/src/common/synchronized_wrapper.h
+++ b/src/common/synchronized_wrapper.h
@@ -19,8 +19,7 @@ template <typename T>
class SynchronizedWrapper {
public:
template <typename... Args>
- SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) {
- }
+ SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) {}
private:
template <typename U>
diff --git a/src/common/thread.h b/src/common/thread.h
index b189dc764..499c151c2 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -39,8 +39,7 @@ void SetCurrentThreadAffinity(u32 mask);
class Event {
public:
- Event() : is_set(false) {
- }
+ Event() : is_set(false) {}
void Set() {
std::lock_guard<std::mutex> lk(mutex);
@@ -71,8 +70,7 @@ private:
class Barrier {
public:
- explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) {
- }
+ explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) {}
/// Blocks until all "count" threads have called Sync()
void Sync() {
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index b2d630829..2d56f168c 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -60,10 +60,8 @@ public:
}
Vec2() = default;
- Vec2(const T a[2]) : x(a[0]), y(a[1]) {
- }
- Vec2(const T& _x, const T& _y) : x(_x), y(_y) {
- }
+ Vec2(const T a[2]) : x(a[0]), y(a[1]) {}
+ Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
template <typename T2>
Vec2<T2> Cast() const {
@@ -201,10 +199,8 @@ public:
}
Vec3() = default;
- Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) {
- }
- Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {
- }
+ Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) {}
+ Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
template <typename T2>
Vec3<T2> Cast() const {
@@ -409,10 +405,8 @@ public:
}
Vec4() = default;
- Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) {
- }
- Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {
- }
+ Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) {}
+ Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
template <typename T2>
Vec4<T2> Cast() const {
diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp
index 1a9fd6a6b..7cf350b4a 100644
--- a/src/common/x64/emitter.cpp
+++ b/src/common/x64/emitter.cpp
@@ -222,7 +222,7 @@ void OpArg::WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp
void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg,
bool warn_64bit_offset) const {
if (_operandReg == INVALID_REG)
- _operandReg = (X64Reg) this->operandReg;
+ _operandReg = (X64Reg)this->operandReg;
int mod = 0;
int ireg = indexReg;
bool SIB = false;
diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h
index 467f7812f..6c9dc3d6b 100644
--- a/src/common/x64/emitter.h
+++ b/src/common/x64/emitter.h
@@ -233,8 +233,7 @@ struct OpArg {
constexpr OpArg() = default; // dummy op arg, used for storage
constexpr OpArg(u64 offset_, int scale_, X64Reg rmReg = RAX, X64Reg scaledReg = RAX)
: scale(static_cast<u8>(scale_)), offsetOrBaseReg(static_cast<u16>(rmReg)),
- indexReg(static_cast<u16>(scaledReg)), offset(offset_) {
- }
+ indexReg(static_cast<u16>(scaledReg)), offset(offset_) {}
constexpr bool operator==(const OpArg& b) const {
return operandReg == b.operandReg && scale == b.scale &&
@@ -454,8 +453,7 @@ public:
code = code_ptr;
flags_locked = false;
}
- virtual ~XEmitter() {
- }
+ virtual ~XEmitter() {}
void WriteModRM(int mod, int rm, int reg);
void WriteSIB(int scale, int index, int base);