Add BX_FALLTHROUGH to avoid -Wimplicit-fallthrough false positives (#1322)

This commit is contained in:
云风 2018-01-29 13:31:34 +08:00 коммит произвёл Branimir Karadžić
Родитель b781fe4dff
Коммит b9f9ec56f5
6 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -2844,6 +2844,7 @@ error:
case ErrorState::ContextAllocated:
BX_ALIGNED_DELETE(g_allocator, s_ctx, 64);
s_ctx = NULL;
BX_FALLTHROUGH;
case ErrorState::Default:
if (NULL != s_callbackStub)

Просмотреть файл

@ -1870,6 +1870,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
DX_RELEASE(m_deviceCtx, 0);
DX_RELEASE(m_device, 0);
DX_RELEASE(m_factory, 0);
BX_FALLTHROUGH;
#if USE_D3D11_DYNAMIC_LIB
case ErrorState::LoadedDXGI:
@ -1887,10 +1888,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bx::dlclose(m_dxgidll);
m_dxgidll = NULL;
BX_FALLTHROUGH;
case ErrorState::LoadedD3D11:
bx::dlclose(m_d3d11dll);
m_d3d11dll = NULL;
BX_FALLTHROUGH;
#endif // USE_D3D11_DYNAMIC_LIB
case ErrorState::Default:

Просмотреть файл

@ -1448,17 +1448,22 @@ namespace bgfx { namespace d3d12
{
case ErrorState::CreatedCommandQueue:
m_cmd.shutdown();
BX_FALLTHROUGH;
case ErrorState::CreatedDXGIFactory:
DX_RELEASE(m_device, 0);
DX_RELEASE(m_adapter, 0);
DX_RELEASE(m_factory, 0);
BX_FALLTHROUGH;
#if USE_D3D12_DYNAMIC_LIB
case ErrorState::LoadedDXGI:
bx::dlclose(m_dxgidll);
BX_FALLTHROUGH;
case ErrorState::LoadedD3D12:
bx::dlclose(m_d3d12dll);
BX_FALLTHROUGH;
case ErrorState::LoadedKernel32:
bx::dlclose(m_kernel32dll);
BX_FALLTHROUGH;
#endif // USE_D3D12_DYNAMIC_LIB
case ErrorState::Default:
default:

Просмотреть файл

@ -869,6 +869,7 @@ namespace bgfx { namespace d3d9
{
DX_RELEASE(m_device, 0);
}
BX_FALLTHROUGH;
case ErrorState::CreatedD3D9:
if (NULL != m_d3d9ex)
@ -880,10 +881,12 @@ namespace bgfx { namespace d3d9
{
DX_RELEASE(m_d3d9, 0);
}
BX_FALLTHROUGH;
case ErrorState::LoadedD3D9:
m_nvapi.shutdown();
bx::dlclose(m_d3d9dll);
BX_FALLTHROUGH;
case ErrorState::Default:
break;

Просмотреть файл

@ -241,6 +241,7 @@ namespace bgfx { namespace d3d9
switch (m_type)
{
case 0: DX_RELEASE(m_vertexShader, 0);
BX_FALLTHROUGH;
default: DX_RELEASE(m_pixelShader, 0);
}
}

Просмотреть файл

@ -1766,11 +1766,13 @@ VK_IMPORT_DEVICE
vkDestroy(m_pipelineLayout);
vkDestroy(m_descriptorSetLayout);
vkDestroy(m_descriptorPool);
BX_FALLTHROUGH;
case ErrorState::CommandBuffersCreated:
vkFreeCommandBuffers(m_device, m_commandPool, BX_COUNTOF(m_commandBuffers), m_commandBuffers);
vkDestroy(m_commandPool);
vkDestroy(m_fence);
BX_FALLTHROUGH;
case ErrorState::SwapchainCreated:
for (uint32_t ii = 0; ii < BX_COUNTOF(m_backBufferColorImageView); ++ii)
@ -1791,15 +1793,19 @@ VK_IMPORT_DEVICE
}
}
vkDestroy(m_swapchain);
BX_FALLTHROUGH;
case ErrorState::SurfaceCreated:
vkDestroySurfaceKHR(m_instance, m_surface, m_allocatorCb);
BX_FALLTHROUGH;
case ErrorState::RenderPassCreated:
vkDestroy(m_renderPass);
BX_FALLTHROUGH;
case ErrorState::DeviceCreated:
vkDestroyDevice(m_device, m_allocatorCb);
BX_FALLTHROUGH;
case ErrorState::InstanceCreated:
if (VK_NULL_HANDLE != m_debugReportCallback)
@ -1808,12 +1814,14 @@ VK_IMPORT_DEVICE
}
vkDestroyInstance(m_instance, m_allocatorCb);
BX_FALLTHROUGH;
case ErrorState::LoadedVulkan1:
bx::dlclose(m_vulkan1dll);
m_vulkan1dll = NULL;
m_allocatorCb = NULL;
unloadRenderDoc(m_renderdocdll);
BX_FALLTHROUGH;
case ErrorState::Default:
break;