diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-17 23:21:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-17 23:21:47 +0400 |
commit | 61596d5bb365a96b4b19adf0ef72ec1ea47212aa (patch) | |
tree | 062ea3ff60bd643e88abef0d544e413f3dcfd8d5 /source/blender/blenlib | |
parent | 2b7ca2304a9b17568fac57a0bceba72b9c9ab580 (diff) |
patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes
made some small edits
- removed changes to AVI reading since the data types are apart of the format spec.
- absf -> abs for a double value in render code.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 11 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_color_inline.c | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 4a5ccd311c6..ef8a6015adb 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -225,10 +225,13 @@ #define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* Macro to convert a value to string in the preprocessor - * STRINGIFY_ARG: gives the defined name in the string - * STRINGIFY: gives the defined value. */ -#define STRINGIFY_ARG(x) #x -#define STRINGIFY(x) STRINGIFY_ARG(x) + * STRINGIFY_ARG: gives the argument as a string + * STRINGIFY_APPEND: appends any argument 'b' onto the string argument 'a', + * used by STRINGIFY because some preprocessors warn about zero arguments + * STRINGIFY: gives the argument's value as a string */ +#define STRINGIFY_ARG(x) "" #x +#define STRINGIFY_APPEND(a, b) "" a #b +#define STRINGIFY(x) STRINGIFY_APPEND("", x) /* useful for debugging */ #define AT __FILE__ ":" STRINGIFY(__LINE__) diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index 386452ed592..f8b986e799b 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -163,7 +163,7 @@ MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const f for(i=0; i<3; ++i) { t = linear[i] * inv_alpha; - srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha); + srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha); } srgb[3] = FTOUSHORT(linear[3]); |