diff options
| author | 2015-02-18 22:45:46 -0800 | |
|---|---|---|
| committer | 2015-02-19 22:26:25 -0800 | |
| commit | 302f0b32f57655dc453d34d30a90a0f06601082a (patch) | |
| tree | 61162e01f93738a587f499a78f01545fa03e258f /src | |
| parent | Remove "super lame/broken" file_search compilation unit that was leftover fro... (diff) | |
| download | yuzu-302f0b32f57655dc453d34d30a90a0f06601082a.tar.gz yuzu-302f0b32f57655dc453d34d30a90a0f06601082a.tar.xz yuzu-302f0b32f57655dc453d34d30a90a0f06601082a.zip | |
Remove duplication of INSERT_PADDING_WORDS between pica.h and gpu.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/common_funcs.h | 5 | ||||
| -rw-r--r-- | src/common/hash.cpp | 1 | ||||
| -rw-r--r-- | src/core/hw/gpu.h | 11 | ||||
| -rw-r--r-- | src/video_core/pica.h | 11 |
4 files changed, 3 insertions, 25 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 4bbcc3571..daec8f0ff 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -38,9 +38,8 @@ template<> struct CompileTimeAssert<true> {}; | |||
| 38 | // helper macro to properly align structure members. | 38 | // helper macro to properly align structure members. |
| 39 | // Calling INSERT_PADDING_BYTES will add a new member variable with a name like "pad121", | 39 | // Calling INSERT_PADDING_BYTES will add a new member variable with a name like "pad121", |
| 40 | // depending on the current source line to make sure variable names are unique. | 40 | // depending on the current source line to make sure variable names are unique. |
| 41 | #define INSERT_PADDING_BYTES_HELPER1(x, y) x ## y | 41 | #define INSERT_PADDING_BYTES(num_bytes) u8 CONCAT2(pad, __LINE__)[(num_bytes)] |
| 42 | #define INSERT_PADDING_BYTES_HELPER2(x, y) INSERT_PADDING_BYTES_HELPER1(x, y) | 42 | #define INSERT_PADDING_WORDS(num_words) u32 CONCAT2(pad, __LINE__)[(num_words)] |
| 43 | #define INSERT_PADDING_BYTES(num_words) u8 INSERT_PADDING_BYTES_HELPER2(pad, __LINE__)[(num_words)] | ||
| 44 | 43 | ||
| 45 | #ifndef _MSC_VER | 44 | #ifndef _MSC_VER |
| 46 | 45 | ||
diff --git a/src/common/hash.cpp b/src/common/hash.cpp index fe2c9e636..50c7cb5f9 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | 6 | ||
| 6 | #include "common/hash.h" | 7 | #include "common/hash.h" |
| 7 | #if _M_SSE >= 0x402 | 8 | #if _M_SSE >= 0x402 |
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index df9aa0d71..75f524465 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h | |||
| @@ -34,13 +34,6 @@ namespace GPU { | |||
| 34 | // MMIO region 0x1EFxxxxx | 34 | // MMIO region 0x1EFxxxxx |
| 35 | struct Regs { | 35 | struct Regs { |
| 36 | 36 | ||
| 37 | // helper macro to properly align structure members. | ||
| 38 | // Calling INSERT_PADDING_WORDS will add a new member variable with a name like "pad121", | ||
| 39 | // depending on the current source line to make sure variable names are unique. | ||
| 40 | #define INSERT_PADDING_WORDS_HELPER1(x, y) x ## y | ||
| 41 | #define INSERT_PADDING_WORDS_HELPER2(x, y) INSERT_PADDING_WORDS_HELPER1(x, y) | ||
| 42 | #define INSERT_PADDING_WORDS(num_words) u32 INSERT_PADDING_WORDS_HELPER2(pad, __LINE__)[(num_words)] | ||
| 43 | |||
| 44 | // helper macro to make sure the defined structures are of the expected size. | 37 | // helper macro to make sure the defined structures are of the expected size. |
| 45 | #if defined(_MSC_VER) | 38 | #if defined(_MSC_VER) |
| 46 | // TODO: MSVC does not support using sizeof() on non-static data members even though this | 39 | // TODO: MSVC does not support using sizeof() on non-static data members even though this |
| @@ -238,10 +231,6 @@ struct Regs { | |||
| 238 | 231 | ||
| 239 | INSERT_PADDING_WORDS(0x9c3); | 232 | INSERT_PADDING_WORDS(0x9c3); |
| 240 | 233 | ||
| 241 | #undef INSERT_PADDING_WORDS_HELPER1 | ||
| 242 | #undef INSERT_PADDING_WORDS_HELPER2 | ||
| 243 | #undef INSERT_PADDING_WORDS | ||
| 244 | |||
| 245 | static inline size_t NumIds() { | 234 | static inline size_t NumIds() { |
| 246 | return sizeof(Regs) / sizeof(u32); | 235 | return sizeof(Regs) / sizeof(u32); |
| 247 | } | 236 | } |
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index e4a5ef78e..d03b811d3 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -39,13 +39,6 @@ namespace Pica { | |||
| 39 | 39 | ||
| 40 | struct Regs { | 40 | struct Regs { |
| 41 | 41 | ||
| 42 | // helper macro to properly align structure members. | ||
| 43 | // Calling INSERT_PADDING_WORDS will add a new member variable with a name like "pad121", | ||
| 44 | // depending on the current source line to make sure variable names are unique. | ||
| 45 | #define INSERT_PADDING_WORDS_HELPER1(x, y) x ## y | ||
| 46 | #define INSERT_PADDING_WORDS_HELPER2(x, y) INSERT_PADDING_WORDS_HELPER1(x, y) | ||
| 47 | #define INSERT_PADDING_WORDS(num_words) u32 INSERT_PADDING_WORDS_HELPER2(pad, __LINE__)[(num_words)]; | ||
| 48 | |||
| 49 | INSERT_PADDING_WORDS(0x10); | 42 | INSERT_PADDING_WORDS(0x10); |
| 50 | 43 | ||
| 51 | u32 trigger_irq; | 44 | u32 trigger_irq; |
| @@ -709,10 +702,6 @@ struct Regs { | |||
| 709 | 702 | ||
| 710 | INSERT_PADDING_WORDS(0x22); | 703 | INSERT_PADDING_WORDS(0x22); |
| 711 | 704 | ||
| 712 | #undef INSERT_PADDING_WORDS_HELPER1 | ||
| 713 | #undef INSERT_PADDING_WORDS_HELPER2 | ||
| 714 | #undef INSERT_PADDING_WORDS | ||
| 715 | |||
| 716 | // Map register indices to names readable by humans | 705 | // Map register indices to names readable by humans |
| 717 | // Used for debugging purposes, so performance is not an issue here | 706 | // Used for debugging purposes, so performance is not an issue here |
| 718 | static std::string GetCommandName(int index) { | 707 | static std::string GetCommandName(int index) { |