diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:36:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:37:39 +0300 |
commit | b134434224254d4ac3fc73d023f2f6d914746690 (patch) | |
tree | b67d2c5aee982495d55848414c362665a37476b0 /source/blender/editors/screen/glutil.c | |
parent | 3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff) |
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 07a122c7094..903013460d4 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -112,7 +112,7 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, int seamless, offset_x, offset_y, nsubparts_x, nsubparts_y; int components; const bool use_clipping = ((clip_min_x < clip_max_x) && (clip_min_y < clip_max_y)); - float white[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f}; if (ELEM(gpu_format, GPU_RGBA8, GPU_RGBA16F)) { components = 4; @@ -203,21 +203,21 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, * at edges of full image. */ if (subpart_w < tex_w) { void *data = DATA(src_y, src_x + subpart_w - 1); - int offset[2] = {subpart_w, 0}; - int extent[2] = {1, subpart_h}; + const int offset[2] = {subpart_w, 0}; + const int extent[2] = {1, subpart_h}; GPU_texture_update_sub(tex, gpu_data, data, UNPACK2(offset), 0, UNPACK2(extent), 0); } if (subpart_h < tex_h) { void *data = DATA(src_y + subpart_h - 1, src_x); - int offset[2] = {0, subpart_h}; - int extent[2] = {subpart_w, 1}; + const int offset[2] = {0, subpart_h}; + const int extent[2] = {subpart_w, 1}; GPU_texture_update_sub(tex, gpu_data, data, UNPACK2(offset), 0, UNPACK2(extent), 0); } if (subpart_w < tex_w && subpart_h < tex_h) { void *data = DATA(src_y + subpart_h - 1, src_x + subpart_w - 1); - int offset[2] = {subpart_w, subpart_h}; - int extent[2] = {1, 1}; + const int offset[2] = {subpart_w, subpart_h}; + const int extent[2] = {1, 1}; GPU_texture_update_sub(tex, gpu_data, data, UNPACK2(offset), 0, UNPACK2(extent), 0); } #undef DATA |