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>2013-12-05 20:46:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-05 20:57:17 +0400
commit07ceb99213166b678f0a0bac9c35e9897f22e827 (patch)
tree70fc2e2639fe00ccb9f6ce94815245067b34454d /source/blender/blenlib/intern/math_color_inline.c
parentfac8e84632f3ce1b2a8d63fa083ca0aaa61c3267 (diff)
Code Cleanup: use strict flags for math lib, add inline declarations
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index 4af1307c521..bb2201541d9 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -173,10 +173,6 @@ MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned
srgb_to_linearrgb_predivide_v4(linear, fsrgb);
}
-/* color macros for themes */
-#define rgba_char_args_set_fl(col, r, g, b, a) \
- rgba_char_args_set(col, (r) * 255, (g) * 255, (b) * 255, (a) * 255)
-
MINLINE void rgba_char_args_set(char col[4], const char r, const char g, const char b, const char a)
{
col[0] = r;
@@ -228,7 +224,9 @@ MINLINE float rgb_to_grayscale(const float rgb[3])
MINLINE unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3])
{
- return (76 * (unsigned short) rgb[0] + 148 * (unsigned short) rgb[1] + 31 * (unsigned short) rgb[2]) / 255;
+ return (unsigned char)(((76 * (unsigned short)rgb[0]) +
+ (148 * (unsigned short)rgb[1]) +
+ (31 * (unsigned short)rgb[2])) / 255);
}
/* luma from defined by 'YCC_JFIF', see #rgb_to_ycc */
@@ -239,7 +237,9 @@ MINLINE float rgb_to_luma(const float rgb[3])
MINLINE unsigned char rgb_to_luma_byte(const unsigned char rgb[3])
{
- return (76 * (unsigned short) rgb[0] + 150 * (unsigned short) rgb[1] + 29 * (unsigned short) rgb[2]) / 255;
+ return (unsigned char)(((76 * (unsigned short)rgb[0]) +
+ (150 * (unsigned short)rgb[1]) +
+ (29 * (unsigned short)rgb[2])) / 255);
}
/* gamma-corrected RGB --> CIE XYZ