summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2015-12-04 17:12:30 +1100
committerMarek Olšák <[email protected]>2015-12-06 17:10:22 +0100
commit147fd00bb36917f8463aacd49a26e95ca0926255 (patch)
tree377b6ed379b13754e2f18bf392a3b84c6babcf01 /src/gallium/auxiliary/util
parent25b3d554c4403b3b63f58cea6f0fc0cf3232a1c0 (diff)
gallium/auxiliary: Trivial code style cleanup
Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_bitmask.c4
-rw-r--r--src/gallium/auxiliary/util/u_cache.c2
-rw-r--r--src/gallium/auxiliary/util/u_debug.c10
-rw-r--r--src/gallium/auxiliary/util/u_debug_memory.c10
-rw-r--r--src/gallium/auxiliary/util/u_debug_refcnt.c2
-rw-r--r--src/gallium/auxiliary/util/u_dump_state.c34
-rw-r--r--src/gallium/auxiliary/util/u_handle_table.c10
-rw-r--r--src/gallium/auxiliary/util/u_hash_table.c8
-rw-r--r--src/gallium/auxiliary/util/u_surfaces.c4
9 files changed, 42 insertions, 42 deletions
diff --git a/src/gallium/auxiliary/util/u_bitmask.c b/src/gallium/auxiliary/util/u_bitmask.c
index b19be29a5a4..c22f5068923 100644
--- a/src/gallium/auxiliary/util/u_bitmask.c
+++ b/src/gallium/auxiliary/util/u_bitmask.c
@@ -66,7 +66,7 @@ util_bitmask_create(void)
struct util_bitmask *bm;
bm = MALLOC_STRUCT(util_bitmask);
- if(!bm)
+ if (!bm)
return NULL;
bm->words = (util_bitmask_word *)CALLOC(UTIL_BITMASK_INITIAL_WORDS, sizeof(util_bitmask_word));
@@ -114,7 +114,7 @@ util_bitmask_resize(struct util_bitmask *bm,
new_words = (util_bitmask_word *)REALLOC((void *)bm->words,
bm->size / UTIL_BITMASK_BITS_PER_BYTE,
new_size / UTIL_BITMASK_BITS_PER_BYTE);
- if(!new_words)
+ if (!new_words)
return FALSE;
memset(new_words + bm->size/UTIL_BITMASK_BITS_PER_WORD,
diff --git a/src/gallium/auxiliary/util/u_cache.c b/src/gallium/auxiliary/util/u_cache.c
index da0856981eb..acc82bac0ff 100644
--- a/src/gallium/auxiliary/util/u_cache.c
+++ b/src/gallium/auxiliary/util/u_cache.c
@@ -95,7 +95,7 @@ util_cache_create(uint32_t (*hash)(const void *key),
struct util_cache *cache;
cache = CALLOC_STRUCT(util_cache);
- if(!cache)
+ if (!cache)
return NULL;
cache->hash = hash;
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index 702953673ba..cb162d89a58 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -153,7 +153,7 @@ debug_get_option(const char *name, const char *dfault)
const char *result;
result = os_get_option(name);
- if(!result)
+ if (!result)
result = dfault;
if (debug_get_option_should_print())
@@ -557,7 +557,7 @@ void debug_dump_surface(struct pipe_context *pipe,
surface->u.tex.first_layer,
PIPE_TRANSFER_READ,
0, 0, surface->width, surface->height, &transfer);
- if(!data)
+ if (!data)
return;
debug_dump_image(prefix,
@@ -654,7 +654,7 @@ debug_dump_transfer_bmp(struct pipe_context *pipe,
transfer->box.height *
transfer->box.depth *
4*sizeof(float));
- if(!rgba)
+ if (!rgba)
goto error1;
pipe_get_tile_rgba(transfer, ptr, 0, 0,
@@ -680,7 +680,7 @@ debug_dump_float_rgba_bmp(const char *filename,
struct bmp_info_header bmih;
unsigned x, y;
- if(!rgba)
+ if (!rgba)
goto error1;
bmfh.bfType = 0x4d42;
@@ -702,7 +702,7 @@ debug_dump_float_rgba_bmp(const char *filename,
bmih.biClrImportant = 0;
stream = fopen(filename, "wb");
- if(!stream)
+ if (!stream)
goto error1;
fwrite(&bmfh, 14, 1, stream);
diff --git a/src/gallium/auxiliary/util/u_debug_memory.c b/src/gallium/auxiliary/util/u_debug_memory.c
index 3e7ecfa79f3..f1cc8eb1b7c 100644
--- a/src/gallium/auxiliary/util/u_debug_memory.c
+++ b/src/gallium/auxiliary/util/u_debug_memory.c
@@ -128,7 +128,7 @@ debug_malloc(const char *file, unsigned line, const char *function,
struct debug_memory_footer *ftr;
hdr = os_malloc(sizeof(*hdr) + size + sizeof(*ftr));
- if(!hdr) {
+ if (!hdr) {
debug_printf("%s:%u:%s: out of memory when trying to allocate %lu bytes\n",
file, line, function,
(long unsigned)size);
@@ -167,7 +167,7 @@ debug_free(const char *file, unsigned line, const char *function,
struct debug_memory_header *hdr;
struct debug_memory_footer *ftr;
- if(!ptr)
+ if (!ptr)
return;
hdr = header_from_data(ptr);
@@ -213,7 +213,7 @@ debug_calloc(const char *file, unsigned line, const char *function,
size_t count, size_t size )
{
void *ptr = debug_malloc( file, line, function, count * size );
- if( ptr )
+ if (ptr)
memset( ptr, 0, count * size );
return ptr;
}
@@ -226,7 +226,7 @@ debug_realloc(const char *file, unsigned line, const char *function,
struct debug_memory_footer *old_ftr, *new_ftr;
void *new_ptr;
- if(!old_ptr)
+ if (!old_ptr)
return debug_malloc( file, line, function, new_size );
if(!new_size) {
@@ -253,7 +253,7 @@ debug_realloc(const char *file, unsigned line, const char *function,
/* alloc new */
new_hdr = os_malloc(sizeof(*new_hdr) + new_size + sizeof(*new_ftr));
- if(!new_hdr) {
+ if (!new_hdr) {
debug_printf("%s:%u:%s: out of memory when trying to allocate %lu bytes\n",
file, line, function,
(long unsigned)new_size);
diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c
index a51b4c55f83..2c3dc986a90 100644
--- a/src/gallium/auxiliary/util/u_debug_refcnt.c
+++ b/src/gallium/auxiliary/util/u_debug_refcnt.c
@@ -79,7 +79,7 @@ static boolean debug_serial(void* p, unsigned* pserial)
#endif
pipe_mutex_lock(serials_mutex);
- if(!serials_hash)
+ if (!serials_hash)
serials_hash = util_hash_table_create(hash_ptr, compare_ptr);
serial = (unsigned)(uintptr_t)util_hash_table_get(serials_hash, p);
if(!serial)
diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c
index 441d16236b5..a73a1de2f0b 100644
--- a/src/gallium/auxiliary/util/u_dump_state.c
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -320,7 +320,7 @@ util_dump_resource(FILE *stream, const struct pipe_resource *state)
void
util_dump_rasterizer_state(FILE *stream, const struct pipe_rasterizer_state *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -374,7 +374,7 @@ util_dump_rasterizer_state(FILE *stream, const struct pipe_rasterizer_state *sta
void
util_dump_poly_stipple(FILE *stream, const struct pipe_poly_stipple *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -392,7 +392,7 @@ util_dump_poly_stipple(FILE *stream, const struct pipe_poly_stipple *state)
void
util_dump_viewport_state(FILE *stream, const struct pipe_viewport_state *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -409,7 +409,7 @@ util_dump_viewport_state(FILE *stream, const struct pipe_viewport_state *state)
void
util_dump_scissor_state(FILE *stream, const struct pipe_scissor_state *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -430,7 +430,7 @@ util_dump_clip_state(FILE *stream, const struct pipe_clip_state *state)
{
unsigned i;
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -456,7 +456,7 @@ util_dump_shader_state(FILE *stream, const struct pipe_shader_state *state)
{
unsigned i;
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -500,7 +500,7 @@ util_dump_depth_stencil_alpha_state(FILE *stream, const struct pipe_depth_stenci
{
unsigned i;
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -579,7 +579,7 @@ util_dump_blend_state(FILE *stream, const struct pipe_blend_state *state)
{
unsigned valid_entries = 1;
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -611,7 +611,7 @@ util_dump_blend_state(FILE *stream, const struct pipe_blend_state *state)
void
util_dump_blend_color(FILE *stream, const struct pipe_blend_color *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -626,7 +626,7 @@ util_dump_blend_color(FILE *stream, const struct pipe_blend_color *state)
void
util_dump_stencil_ref(FILE *stream, const struct pipe_stencil_ref *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -656,7 +656,7 @@ util_dump_framebuffer_state(FILE *stream, const struct pipe_framebuffer_state *s
void
util_dump_sampler_state(FILE *stream, const struct pipe_sampler_state *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -686,7 +686,7 @@ util_dump_sampler_state(FILE *stream, const struct pipe_sampler_state *state)
void
util_dump_surface(FILE *stream, const struct pipe_surface *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -770,7 +770,7 @@ util_dump_sampler_view(FILE *stream, const struct pipe_sampler_view *state)
void
util_dump_transfer(FILE *stream, const struct pipe_transfer *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -832,7 +832,7 @@ util_dump_index_buffer(FILE *stream, const struct pipe_index_buffer *state)
void
util_dump_vertex_buffer(FILE *stream, const struct pipe_vertex_buffer *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -851,7 +851,7 @@ util_dump_vertex_buffer(FILE *stream, const struct pipe_vertex_buffer *state)
void
util_dump_vertex_element(FILE *stream, const struct pipe_vertex_element *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -889,7 +889,7 @@ util_dump_stream_output_target(FILE *stream,
void
util_dump_draw_info(FILE *stream, const struct pipe_draw_info *state)
{
- if(!state) {
+ if (!state) {
util_dump_null(stream);
return;
}
@@ -924,7 +924,7 @@ util_dump_draw_info(FILE *stream, const struct pipe_draw_info *state)
void util_dump_box(FILE *stream, const struct pipe_box *box)
{
- if(!box) {
+ if (!box) {
util_dump_null(stream);
return;
}
diff --git a/src/gallium/auxiliary/util/u_handle_table.c b/src/gallium/auxiliary/util/u_handle_table.c
index 42c4e44b644..c6eeeef0f3a 100644
--- a/src/gallium/auxiliary/util/u_handle_table.c
+++ b/src/gallium/auxiliary/util/u_handle_table.c
@@ -64,7 +64,7 @@ handle_table_create(void)
struct handle_table *ht;
ht = MALLOC_STRUCT(handle_table);
- if(!ht)
+ if (!ht)
return NULL;
ht->objects = (void **)CALLOC(HANDLE_TABLE_INITIAL_SIZE, sizeof(void *));
@@ -114,7 +114,7 @@ handle_table_resize(struct handle_table *ht,
new_objects = (void **)REALLOC((void *)ht->objects,
ht->size*sizeof(void *),
new_size*sizeof(void *));
- if(!new_objects)
+ if (!new_objects)
return 0;
memset(new_objects + ht->size, 0, (new_size - ht->size)*sizeof(void *));
@@ -139,7 +139,7 @@ handle_table_clear(struct handle_table *ht,
*/
object = ht->objects[index];
- if(object) {
+ if (object) {
ht->objects[index] = NULL;
if(ht->destroy)
@@ -199,7 +199,7 @@ handle_table_set(struct handle_table *ht,
return 0;
assert(object);
- if(!object)
+ if (!object)
return 0;
index = handle - 1;
@@ -247,7 +247,7 @@ handle_table_remove(struct handle_table *ht,
index = handle - 1;
object = ht->objects[index];
- if(!object)
+ if (!object)
return;
handle_table_clear(ht, index);
diff --git a/src/gallium/auxiliary/util/u_hash_table.c b/src/gallium/auxiliary/util/u_hash_table.c
index a505fbc4d83..9e2b6b7de8b 100644
--- a/src/gallium/auxiliary/util/u_hash_table.c
+++ b/src/gallium/auxiliary/util/u_hash_table.c
@@ -82,7 +82,7 @@ util_hash_table_create(unsigned (*hash)(void *key),
struct util_hash_table *ht;
ht = MALLOC_STRUCT(util_hash_table);
- if(!ht)
+ if (!ht)
return NULL;
ht->cso = cso_hash_create();
@@ -154,14 +154,14 @@ util_hash_table_set(struct util_hash_table *ht,
key_hash = ht->hash(key);
item = util_hash_table_find_item(ht, key, key_hash);
- if(item) {
+ if (item) {
/* TODO: key/value destruction? */
item->value = value;
return PIPE_OK;
}
item = MALLOC_STRUCT(util_hash_table_item);
- if(!item)
+ if (!item)
return PIPE_ERROR_OUT_OF_MEMORY;
item->key = key;
@@ -191,7 +191,7 @@ util_hash_table_get(struct util_hash_table *ht,
key_hash = ht->hash(key);
item = util_hash_table_find_item(ht, key, key_hash);
- if(!item)
+ if (!item)
return NULL;
return item->value;
diff --git a/src/gallium/auxiliary/util/u_surfaces.c b/src/gallium/auxiliary/util/u_surfaces.c
index c2f2b74c939..78b2506e47b 100644
--- a/src/gallium/auxiliary/util/u_surfaces.c
+++ b/src/gallium/auxiliary/util/u_surfaces.c
@@ -59,7 +59,7 @@ util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size,
}
ps = (struct pipe_surface *)CALLOC(1, surface_struct_size);
- if(!ps)
+ if (!ps)
{
*res = NULL;
return FALSE;
@@ -114,7 +114,7 @@ util_surfaces_destroy(struct util_surfaces *us, struct pipe_resource *pt, void (
for(i = 0; i <= pt->last_level; ++i)
{
struct pipe_surface *ps = us->u.array[i];
- if(ps)
+ if (ps)
destroy_surface(ps);
}
FREE(us->u.array);