diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-24 03:06:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-24 03:06:18 +0300 |
commit | 79f67acccb36fd67f534b75f1d0f7e0799080c24 (patch) | |
tree | eedea1b1ab9ef35fa6353c8b2a72cf1a291358ac /source/blender/draw | |
parent | 106551b9ad1f12937c976ea7d38d00ec0df40abc (diff) |
Cleanup: redundant NULL initialization
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_deferred.c | 12 | ||||
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_forward.c | 8 |
2 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index 565597decb5..dfd8152ae06 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -119,8 +119,6 @@ extern char datatoc_gpu_shader_depth_only_frag_glsl[]; static char *workbench_build_composite_frag(WORKBENCH_PrivateData *wpd) { - char *str = NULL; - DynStr *ds = BLI_dynstr_new(); BLI_dynstr_append(ds, datatoc_workbench_data_lib_glsl); @@ -139,22 +137,20 @@ static char *workbench_build_composite_frag(WORKBENCH_PrivateData *wpd) BLI_dynstr_append(ds, datatoc_workbench_deferred_composite_frag_glsl); - str = BLI_dynstr_get_cstring(ds); + char *str = BLI_dynstr_get_cstring(ds); BLI_dynstr_free(ds); return str; } static char *workbench_build_prepass_frag(void) { - char *str = NULL; - DynStr *ds = BLI_dynstr_new(); BLI_dynstr_append(ds, datatoc_workbench_data_lib_glsl); BLI_dynstr_append(ds, datatoc_workbench_common_lib_glsl); BLI_dynstr_append(ds, datatoc_workbench_prepass_frag_glsl); - str = BLI_dynstr_get_cstring(ds); + char *str = BLI_dynstr_get_cstring(ds); BLI_dynstr_free(ds); return str; } @@ -173,8 +169,6 @@ static char *workbench_build_prepass_vert(bool is_hair) static char *workbench_build_cavity_frag(bool cavity, bool curvature, bool high_dpi) { - char *str = NULL; - DynStr *ds = BLI_dynstr_new(); if (cavity) { @@ -194,7 +188,7 @@ static char *workbench_build_cavity_frag(bool cavity, bool curvature, bool high_ BLI_dynstr_append(ds, datatoc_workbench_cavity_frag_glsl); BLI_dynstr_append(ds, datatoc_workbench_cavity_lib_glsl); - str = BLI_dynstr_get_cstring(ds); + char *str = BLI_dynstr_get_cstring(ds); BLI_dynstr_free(ds); return str; } diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 1933e184a1f..45f1c632a05 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -97,8 +97,6 @@ static char *workbench_build_forward_vert(bool is_hair) static char *workbench_build_forward_transparent_accum_frag(void) { - char *str = NULL; - DynStr *ds = BLI_dynstr_new(); BLI_dynstr_append(ds, datatoc_workbench_data_lib_glsl); @@ -106,15 +104,13 @@ static char *workbench_build_forward_transparent_accum_frag(void) BLI_dynstr_append(ds, datatoc_workbench_world_light_lib_glsl); BLI_dynstr_append(ds, datatoc_workbench_forward_transparent_accum_frag_glsl); - str = BLI_dynstr_get_cstring(ds); + char *str = BLI_dynstr_get_cstring(ds); BLI_dynstr_free(ds); return str; } static char *workbench_build_forward_composite_frag(void) { - char *str = NULL; - DynStr *ds = BLI_dynstr_new(); BLI_dynstr_append(ds, datatoc_workbench_data_lib_glsl); @@ -124,7 +120,7 @@ static char *workbench_build_forward_composite_frag(void) BLI_dynstr_append(ds, datatoc_workbench_curvature_lib_glsl); BLI_dynstr_append(ds, datatoc_workbench_forward_composite_frag_glsl); - str = BLI_dynstr_get_cstring(ds); + char *str = BLI_dynstr_get_cstring(ds); BLI_dynstr_free(ds); return str; } |