Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-08-07 15:36:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-07 15:37:39 +0300
commitb134434224254d4ac3fc73d023f2f6d914746690 (patch)
treeb67d2c5aee982495d55848414c362665a37476b0 /source/blender/editors/screen
parent3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff)
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/editors/screen/glutil.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 9616b8114ba..58fb934ebf0 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -291,7 +291,7 @@ static void region_draw_azone_tab_arrow(ScrArea *area, ARegion *region, AZone *a
/* Workaround for different color spaces between normal areas and the ones using GPUViewports. */
float alpha = WM_region_use_viewport(area, region) ? 0.6f : 0.4f;
- float color[4] = {0.05f, 0.05f, 0.05f, alpha};
+ const float color[4] = {0.05f, 0.05f, 0.05f, alpha};
UI_draw_roundbox_aa(
true, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, color);
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