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.
|
||
|---|---|---|
| .. | ||
| buffer_cache | ||
| command_classes | ||
| engines | ||
| host_shaders | ||
| macro | ||
| renderer_opengl | ||
| renderer_vulkan | ||
| shader | ||
| texture_cache | ||
| textures | ||
| cdma_pusher.cpp | ||
| cdma_pusher.h | ||
| CMakeLists.txt | ||
| compatible_formats.cpp | ||
| compatible_formats.h | ||
| dirty_flags.cpp | ||
| dirty_flags.h | ||
| dma_pusher.cpp | ||
| dma_pusher.h | ||
| fence_manager.h | ||
| gpu.cpp | ||
| gpu.h | ||
| gpu_asynch.cpp | ||
| gpu_asynch.h | ||
| gpu_synch.cpp | ||
| gpu_synch.h | ||
| gpu_thread.cpp | ||
| gpu_thread.h | ||
| guest_driver.cpp | ||
| guest_driver.h | ||
| memory_manager.cpp | ||
| memory_manager.h | ||
| morton.cpp | ||
| morton.h | ||
| query_cache.h | ||
| rasterizer_accelerated.cpp | ||
| rasterizer_accelerated.h | ||
| rasterizer_interface.h | ||
| renderer_base.cpp | ||
| renderer_base.h | ||
| sampler_cache.cpp | ||
| sampler_cache.h | ||
| shader_cache.h | ||
| shader_notify.cpp | ||
| shader_notify.h | ||
| surface.cpp | ||
| surface.h | ||
| video_core.cpp | ||
| video_core.h | ||