[Mesa-dev] [PATCH 1/6] gallium: Remove unnecessary semicolons
Marek Olšák
maraeo at gmail.com
Thu Dec 17 03:04:08 PST 2015
On Thu, Dec 17, 2015 at 5:13 AM, Matt Turner <mattst88 at gmail.com> wrote:
> On Wed, Dec 16, 2015 at 7:41 PM, Edward O'Callaghan
> <eocallaghan at alterapraxis.com> wrote:
>> Fix silly issue with MSVC case fall-though support to need
>> a extra 'break;'
>>
>> Found-by: Coccinelle
>> Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
>> Reviewed-by: Brian Paul <brianp at vmware.com>
>> ---
>> src/gallium/auxiliary/draw/draw_pipe_aaline.c | 2 +-
>> src/gallium/auxiliary/gallivm/lp_bld_swizzle.c | 2 +-
>> src/gallium/auxiliary/nir/tgsi_to_nir.c | 2 +-
>> src/gallium/auxiliary/util/u_surface.c | 3 ++-
>> src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | 2 +-
>> src/gallium/state_trackers/nine/swapchain9.c | 2 +-
>> src/gallium/state_trackers/omx/entrypoint.c | 2 +-
>> src/gallium/state_trackers/vdpau/mixer.c | 2 +-
>> 8 files changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
>> index 877db59..4a676b7 100644
>> --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
>> +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
>> @@ -937,7 +937,7 @@ draw_aaline_prepare_outputs(struct draw_context *draw,
>> const struct pipe_rasterizer_state *rast = draw->rasterizer;
>>
>> /* update vertex attrib info */
>> - aaline->pos_slot = draw_current_shader_position_output(draw);;
>> + aaline->pos_slot = draw_current_shader_position_output(draw);
>>
>> if (!rast->line_smooth)
>> return;
>> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
>> index b1aef71..f571838 100644
>> --- a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
>> +++ b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
>> @@ -720,7 +720,7 @@ lp_build_transpose_aos_n(struct gallivm_state *gallivm,
>>
>> default:
>> assert(0);
>> - };
>> + }
>> }
>>
>>
>> diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
>> index 5def6d3..5cbe8e9 100644
>> --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
>> +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
>> @@ -1951,7 +1951,7 @@ tgsi_processor_to_shader_stage(unsigned processor)
>> case TGSI_PROCESSOR_COMPUTE: return MESA_SHADER_COMPUTE;
>> default:
>> unreachable("invalid TGSI processor");
>> - };
>> + }
>> }
>>
>> struct nir_shader *
>> diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
>> index 6aa44f9..c150d92 100644
>> --- a/src/gallium/auxiliary/util/u_surface.c
>> +++ b/src/gallium/auxiliary/util/u_surface.c
>> @@ -600,7 +600,8 @@ is_box_inside_resource(const struct pipe_resource *res,
>> depth = res->array_size;
>> assert(res->array_size % 6 == 0);
>> break;
>> - case PIPE_MAX_TEXTURE_TYPES:;
>
> Yuck! I have never seen this before.
>
> Grepping for ':;' turns up a bunch more of these. They all seem to
> blame to Marek. Can we please not do this?
AFAIK, default:; is the simplest way to add an empty default statement
to hide warnings showing unhandled cases. break; isn't very useful if
it's the last statement.
Marek
More information about the mesa-dev
mailing list