summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
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:
102 // A reference to a particular bit, returned from operator[]. 102 // A reference to a particular bit, returned from operator[].
103 class Ref { 103 class Ref {
104 public: 104 public:
105 Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) { 105 Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) {}
106 } 106 Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {}
107 Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {
108 }
109 operator bool() const { 107 operator bool() const {
110 return (m_bs->m_val & m_mask) != 0; 108 return (m_bs->m_val & m_mask) != 0;
111 } 109 }
@@ -122,10 +120,8 @@ public:
122 // A STL-like iterator is required to be able to use range-based for loops. 120 // A STL-like iterator is required to be able to use range-based for loops.
123 class Iterator { 121 class Iterator {
124 public: 122 public:
125 Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) { 123 Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {}
126 } 124 Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {}
127 Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {
128 }
129 Iterator& operator=(Iterator other) { 125 Iterator& operator=(Iterator other) {
130 new (this) Iterator(other); 126 new (this) Iterator(other);
131 return *this; 127 return *this;
@@ -160,10 +156,8 @@ public:
160 int m_bit; 156 int m_bit;
161 }; 157 };
162 158
163 BitSet() : m_val(0) { 159 BitSet() : m_val(0) {}
164 } 160 explicit BitSet(IntTy val) : m_val(val) {}
165 explicit BitSet(IntTy val) : m_val(val) {
166 }
167 BitSet(std::initializer_list<int> init) { 161 BitSet(std::initializer_list<int> init) {
168 m_val = 0; 162 m_val = 0;
169 for (int bit : init) 163 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;
50class PointerWrapSection { 50class PointerWrapSection {
51public: 51public:
52 PointerWrapSection(PointerWrap& p, int ver, const char* title) 52 PointerWrapSection(PointerWrap& p, int ver, const char* title)
53 : p_(p), ver_(ver), title_(title) { 53 : p_(p), ver_(ver), title_(title) {}
54 }
55 ~PointerWrapSection(); 54 ~PointerWrapSection();
56 55
57 bool operator==(const int& v) const { 56 bool operator==(const int& v) const {
@@ -134,11 +133,9 @@ public:
134 Error error; 133 Error error;
135 134
136public: 135public:
137 PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) { 136 PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) {}
138 }
139 PointerWrap(unsigned char** ptr_, int mode_) 137 PointerWrap(unsigned char** ptr_, int mode_)
140 : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) { 138 : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) {}
141 }
142 139
143 PointerWrapSection Section(const char* title, int ver) { 140 PointerWrapSection Section(const char* title, int ver) {
144 return Section(title, ver, ver); 141 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:
27 size_t region_size; 27 size_t region_size;
28 28
29public: 29public:
30 CodeBlock() : region(nullptr), region_size(0) { 30 CodeBlock() : region(nullptr), region_size(0) {}
31 }
32 virtual ~CodeBlock() { 31 virtual ~CodeBlock() {
33 if (region) 32 if (region)
34 FreeCodeSpace(); 33 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) {
86extern "C" { 86extern "C" {
87__declspec(dllimport) void __stdcall DebugBreak(void); 87__declspec(dllimport) void __stdcall DebugBreak(void);
88} 88}
89#define Crash() \ 89#define Crash() DebugBreak()
90 { DebugBreak(); }
91 90
92// cstdlib provides these on MSVC 91// cstdlib provides these on MSVC
93#define rotr _rotr 92#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:
229 circle_pad_y = 0; 229 circle_pad_y = 0;
230 touch_pressed = false; 230 touch_pressed = false;
231 } 231 }
232 virtual ~EmuWindow() { 232 virtual ~EmuWindow() {}
233 }
234 233
235 /** 234 /**
236 * Processes any pending configuration changes from the last SetConfig call. 235 * Processes any pending configuration changes from the last SetConfig call.
@@ -272,8 +271,8 @@ private:
272 * For the request to be honored, EmuWindow implementations will usually reimplement this 271 * For the request to be honored, EmuWindow implementations will usually reimplement this
273 * function. 272 * function.
274 */ 273 */
275 virtual void 274 virtual void OnMinimalClientAreaChangeRequest(
276 OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) { 275 const std::pair<unsigned, unsigned>& minimal_size) {
277 // By default, ignore this request and do nothing. 276 // By default, ignore this request and do nothing.
278 } 277 }
279 278
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
828 } 828 }
829} 829}
830 830
831IOFile::IOFile() { 831IOFile::IOFile() {}
832}
833 832
834IOFile::IOFile(const std::string& filename, const char openmode[]) { 833IOFile::IOFile(const std::string& filename, const char openmode[]) {
835 Open(filename, openmode); 834 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 {
27 T right; 27 T right;
28 T bottom; 28 T bottom;
29 29
30 Rectangle() { 30 Rectangle() {}
31 }
32 31
33 Rectangle(T left, T top, T right, T bottom) 32 Rectangle(T left, T top, T right, T bottom)
34 : left(left), top(top), right(right), bottom(bottom) { 33 : left(left), top(top), right(right), bottom(bottom) {}
35 }
36 34
37 T GetWidth() const { 35 T GetWidth() const {
38 return std::abs(static_cast<typename std::make_signed<T>::type>(right - left)); 36 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 {
14namespace Profiling { 14namespace Profiling {
15 15
16ProfilingManager::ProfilingManager() 16ProfilingManager::ProfilingManager()
17 : last_frame_end(Clock::now()), this_frame_start(Clock::now()) { 17 : last_frame_end(Clock::now()), this_frame_start(Clock::now()) {}
18}
19 18
20void ProfilingManager::BeginFrame() { 19void ProfilingManager::BeginFrame() {
21 this_frame_start = Clock::now(); 20 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 @@
10namespace detail { 10namespace detail {
11template <typename Func> 11template <typename Func>
12struct ScopeExitHelper { 12struct ScopeExitHelper {
13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) { 13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {}
14 }
15 ~ScopeExitHelper() { 14 ~ScopeExitHelper() {
16 func(); 15 func();
17 } 16 }
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:
168 return swap(value); 168 return swap(value);
169 } 169 }
170 swap_struct_t() = default; 170 swap_struct_t() = default;
171 swap_struct_t(const T& v) : value(swap(v)) { 171 swap_struct_t(const T& v) : value(swap(v)) {}
172 }
173 172
174 template <typename S> 173 template <typename S>
175 swapped_t& operator=(const S& source) { 174 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>
19class SynchronizedWrapper { 19class SynchronizedWrapper {
20public: 20public:
21 template <typename... Args> 21 template <typename... Args>
22 SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) { 22 SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) {}
23 }
24 23
25private: 24private:
26 template <typename U> 25 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);
39 39
40class Event { 40class Event {
41public: 41public:
42 Event() : is_set(false) { 42 Event() : is_set(false) {}
43 }
44 43
45 void Set() { 44 void Set() {
46 std::lock_guard<std::mutex> lk(mutex); 45 std::lock_guard<std::mutex> lk(mutex);
@@ -71,8 +70,7 @@ private:
71 70
72class Barrier { 71class Barrier {
73public: 72public:
74 explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) { 73 explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) {}
75 }
76 74
77 /// Blocks until all "count" threads have called Sync() 75 /// Blocks until all "count" threads have called Sync()
78 void Sync() { 76 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:
60 } 60 }
61 61
62 Vec2() = default; 62 Vec2() = default;
63 Vec2(const T a[2]) : x(a[0]), y(a[1]) { 63 Vec2(const T a[2]) : x(a[0]), y(a[1]) {}
64 } 64 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
65 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {
66 }
67 65
68 template <typename T2> 66 template <typename T2>
69 Vec2<T2> Cast() const { 67 Vec2<T2> Cast() const {
@@ -201,10 +199,8 @@ public:
201 } 199 }
202 200
203 Vec3() = default; 201 Vec3() = default;
204 Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) { 202 Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) {}
205 } 203 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
206 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {
207 }
208 204
209 template <typename T2> 205 template <typename T2>
210 Vec3<T2> Cast() const { 206 Vec3<T2> Cast() const {
@@ -409,10 +405,8 @@ public:
409 } 405 }
410 406
411 Vec4() = default; 407 Vec4() = default;
412 Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) { 408 Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) {}
413 } 409 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
414 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {
415 }
416 410
417 template <typename T2> 411 template <typename T2>
418 Vec4<T2> Cast() const { 412 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
222void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg, 222void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg,
223 bool warn_64bit_offset) const { 223 bool warn_64bit_offset) const {
224 if (_operandReg == INVALID_REG) 224 if (_operandReg == INVALID_REG)
225 _operandReg = (X64Reg) this->operandReg; 225 _operandReg = (X64Reg)this->operandReg;
226 int mod = 0; 226 int mod = 0;
227 int ireg = indexReg; 227 int ireg = indexReg;
228 bool SIB = false; 228 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 {
233 constexpr OpArg() = default; // dummy op arg, used for storage 233 constexpr OpArg() = default; // dummy op arg, used for storage
234 constexpr OpArg(u64 offset_, int scale_, X64Reg rmReg = RAX, X64Reg scaledReg = RAX) 234 constexpr OpArg(u64 offset_, int scale_, X64Reg rmReg = RAX, X64Reg scaledReg = RAX)
235 : scale(static_cast<u8>(scale_)), offsetOrBaseReg(static_cast<u16>(rmReg)), 235 : scale(static_cast<u8>(scale_)), offsetOrBaseReg(static_cast<u16>(rmReg)),
236 indexReg(static_cast<u16>(scaledReg)), offset(offset_) { 236 indexReg(static_cast<u16>(scaledReg)), offset(offset_) {}
237 }
238 237
239 constexpr bool operator==(const OpArg& b) const { 238 constexpr bool operator==(const OpArg& b) const {
240 return operandReg == b.operandReg && scale == b.scale && 239 return operandReg == b.operandReg && scale == b.scale &&
@@ -454,8 +453,7 @@ public:
454 code = code_ptr; 453 code = code_ptr;
455 flags_locked = false; 454 flags_locked = false;
456 } 455 }
457 virtual ~XEmitter() { 456 virtual ~XEmitter() {}
458 }
459 457
460 void WriteModRM(int mod, int rm, int reg); 458 void WriteModRM(int mod, int rm, int reg);
461 void WriteSIB(int scale, int index, int base); 459 void WriteSIB(int scale, int index, int base);