Normalize case X : {} break; to case X : { break;}

Dawn was using a very uncommon way to do breaks from case statements
when a block was introduced for that case statement. Fix it by running
the following commands:

  git grep -l "} break;" | xargs sed -i "" -e "s/} break;/break;}/"
  git cl format

Some -Wunreachable-code-break become very apparent in this CL but and are
fixed in a follow-up to keep mechanical and manual changes separate.

Bug: None
Change-Id: I558eda92bb1c9d938cc7cf07b091b733b57d3aca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18660
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez
2020-04-02 16:45:17 +00:00
committed by Commit Bot service account
parent 5b29904d76
commit e8316538e3
18 changed files with 522 additions and 249 deletions

View File

@@ -33,60 +33,74 @@ namespace dawn_native {
case Command::BeginComputePass: {
BeginComputePassCmd* begin = commands->NextCommand<BeginComputePassCmd>();
begin->~BeginComputePassCmd();
} break;
break;
}
case Command::BeginRenderPass: {
BeginRenderPassCmd* begin = commands->NextCommand<BeginRenderPassCmd>();
begin->~BeginRenderPassCmd();
} break;
break;
}
case Command::CopyBufferToBuffer: {
CopyBufferToBufferCmd* copy = commands->NextCommand<CopyBufferToBufferCmd>();
copy->~CopyBufferToBufferCmd();
} break;
break;
}
case Command::CopyBufferToTexture: {
CopyBufferToTextureCmd* copy = commands->NextCommand<CopyBufferToTextureCmd>();
copy->~CopyBufferToTextureCmd();
} break;
break;
}
case Command::CopyTextureToBuffer: {
CopyTextureToBufferCmd* copy = commands->NextCommand<CopyTextureToBufferCmd>();
copy->~CopyTextureToBufferCmd();
} break;
break;
}
case Command::CopyTextureToTexture: {
CopyTextureToTextureCmd* copy =
commands->NextCommand<CopyTextureToTextureCmd>();
copy->~CopyTextureToTextureCmd();
} break;
break;
}
case Command::Dispatch: {
DispatchCmd* dispatch = commands->NextCommand<DispatchCmd>();
dispatch->~DispatchCmd();
} break;
break;
}
case Command::DispatchIndirect: {
DispatchIndirectCmd* dispatch = commands->NextCommand<DispatchIndirectCmd>();
dispatch->~DispatchIndirectCmd();
} break;
break;
}
case Command::Draw: {
DrawCmd* draw = commands->NextCommand<DrawCmd>();
draw->~DrawCmd();
} break;
break;
}
case Command::DrawIndexed: {
DrawIndexedCmd* draw = commands->NextCommand<DrawIndexedCmd>();
draw->~DrawIndexedCmd();
} break;
break;
}
case Command::DrawIndirect: {
DrawIndirectCmd* draw = commands->NextCommand<DrawIndirectCmd>();
draw->~DrawIndirectCmd();
} break;
break;
}
case Command::DrawIndexedIndirect: {
DrawIndexedIndirectCmd* draw = commands->NextCommand<DrawIndexedIndirectCmd>();
draw->~DrawIndexedIndirectCmd();
} break;
break;
}
case Command::EndComputePass: {
EndComputePassCmd* cmd = commands->NextCommand<EndComputePassCmd>();
cmd->~EndComputePassCmd();
} break;
break;
}
case Command::EndRenderPass: {
EndRenderPassCmd* cmd = commands->NextCommand<EndRenderPassCmd>();
cmd->~EndRenderPassCmd();
} break;
break;
}
case Command::ExecuteBundles: {
ExecuteBundlesCmd* cmd = commands->NextCommand<ExecuteBundlesCmd>();
auto bundles = commands->NextData<Ref<RenderBundleBase>>(cmd->count);
@@ -94,60 +108,73 @@ namespace dawn_native {
(&bundles[i])->~Ref<RenderBundleBase>();
}
cmd->~ExecuteBundlesCmd();
} break;
break;
}
case Command::InsertDebugMarker: {
InsertDebugMarkerCmd* cmd = commands->NextCommand<InsertDebugMarkerCmd>();
commands->NextData<char>(cmd->length + 1);
cmd->~InsertDebugMarkerCmd();
} break;
break;
}
case Command::PopDebugGroup: {
PopDebugGroupCmd* cmd = commands->NextCommand<PopDebugGroupCmd>();
cmd->~PopDebugGroupCmd();
} break;
break;
}
case Command::PushDebugGroup: {
PushDebugGroupCmd* cmd = commands->NextCommand<PushDebugGroupCmd>();
commands->NextData<char>(cmd->length + 1);
cmd->~PushDebugGroupCmd();
} break;
break;
}
case Command::SetComputePipeline: {
SetComputePipelineCmd* cmd = commands->NextCommand<SetComputePipelineCmd>();
cmd->~SetComputePipelineCmd();
} break;
break;
}
case Command::SetRenderPipeline: {
SetRenderPipelineCmd* cmd = commands->NextCommand<SetRenderPipelineCmd>();
cmd->~SetRenderPipelineCmd();
} break;
break;
}
case Command::SetStencilReference: {
SetStencilReferenceCmd* cmd = commands->NextCommand<SetStencilReferenceCmd>();
cmd->~SetStencilReferenceCmd();
} break;
break;
}
case Command::SetViewport: {
SetViewportCmd* cmd = commands->NextCommand<SetViewportCmd>();
cmd->~SetViewportCmd();
} break;
break;
}
case Command::SetScissorRect: {
SetScissorRectCmd* cmd = commands->NextCommand<SetScissorRectCmd>();
cmd->~SetScissorRectCmd();
} break;
break;
}
case Command::SetBlendColor: {
SetBlendColorCmd* cmd = commands->NextCommand<SetBlendColorCmd>();
cmd->~SetBlendColorCmd();
} break;
break;
}
case Command::SetBindGroup: {
SetBindGroupCmd* cmd = commands->NextCommand<SetBindGroupCmd>();
if (cmd->dynamicOffsetCount > 0) {
commands->NextData<uint32_t>(cmd->dynamicOffsetCount);
}
cmd->~SetBindGroupCmd();
} break;
break;
}
case Command::SetIndexBuffer: {
SetIndexBufferCmd* cmd = commands->NextCommand<SetIndexBufferCmd>();
cmd->~SetIndexBufferCmd();
} break;
break;
}
case Command::SetVertexBuffer: {
SetVertexBufferCmd* cmd = commands->NextCommand<SetVertexBufferCmd>();
cmd->~SetVertexBufferCmd();
} break;
break;
}
}
}
commands->DataWasDestroyed();
@@ -214,12 +241,14 @@ namespace dawn_native {
case Command::ExecuteBundles: {
auto* cmd = commands->NextCommand<ExecuteBundlesCmd>();
commands->NextData<Ref<RenderBundleBase>>(cmd->count);
} break;
break;
}
case Command::InsertDebugMarker: {
InsertDebugMarkerCmd* cmd = commands->NextCommand<InsertDebugMarkerCmd>();
commands->NextData<char>(cmd->length + 1);
} break;
break;
}
case Command::PopDebugGroup:
commands->NextCommand<PopDebugGroupCmd>();
@@ -228,7 +257,8 @@ namespace dawn_native {
case Command::PushDebugGroup: {
PushDebugGroupCmd* cmd = commands->NextCommand<PushDebugGroupCmd>();
commands->NextData<char>(cmd->length + 1);
} break;
break;
}
case Command::SetComputePipeline:
commands->NextCommand<SetComputePipelineCmd>();
@@ -259,7 +289,8 @@ namespace dawn_native {
if (cmd->dynamicOffsetCount > 0) {
commands->NextData<uint32_t>(cmd->dynamicOffsetCount);
}
} break;
break;
}
case Command::SetIndexBuffer:
commands->NextCommand<SetIndexBufferCmd>();
@@ -267,7 +298,8 @@ namespace dawn_native {
case Command::SetVertexBuffer: {
commands->NextCommand<SetVertexBufferCmd>();
} break;
break;
}
}
}