mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-15 16:22:45 +00:00
video_core: Adjust NUM
macro to avoid Clang warning
The previous definition was: #define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32)) In cases where `field_name` happens to refer to an array, Clang thinks `sizeof(an array value) / sizeof(a type)` is an instance of the idiom where `sizeof` is used to compute an array length. So it thinks the type in the denominator ought to be the array element type, and warns if it isn't, assuming this is a mistake. In reality, `NUM` is not used to get array lengths at all, so there is no mistake. Silence the warning by applying Clang's suggested workaround of parenthesizing the denominator.
This commit is contained in:
parent
7e5f595b31
commit
d637114c17
|
@ -9,7 +9,7 @@
|
||||||
#include "video_core/dirty_flags.h"
|
#include "video_core/dirty_flags.h"
|
||||||
|
|
||||||
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
|
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
|
||||||
#define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / sizeof(u32))
|
#define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / (sizeof(u32)))
|
||||||
|
|
||||||
namespace VideoCommon::Dirty {
|
namespace VideoCommon::Dirty {
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "video_core/renderer_opengl/gl_state_tracker.h"
|
#include "video_core/renderer_opengl/gl_state_tracker.h"
|
||||||
|
|
||||||
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
|
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
|
||||||
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))
|
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / (sizeof(u32)))
|
||||||
|
|
||||||
namespace OpenGL {
|
namespace OpenGL {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "video_core/renderer_vulkan/vk_state_tracker.h"
|
#include "video_core/renderer_vulkan/vk_state_tracker.h"
|
||||||
|
|
||||||
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
|
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
|
||||||
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))
|
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / (sizeof(u32)))
|
||||||
|
|
||||||
namespace Vulkan {
|
namespace Vulkan {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue