gallium/drivers: Trivial code-style cleanup

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Edward O'Callaghan
2015-12-04 16:47:56 +11:00
committed by Marek Olšák
parent 34782eec31
commit 25b3d554c4
16 changed files with 58 additions and 58 deletions

View 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;
}

View 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)

View 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",

View 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;

View 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;

View 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);

View 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);

View 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);

View 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))

View 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));

View 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 */

View 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;

View 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;
}

View 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;

View 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));

View 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;