Cleanup: Clang tidy

This commit is contained in:
Hans Goudey 2020-11-03 15:12:50 -06:00
parent f109b63431
commit cabec08253
2 changed files with 12 additions and 12 deletions

View File

@ -533,9 +533,7 @@ static GPUUniformBuf *drw_sparse_uniform_buffer_get_ubo(DRWSparseUniformBuf *buf
if (buffer && chunk < buffer->num_chunks && BLI_BITMAP_TEST(buffer->chunk_used, chunk)) {
return buffer->chunk_ubos[chunk];
}
else {
return NULL;
}
return NULL;
}
/** Bind the UBO for the given chunk, if present. A NULL buffer pointer is handled as empty. */
@ -640,21 +638,23 @@ static bool drw_uniform_property_lookup(ID *id, const char *name, float r_data[4
if (arraylen == 0) {
float value;
if (type == PROP_FLOAT)
if (type == PROP_FLOAT) {
value = RNA_property_float_get(&ptr, prop);
else if (type == PROP_INT)
}
else if (type == PROP_INT) {
value = RNA_property_int_get(&ptr, prop);
else
}
else {
return false;
}
copy_v4_fl4(r_data, value, value, value, 1);
return true;
}
else if (type == PROP_FLOAT && arraylen <= 4) {
copy_v4_fl4(r_data, 0, 0, 0, 1);
RNA_property_float_get_array(&ptr, prop, r_data);
return true;
}
copy_v4_fl4(r_data, 0, 0, 0, 1);
RNA_property_float_get_array(&ptr, prop, r_data);
return true;
return false;
}

View File

@ -68,7 +68,7 @@ void DRW_sparse_uniform_buffer_free(DRWSparseUniformBuf *buffer);
bool DRW_sparse_uniform_buffer_is_empty(DRWSparseUniformBuf *buffer);
void DRW_sparse_uniform_buffer_bind(DRWSparseUniformBuf *buffer, int chunk, int location);
void DRW_sparse_uniform_buffer_unbind(DRWSparseUniformBuf *buffer, int chunk);
void *DRW_sparse_uniform_buffer_ensure_item(DRWSparseUniformBuf *buffer, int chunk, int item);
void *DRW_sparse_uniform_buffer_ensure_item(DRWSparseUniformBuf *pool, int chunk, int item);
/* Uniform attribute UBO management. */
struct GHash *DRW_uniform_attrs_pool_new(void);