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-03-16 03:53:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-16 03:53:08 +0300
commit868573451f8bfacac25b1b6d53ff05e831508087 (patch)
tree60b8dd29fcc2648570acea440f4a2690f17b1d93 /source/blender/editors
parentf06a6e92bc5ee8f77ee9fedd77c7c307964bc708 (diff)
Cleanup: use unsigned char for UI_view2d_text_cache_add
Avoids casts when used with other UI code where the color is often unsigned.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/UI_view2d.h10
-rw-r--r--source/blender/editors/interface/view2d.c4
-rw-r--r--source/blender/editors/space_nla/nla_draw.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c4
4 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index ecdae3ead6b..ff9719d4674 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -250,13 +250,17 @@ char UI_view2d_rect_in_scrollers(const struct ARegion *region,
const struct rcti *rect);
/* cached text drawing in v2d, to allow pixel-aligned draw as post process */
-void UI_view2d_text_cache_add(
- struct View2D *v2d, float x, float y, const char *str, size_t str_len, const char col[4]);
+void UI_view2d_text_cache_add(struct View2D *v2d,
+ float x,
+ float y,
+ const char *str,
+ size_t str_len,
+ const unsigned char col[4]);
void UI_view2d_text_cache_add_rectf(struct View2D *v2d,
const struct rctf *rect_view,
const char *str,
size_t str_len,
- const char col[4]);
+ const unsigned char col[4]);
void UI_view2d_text_cache_draw(struct ARegion *region);
/* operators */
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 8ea1bd3ede6..ad2e32149d8 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -2146,7 +2146,7 @@ static MemArena *g_v2d_strings_arena = NULL;
static View2DString *g_v2d_strings = NULL;
void UI_view2d_text_cache_add(
- View2D *v2d, float x, float y, const char *str, size_t str_len, const char col[4])
+ View2D *v2d, float x, float y, const char *str, size_t str_len, const uchar col[4])
{
int mval[2];
@@ -2177,7 +2177,7 @@ void UI_view2d_text_cache_add(
/* no clip (yet) */
void UI_view2d_text_cache_add_rectf(
- View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const char col[4])
+ View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const uchar col[4])
{
rcti rect;
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 905e3eddc97..56176c1cb92 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -604,7 +604,7 @@ static void nla_draw_strip_text(AnimData *adt,
(nlt->flag & NLATRACK_SOLO) == 0);
char str[256];
size_t str_len;
- char col[4];
+ uchar col[4];
/* just print the name and the range */
if (strip->flag & NLASTRIP_FLAG_TEMP_META) {
@@ -652,7 +652,7 @@ static void nla_draw_strip_frames_text(
NlaTrack *UNUSED(nlt), NlaStrip *strip, View2D *v2d, float UNUSED(yminc), float ymaxc)
{
const float ytol = 1.0f; /* small offset to vertical positioning of text, for legibility */
- const char col[4] = {220, 220, 220, 255}; /* light gray */
+ const uchar col[4] = {220, 220, 220, 255}; /* light gray */
char numstr[32];
size_t numstr_len;
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index ef192f6c9db..864e518f182 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -542,7 +542,7 @@ static void draw_seq_handle(View2D *v2d,
}
if ((G.moving & G_TRANSFORM_SEQ) || (seq->flag & whichsel)) {
- const char col[4] = {255, 255, 255, 255};
+ const uchar col[4] = {255, 255, 255, 255};
char numstr[32];
size_t numstr_len;
@@ -574,7 +574,7 @@ static void draw_seq_text(View2D *v2d,
char str[32 + FILE_MAX];
size_t str_len;
const char *name = seq->name + 2;
- char col[4];
+ uchar col[4];
/* note, all strings should include 'name' */
if (name[0] == '\0') {