summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/translate
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-16 11:42:08 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-16 11:42:08 +0900
commitfd6acabd2f62fe006b078ae7640a944c7f65903c (patch)
tree30bdb2e6c220d0814e91a7ffd6f3eb5c18560126 /src/gallium/auxiliary/translate
parente2269e94c0ecaa97c7153815489e59c9ca64c243 (diff)
gallium: Get the translate module to build on msvc.
Appearently MSVC c-preprocessor parses "255.0f" as two tokens: "255.0" and "f", and performs variable substitution on "f".
Diffstat (limited to 'src/gallium/auxiliary/translate')
-rw-r--r--src/gallium/auxiliary/translate/translate_generic.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c
index fc9060900b..e7fb1dcb2d 100644
--- a/src/gallium/auxiliary/translate/translate_generic.c
+++ b/src/gallium/auxiliary/translate/translate_generic.c
@@ -78,8 +78,8 @@ static struct translate_generic *translate_generic( struct translate *translate
static void \
fetch_##NAME(const void *ptr, float *attrib) \
{ \
- const float defaults[4] = { 0,0,0,1 }; \
- int i; \
+ const float defaults[4] = { 0.0f,0.0f,0.0f,1.0f }; \
+ unsigned i; \
\
for (i = 0; i < SZ; i++) { \
attrib[i] = FROM(i); \
@@ -121,24 +121,24 @@ emit_##NAME(const float *attrib, void *ptr) \
#define FROM_16_SNORM(i) ((float) ((short *) ptr)[i] / 32767.0f)
#define FROM_32_SNORM(i) ((float) ((int *) ptr)[i] / 2147483647.0f)
-#define TO_64_FLOAT(f) ((double) f)
-#define TO_32_FLOAT(f) (f)
+#define TO_64_FLOAT(x) ((double) x)
+#define TO_32_FLOAT(x) (x)
-#define TO_8_USCALED(f) ((unsigned char) f)
-#define TO_16_USCALED(f) ((unsigned short) f)
-#define TO_32_USCALED(f) ((unsigned int) f)
+#define TO_8_USCALED(x) ((unsigned char) x)
+#define TO_16_USCALED(x) ((unsigned short) x)
+#define TO_32_USCALED(x) ((unsigned int) x)
-#define TO_8_SSCALED(f) ((char) f)
-#define TO_16_SSCALED(f) ((short) f)
-#define TO_32_SSCALED(f) ((int) f)
+#define TO_8_SSCALED(x) ((char) x)
+#define TO_16_SSCALED(x) ((short) x)
+#define TO_32_SSCALED(x) ((int) x)
-#define TO_8_UNORM(f) ((unsigned char) (f * 255.0f))
-#define TO_16_UNORM(f) ((unsigned short) (f * 65535.0f))
-#define TO_32_UNORM(f) ((unsigned int) (f * 4294967295.0f))
+#define TO_8_UNORM(x) ((unsigned char) (x * 255.0f))
+#define TO_16_UNORM(x) ((unsigned short) (x * 65535.0f))
+#define TO_32_UNORM(x) ((unsigned int) (x * 4294967295.0f))
-#define TO_8_SNORM(f) ((char) (f * 127.0f))
-#define TO_16_SNORM(f) ((short) (f * 32767.0f))
-#define TO_32_SNORM(f) ((int) (f * 2147483647.0f))
+#define TO_8_SNORM(x) ((char) (x * 127.0f))
+#define TO_16_SNORM(x) ((short) (x * 32767.0f))
+#define TO_32_SNORM(x) ((int) (x * 2147483647.0f))