gallium/drivers: Trivial code-style cleanup
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Fri, 4 Dec 2015 05:47:56 +0000 (16:47 +1100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 6 Dec 2015 16:10:22 +0000 (17:10 +0100)
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
16 files changed:
src/gallium/drivers/i915/i915_prim_vbuf.c
src/gallium/drivers/llvmpipe/lp_state_blend.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_test_main.c
src/gallium/drivers/llvmpipe/lp_tex_sample.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/rbug/rbug_objects.c
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_dump.c
src/gallium/drivers/trace/tr_dump_state.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/drivers/trace/tr_texture.c
src/gallium/drivers/trace/tr_texture.h

index 8f61f151e0c84636dee6e3d7f850cea1b38c41b4..c0ba23b3be85d62da53bfd19a5a2fed3b047534a 100644 (file)
@@ -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;
    }
index e38de9aca0ad68c7d5120f6a0aa100f509cc188e..3c898c38c24e8ffdfa4a34db85e61a7bda16a462 100644 (file)
@@ -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)
index f55f6b4fa4f02767600300a6ca695e9b636051c9..079083e96014160365d18afa344b6998f095b51e 100644 (file)
@@ -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",
index d835dbbd62e6868abe99e06dc8d5187b105c9db0..3bcbac3460156d0759bb0b1c58b9b90e468e9166 100644 (file)
@@ -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;
index 217abe963b7fdffacd7917c42eccf64648c94f12..5762b7b483344c4cf67948aaea6d151e052482ae 100644 (file)
@@ -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;
index 828688145812fdca42ab04fd30bc4d967d22dd1a..ae266ceb082cb47ca5aaf72b1e2d404dbb2d356a 100644 (file)
@@ -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);
index e68d23e5587fe83d2acb33d4d2ff72e171b7a414..b9cfb313fb54a43d82b9436e82c01a5c27a7beb3 100644 (file)
@@ -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);
index dbbb8baad795043ca7a3decd6901ae57c9cdbb05..7ce51a118c8917c89328f45db671a258cab3f0d8 100644 (file)
@@ -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);
index 91faa82612ffeb8aa37cc1da56eaafeb67091099..164b84b313612959f5384eaa28f0bfba9c44a0ac 100644 (file)
@@ -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))
index 25d55a383c2f4388ecef64fb433ac824e8134bf6..2aa4e123f8787d2de17496b9ddcc41ee8b91d128 100644 (file)
@@ -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));
index 7f6d0645112fe296083978fc4a7659661bf34193..d4c88c9be6d0528974ab839b70686513bd7a8dd0 100644 (file)
@@ -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 */
index 601e2cbbec51feffee9ba8b1a6e49af3bd77868a..b173b8abf894f0bb6f4eda575d1ba499f3e81d04 100644 (file)
@@ -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("</trace>\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;
index 9bf4a722d8010c7d1e8d2648ab0bb2c82bd9df64..54f022a8ab66fe351c8df2d6525362c17acb6381 100644 (file)
@@ -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;
    }
index 62a51e9a94dc649c4ff66b3922444e15410e7acd..ff057e2a4a40a3cf2384f24b22d676459cf6ae99 100644 (file)
@@ -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;
index ebc47870622718b394b93351ccdafb780d1aefa9..47845a35a64b5fa1fccbb03df3952fd8d99e8dcc 100644 (file)
@@ -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));
index e48b7b39e2405e3dbb09af8e30764044251bbdaf..af508511567e02919c94dd4552fb0d37dde0bd43 100644 (file)
@@ -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;