From: Brian Paul Date: Wed, 10 Sep 2014 14:16:24 +0000 (-0600) Subject: mesa: fix UNCLAMPED_FLOAT_TO_UBYTE() macro for MSVC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9608193cbc6ea14e49adcd0193f9e7c6058d5a2f;p=mesa.git mesa: fix UNCLAMPED_FLOAT_TO_UBYTE() macro for MSVC MSVC replaces the "F" in "255.0F" with the macro argument which leads to an error. s/F/FLT/ to avoid that. It turns out we weren't using this macro at all on MSVC until the recent "mesa: Drop USE_IEEE define." change. Reviewed-by: Roland Scheidegger --- diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 7b6148d0940..712699f75a8 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -144,10 +144,10 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; /* This function/macro is sensitive to precision. Test very carefully * if you change it! */ -#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \ +#define UNCLAMPED_FLOAT_TO_UBYTE(UB, FLT) \ do { \ fi_type __tmp; \ - __tmp.f = (F); \ + __tmp.f = (FLT); \ if (__tmp.i < 0) \ UB = (GLubyte) 0; \ else if (__tmp.i >= IEEE_ONE) \ @@ -157,10 +157,10 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; UB = (GLubyte) __tmp.i; \ } \ } while (0) -#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \ +#define CLAMPED_FLOAT_TO_UBYTE(UB, FLT) \ do { \ fi_type __tmp; \ - __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = (FLT) * (255.0F/256.0F) + 32768.0F; \ UB = (GLubyte) __tmp.i; \ } while (0) #else