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>2019-08-05 21:20:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-05 21:35:22 +0300
commitb4a325f535e56e37f1a22c12f189b39552fd6ba7 (patch)
tree8cf0375dbd598546b7cee0891e578682bfd27646 /source/blender/blenlib
parent17f299c5d14f0435595afe51c4153ae4037bb81b (diff)
Cleanup: use unsigned char for theme colors
Nearly all byte-color functions use 'uchar' causing casts when then colors were passed in. Declare as uchar to remove the need for casts.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_color.h14
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c8
2 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h
index 03eb2b890cf..3bc3be8b022 100644
--- a/source/blender/blenlib/BLI_math_color.h
+++ b/source/blender/blenlib/BLI_math_color.h
@@ -140,12 +140,18 @@ MINLINE void float_to_byte_dither_v3(
#define rgba_float_args_set_ch(col, r, g, b, a) \
rgba_float_args_set(col, (r) / 255.0f, (g) / 255.0f, (b) / 255.0f, (a) / 255.0f)
-MINLINE void rgba_char_args_set(
- char col[4], const char r, const char g, const char b, const char a);
+MINLINE void rgba_uchar_args_set(unsigned char col[4],
+ const unsigned char r,
+ const unsigned char g,
+ const unsigned char b,
+ const unsigned char a);
MINLINE void rgba_float_args_set(
float col[4], const float r, const float g, const float b, const float a);
-MINLINE void rgba_char_args_test_set(
- char col[4], const char r, const char g, const char b, const char a);
+MINLINE void rgba_uchar_args_test_set(unsigned char col[4],
+ const unsigned char r,
+ const unsigned char g,
+ const unsigned char b,
+ const unsigned char a);
MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack);
void blackbody_temperature_to_rgb_table(float *r_table, int width, float min, float max);
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index d7a2d681f33..f5aaddc0ea3 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -225,8 +225,8 @@ MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned
srgb_to_linearrgb_predivide_v4(linear, fsrgb);
}
-MINLINE void rgba_char_args_set(
- char col[4], const char r, const char g, const char b, const char a)
+MINLINE void rgba_uchar_args_set(
+ uchar col[4], const uchar r, const uchar g, const uchar b, const uchar a)
{
col[0] = r;
col[1] = g;
@@ -243,8 +243,8 @@ MINLINE void rgba_float_args_set(
col[3] = a;
}
-MINLINE void rgba_char_args_test_set(
- char col[4], const char r, const char g, const char b, const char a)
+MINLINE void rgba_uchar_args_test_set(
+ uchar col[4], const uchar r, const uchar g, const uchar b, const uchar a)
{
if (col[3] == 0) {
col[0] = r;