From 4bc0aacd8bd8d4ce0382543a5a449f599d48915c Mon Sep 17 00:00:00 2001 From: orbea Date: Sun, 16 Dec 2018 16:15:42 -0800 Subject: [PATCH 1/2] Fix clang -Wreorder warnings. gfx/drivers_shader/shader_vulkan.cpp:1109:6: warning: field 'id' will be initialized after field 'device' [-Wreorder] : id(move(id)), ^ gfx/drivers_shader/shader_vulkan.cpp:2107:4: warning: field 'device' will be initialized after field 'memory_properties' [-Wreorder] device(device), ^ 2 warnings generated. --- gfx/drivers_shader/shader_vulkan.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gfx/drivers_shader/shader_vulkan.cpp b/gfx/drivers_shader/shader_vulkan.cpp index cc587083d4..022d4c9fb0 100644 --- a/gfx/drivers_shader/shader_vulkan.cpp +++ b/gfx/drivers_shader/shader_vulkan.cpp @@ -1106,12 +1106,12 @@ StaticTexture::StaticTexture(string id, bool linear, bool mipmap, vulkan_filter_chain_address address) - : id(move(id)), - device(device), + : device(device), image(image), view(view), memory(memory), - buffer(move(buffer)) + buffer(move(buffer)), + id(move(id)) { texture.filter = linear ? VULKAN_FILTER_CHAIN_LINEAR : VULKAN_FILTER_CHAIN_NEAREST; texture.mip_filter = @@ -2104,8 +2104,8 @@ Framebuffer::Framebuffer( const VkPhysicalDeviceMemoryProperties &mem_props, const Size2D &max_size, VkFormat format, unsigned max_levels) : - device(device), memory_properties(mem_props), + device(device), size(max_size), format(format), max_levels(max(max_levels, 1u)) From 47666fb4a8a169147b76d80800eada37ac560307 Mon Sep 17 00:00:00 2001 From: orbea Date: Sun, 16 Dec 2018 16:28:34 -0800 Subject: [PATCH 2/2] Fix clang -Wuninitialized warning. dynamic.c:188:26: warning: variable 'i' is uninitialized when used here [-Wuninitialized] unsigned size = i; ^ dynamic.c:187:20: note: initialize the variable 'i' to silence this warning unsigned i, j; ^ = 0 1 warning generated. --- dynamic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dynamic.c b/dynamic.c index 274d5c61a5..049aad7883 100644 --- a/dynamic.c +++ b/dynamic.c @@ -184,7 +184,8 @@ static bool environ_cb_get_system_info(unsigned cmd, void *data) break; case RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO: { - unsigned i, j; + unsigned i = 0; + unsigned j = 0; unsigned size = i; const struct retro_subsystem_info *info = (const struct retro_subsystem_info*)data;