From aba4e6810f8b4d0e459137b64e061a2cadc457d1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 31 May 2019 23:21:16 +1000 Subject: Cleanup: style, use braces in source/ (include disabled blocks) --- source/blender/gpu/intern/gpu_codegen.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'source/blender/gpu/intern/gpu_codegen.c') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 8dda98ab990..12c35d76ac4 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -328,23 +328,29 @@ static char *gpu_generate_function_prototyps(GHash *hash) BLI_dynstr_appendf(ds, "void %s(", name); for (a = 0; a < function->totparam; a++) { - if (function->paramqual[a] == FUNCTION_QUAL_OUT) + if (function->paramqual[a] == FUNCTION_QUAL_OUT) { BLI_dynstr_append(ds, "out "); - else if (function->paramqual[a] == FUNCTION_QUAL_INOUT) + } + else if (function->paramqual[a] == FUNCTION_QUAL_INOUT) { BLI_dynstr_append(ds, "inout "); + } - if (function->paramtype[a] == GPU_TEX2D) + if (function->paramtype[a] == GPU_TEX2D) { BLI_dynstr_append(ds, "sampler2D"); - else if (function->paramtype[a] == GPU_SHADOW2D) + } + else if (function->paramtype[a] == GPU_SHADOW2D) { BLI_dynstr_append(ds, "sampler2DShadow"); - else + } + else { BLI_dynstr_append(ds, GPU_DATATYPE_STR[function->paramtype[a]]); + } # if 0 BLI_dynstr_appendf(ds, " param%d", a); # endif - if (a != function->totparam - 1) + if (a != function->totparam - 1) { BLI_dynstr_append(ds, ", "); + } } BLI_dynstr_append(ds, ");\n"); } @@ -937,8 +943,9 @@ static char *code_generate_fragment(GPUMaterial *material, BLI_dynstr_free(ds); #if 0 - if (G.debug & G_DEBUG) + if (G.debug & G_DEBUG) { printf("%s\n", code); + } #endif return code; @@ -1209,8 +1216,9 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u BLI_dynstr_free(ds); #if 0 - if (G.debug & G_DEBUG) + if (G.debug & G_DEBUG) { printf("%s\n", code); + } #endif return code; -- cgit v1.2.3