From 25b3d554c4403b3b63f58cea6f0fc0cf3232a1c0 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 4 Dec 2015 16:47:56 +1100 Subject: [PATCH] gallium/drivers: Trivial code-style cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Edward O'Callaghan Signed-off-by: Marek Olšák --- src/gallium/drivers/i915/i915_prim_vbuf.c | 4 +- src/gallium/drivers/llvmpipe/lp_state_blend.c | 4 +- src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +- src/gallium/drivers/llvmpipe/lp_test_main.c | 4 +- src/gallium/drivers/llvmpipe/lp_tex_sample.c | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 2 +- .../drivers/nouveau/nv30/nvfx_fragprog.c | 2 +- .../drivers/nouveau/nv30/nvfx_vertprog.c | 2 +- src/gallium/drivers/r600/r600_asm.c | 2 +- src/gallium/drivers/rbug/rbug_objects.c | 12 +++--- src/gallium/drivers/trace/tr_context.c | 10 ++--- src/gallium/drivers/trace/tr_dump.c | 8 ++-- src/gallium/drivers/trace/tr_dump_state.c | 42 +++++++++---------- src/gallium/drivers/trace/tr_screen.c | 2 +- src/gallium/drivers/trace/tr_texture.c | 12 +++--- src/gallium/drivers/trace/tr_texture.h | 6 +-- 16 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c index 8f61f151e0c..c0ba23b3be8 100644 --- a/src/gallium/drivers/i915/i915_prim_vbuf.c +++ b/src/gallium/drivers/i915/i915_prim_vbuf.c @@ -761,11 +761,11 @@ struct draw_stage *i915_draw_vbuf_stage(struct i915_context *i915) struct draw_stage *stage; render = i915_vbuf_render_create(i915); - if(!render) + if (!render) return NULL; stage = draw_vbuf_stage(i915->draw, render); - if(!stage) { + if (!stage) { render->destroy(render); return NULL; } diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index e38de9aca0a..3c898c38c24 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -87,7 +87,7 @@ llvmpipe_set_blend_color(struct pipe_context *pipe, { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); - if(!blend_color) + if (!blend_color) return; if(memcmp(&llvmpipe->blend_color, blend_color, sizeof *blend_color) == 0) @@ -159,7 +159,7 @@ llvmpipe_set_stencil_ref(struct pipe_context *pipe, { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); - if(!stencil_ref) + if (!stencil_ref) return; if(memcmp(&llvmpipe->stencil_ref, stencil_ref, sizeof *stencil_ref) == 0) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index f55f6b4fa4f..079083e9601 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -2563,7 +2563,7 @@ generate_variant(struct llvmpipe_context *lp, char module_name[64]; variant = CALLOC_STRUCT(lp_fragment_shader_variant); - if(!variant) + if (!variant) return NULL; util_snprintf(module_name, sizeof(module_name), "fs%u_variant%u", diff --git a/src/gallium/drivers/llvmpipe/lp_test_main.c b/src/gallium/drivers/llvmpipe/lp_test_main.c index d835dbbd62e..3bcbac34601 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_main.c +++ b/src/gallium/drivers/llvmpipe/lp_test_main.c @@ -397,7 +397,7 @@ int main(int argc, char **argv) } #endif - if(fp) { + if (fp) { /* Warm up the caches */ test_some(0, NULL, 100); @@ -411,7 +411,7 @@ int main(int argc, char **argv) else success = test_all(verbose, fp); - if(fp) + if (fp) fclose(fp); return success ? 0 : 1; diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.c b/src/gallium/drivers/llvmpipe/lp_tex_sample.c index 217abe963b7..5762b7b4833 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.c @@ -309,7 +309,7 @@ lp_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state) struct lp_llvm_sampler_soa *sampler; sampler = CALLOC_STRUCT(lp_llvm_sampler_soa); - if(!sampler) + if (!sampler) return NULL; sampler->base.destroy = lp_llvm_sampler_soa_destroy; diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 82868814581..ae266ceb082 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -695,7 +695,7 @@ llvmpipe_user_buffer_create(struct pipe_screen *screen, struct llvmpipe_resource *buffer; buffer = CALLOC_STRUCT(llvmpipe_resource); - if(!buffer) + if (!buffer) return NULL; pipe_reference_init(&buffer->base.reference, 1); diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c index e68d23e5587..b9cfb313fb5 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c @@ -1186,7 +1186,7 @@ _nvfx_fragprog_translate(uint16_t oclass, struct nv30_fragprog *fp) out: tgsi_parse_free(&parse); - if(fpc) + if (fpc) { FREE(fpc->r_temp); FREE(fpc->r_imm); diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c index dbbb8baad79..7ce51a118c8 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c @@ -1113,7 +1113,7 @@ _nvfx_vertprog_translate(uint16_t oclass, struct nv30_vertprog *vp) out: tgsi_parse_free(&parse); - if(vpc) { + if (vpc) { util_dynarray_fini(&vpc->label_relocs); util_dynarray_fini(&vpc->loop_stack); FREE(vpc->r_temp); diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index 91faa82612f..164b84b3136 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -605,7 +605,7 @@ static int replace_gpr_with_pv_ps(struct r600_bytecode *bc, for (i = 0; i < max_slots; ++i) { struct r600_bytecode_alu *alu = slots[i]; - if(!alu) + if (!alu) continue; if (is_alu_64bit_inst(bc, alu)) diff --git a/src/gallium/drivers/rbug/rbug_objects.c b/src/gallium/drivers/rbug/rbug_objects.c index 25d55a383c2..2aa4e123f87 100644 --- a/src/gallium/drivers/rbug/rbug_objects.c +++ b/src/gallium/drivers/rbug/rbug_objects.c @@ -43,13 +43,13 @@ rbug_resource_create(struct rbug_screen *rb_screen, { struct rbug_resource *rb_resource; - if(!resource) + if (!resource) goto error; assert(resource->screen == rb_screen->screen); rb_resource = CALLOC_STRUCT(rbug_resource); - if(!rb_resource) + if (!rb_resource) goto error; memcpy(&rb_resource->base, resource, sizeof(struct pipe_resource)); @@ -88,13 +88,13 @@ rbug_surface_create(struct rbug_context *rb_context, { struct rbug_surface *rb_surface; - if(!surface) + if (!surface) goto error; assert(surface->texture == rb_resource->resource); rb_surface = CALLOC_STRUCT(rbug_surface); - if(!rb_surface) + if (!rb_surface) goto error; memcpy(&rb_surface->base, surface, sizeof(struct pipe_surface)); @@ -165,13 +165,13 @@ rbug_transfer_create(struct rbug_context *rb_context, { struct rbug_transfer *rb_transfer; - if(!transfer) + if (!transfer) goto error; assert(transfer->resource == rb_resource->resource); rb_transfer = CALLOC_STRUCT(rbug_transfer); - if(!rb_transfer) + if (!rb_transfer) goto error; memcpy(&rb_transfer->base, transfer, sizeof(struct pipe_transfer)); diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 7f6d0645112..d4c88c9be6d 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -72,7 +72,7 @@ trace_resource_unwrap(struct trace_context *tr_ctx, { struct trace_resource *tr_res; - if(!resource) + if (!resource) return NULL; tr_res = trace_resource(resource); @@ -89,7 +89,7 @@ trace_surface_unwrap(struct trace_context *tr_ctx, struct trace_screen *tr_scr = trace_screen(tr_ctx->base.screen); struct trace_surface *tr_surf; - if(!surface) + if (!surface) return NULL; assert(surface->texture); @@ -1284,7 +1284,7 @@ trace_context_flush(struct pipe_context *_pipe, pipe->flush(pipe, fence, flags); - if(fence) + if (fence) trace_dump_ret(ptr, *fence); trace_dump_call_end(); @@ -1539,14 +1539,14 @@ trace_context_create(struct trace_screen *tr_scr, { struct trace_context *tr_ctx; - if(!pipe) + if (!pipe) goto error1; if(!trace_enabled()) goto error1; tr_ctx = CALLOC_STRUCT(trace_context); - if(!tr_ctx) + if (!tr_ctx) goto error1; tr_ctx->base.priv = pipe->priv; /* expose wrapped priv data */ diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c index 601e2cbbec5..b173b8abf89 100644 --- a/src/gallium/drivers/trace/tr_dump.c +++ b/src/gallium/drivers/trace/tr_dump.c @@ -218,7 +218,7 @@ trace_dump_tag_end(const char *name) void trace_dump_trace_flush(void) { - if(stream) { + if (stream) { fflush(stream); } } @@ -226,7 +226,7 @@ trace_dump_trace_flush(void) static void trace_dump_trace_close(void) { - if(stream) { + if (stream) { trace_dump_writes("\n"); if (close_stream) { fclose(stream); @@ -257,10 +257,10 @@ trace_dump_trace_begin(void) const char *filename; filename = debug_get_option("GALLIUM_TRACE", NULL); - if(!filename) + if (!filename) return FALSE; - if(!stream) { + if (!stream) { if (strcmp(filename, "stderr") == 0) { close_stream = FALSE; diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 9bf4a722d80..54f022a8ab6 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -41,7 +41,7 @@ void trace_dump_resource_template(const struct pipe_resource *templat) if (!trace_dumping_enabled_locked()) return; - if(!templat) { + if (!templat) { trace_dump_null(); return; } @@ -82,7 +82,7 @@ void trace_dump_box(const struct pipe_box *box) if (!trace_dumping_enabled_locked()) return; - if(!box) { + if (!box) { trace_dump_null(); return; } @@ -105,7 +105,7 @@ void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -168,7 +168,7 @@ void trace_dump_poly_stipple(const struct pipe_poly_stipple *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -190,7 +190,7 @@ void trace_dump_viewport_state(const struct pipe_viewport_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -209,7 +209,7 @@ void trace_dump_scissor_state(const struct pipe_scissor_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -232,7 +232,7 @@ void trace_dump_clip_state(const struct pipe_clip_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -260,7 +260,7 @@ void trace_dump_shader_state(const struct pipe_shader_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -312,7 +312,7 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_ if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -382,7 +382,7 @@ void trace_dump_blend_state(const struct pipe_blend_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -411,7 +411,7 @@ void trace_dump_blend_color(const struct pipe_blend_color *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -428,7 +428,7 @@ void trace_dump_stencil_ref(const struct pipe_stencil_ref *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -462,7 +462,7 @@ void trace_dump_sampler_state(const struct pipe_sampler_state *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -495,7 +495,7 @@ void trace_dump_sampler_view_template(const struct pipe_sampler_view *state, if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -541,7 +541,7 @@ void trace_dump_surface_template(const struct pipe_surface *state, if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -582,7 +582,7 @@ void trace_dump_transfer(const struct pipe_transfer *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -611,7 +611,7 @@ void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -632,7 +632,7 @@ void trace_dump_index_buffer(const struct pipe_index_buffer *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -653,7 +653,7 @@ void trace_dump_vertex_element(const struct pipe_vertex_element *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -675,7 +675,7 @@ void trace_dump_constant_buffer(const struct pipe_constant_buffer *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } @@ -693,7 +693,7 @@ void trace_dump_draw_info(const struct pipe_draw_info *state) if (!trace_dumping_enabled_locked()) return; - if(!state) { + if (!state) { trace_dump_null(); return; } diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 62a51e9a94d..ff057e2a4a4 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -462,7 +462,7 @@ trace_screen_create(struct pipe_screen *screen) trace_dump_call_begin("", "pipe_screen_create"); tr_scr = CALLOC_STRUCT(trace_screen); - if(!tr_scr) + if (!tr_scr) goto error2; tr_scr->base.destroy = trace_screen_destroy; diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c index ebc47870622..47845a35a64 100644 --- a/src/gallium/drivers/trace/tr_texture.c +++ b/src/gallium/drivers/trace/tr_texture.c @@ -41,13 +41,13 @@ trace_resource_create(struct trace_screen *tr_scr, { struct trace_resource *tr_res; - if(!texture) + if (!texture) goto error; assert(texture->screen == tr_scr->screen); tr_res = CALLOC_STRUCT(trace_resource); - if(!tr_res) + if (!tr_res) goto error; memcpy(&tr_res->base, texture, sizeof(struct pipe_resource)); @@ -80,13 +80,13 @@ trace_surf_create(struct trace_context *tr_ctx, { struct trace_surface *tr_surf; - if(!surface) + if (!surface) goto error; assert(surface->texture == tr_res->resource); tr_surf = CALLOC_STRUCT(trace_surface); - if(!tr_surf) + if (!tr_surf) goto error; memcpy(&tr_surf->base, surface, sizeof(struct pipe_surface)); @@ -122,13 +122,13 @@ trace_transfer_create(struct trace_context *tr_ctx, { struct trace_transfer *tr_trans; - if(!transfer) + if (!transfer) goto error; assert(transfer->resource == tr_res->resource); tr_trans = CALLOC_STRUCT(trace_transfer); - if(!tr_trans) + if (!tr_trans) goto error; memcpy(&tr_trans->base, transfer, sizeof(struct pipe_transfer)); diff --git a/src/gallium/drivers/trace/tr_texture.h b/src/gallium/drivers/trace/tr_texture.h index e48b7b39e24..af508511567 100644 --- a/src/gallium/drivers/trace/tr_texture.h +++ b/src/gallium/drivers/trace/tr_texture.h @@ -88,7 +88,7 @@ struct trace_transfer static inline struct trace_resource * trace_resource(struct pipe_resource *texture) { - if(!texture) + if (!texture) return NULL; (void)trace_screen(texture->screen); return (struct trace_resource *)texture; @@ -98,7 +98,7 @@ trace_resource(struct pipe_resource *texture) static inline struct trace_surface * trace_surface(struct pipe_surface *surface) { - if(!surface) + if (!surface) return NULL; (void)trace_resource(surface->texture); return (struct trace_surface *)surface; @@ -117,7 +117,7 @@ trace_sampler_view(struct pipe_sampler_view *sampler_view) static inline struct trace_transfer * trace_transfer(struct pipe_transfer *transfer) { - if(!transfer) + if (!transfer) return NULL; (void)trace_resource(transfer->resource); return (struct trace_transfer *)transfer; -- 2.30.2