diff options
| author | 2018-04-19 22:36:48 -0400 | |
|---|---|---|
| committer | 2018-04-19 22:36:52 -0400 | |
| commit | d9e316e3538c0c0891f04bbfd0e211749ba15b5d (patch) | |
| tree | c218d1705222ae899c613427b01e1947a1c22893 /src | |
| parent | Merge pull request #356 from lioncash/shader (diff) | |
| download | yuzu-d9e316e3538c0c0891f04bbfd0e211749ba15b5d.tar.gz yuzu-d9e316e3538c0c0891f04bbfd0e211749ba15b5d.tar.xz yuzu-d9e316e3538c0c0891f04bbfd0e211749ba15b5d.zip | |
common_funcs: Remove ARRAY_SIZE macro
C++17 has non-member size() which we can just call where necessary.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/common_funcs.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 6f0604958..19a33cb57 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -9,8 +9,6 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) | ||
| 13 | |||
| 14 | /// Textually concatenates two tokens. The double-expansion is required by the C preprocessor. | 12 | /// Textually concatenates two tokens. The double-expansion is required by the C preprocessor. |
| 15 | #define CONCAT2(x, y) DO_CONCAT2(x, y) | 13 | #define CONCAT2(x, y) DO_CONCAT2(x, y) |
| 16 | #define DO_CONCAT2(x, y) x##y | 14 | #define DO_CONCAT2(x, y) x##y |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 54b1d5d75..6204bcaaa 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <cinttypes> | 6 | #include <cinttypes> |
| 7 | #include <iterator> | ||
| 7 | 8 | ||
| 8 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 9 | #include "common/microprofile.h" | 10 | #include "common/microprofile.h" |
| @@ -946,7 +947,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 946 | }; | 947 | }; |
| 947 | 948 | ||
| 948 | static const FunctionDef* GetSVCInfo(u32 func_num) { | 949 | static const FunctionDef* GetSVCInfo(u32 func_num) { |
| 949 | if (func_num >= ARRAY_SIZE(SVC_Table)) { | 950 | if (func_num >= std::size(SVC_Table)) { |
| 950 | LOG_ERROR(Kernel_SVC, "unknown svc=0x%02X", func_num); | 951 | LOG_ERROR(Kernel_SVC, "unknown svc=0x%02X", func_num); |
| 951 | return nullptr; | 952 | return nullptr; |
| 952 | } | 953 | } |
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 7b8a15ed2..f91dfe36a 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -2,8 +2,8 @@ | |||
| 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 <iterator> | ||
| 5 | #include <glad/glad.h> | 6 | #include <glad/glad.h> |
| 6 | #include "common/common_funcs.h" | ||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "video_core/renderer_opengl/gl_state.h" | 8 | #include "video_core/renderer_opengl/gl_state.h" |
| 9 | 9 | ||
| @@ -192,7 +192,7 @@ void OpenGLState::Apply() const { | |||
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | // Textures | 194 | // Textures |
| 195 | for (unsigned i = 0; i < ARRAY_SIZE(texture_units); ++i) { | 195 | for (size_t i = 0; i < std::size(texture_units); ++i) { |
| 196 | if (texture_units[i].texture_2d != cur_state.texture_units[i].texture_2d) { | 196 | if (texture_units[i].texture_2d != cur_state.texture_units[i].texture_2d) { |
| 197 | glActiveTexture(TextureUnits::MaxwellTexture(i).Enum()); | 197 | glActiveTexture(TextureUnits::MaxwellTexture(i).Enum()); |
| 198 | glBindTexture(GL_TEXTURE_2D, texture_units[i].texture_2d); | 198 | glBindTexture(GL_TEXTURE_2D, texture_units[i].texture_2d); |