util/format: Generate floating point constants for clamping.
[mesa.git] / src / gallium / auxiliary / util / u_snprintf.c
index 0d54299b28aca9fa039d44452cfd6dc795779254..7a2bf2a6f785544eb623077146e02af0dc321643 100644 (file)
 #if HAVE_CONFIG_H
 #include <config.h>
 #else
-#ifdef WIN32
+#ifdef _MSC_VER
 #define vsnprintf util_vsnprintf
 #define snprintf util_snprintf
 #define HAVE_VSNPRINTF 0
@@ -334,15 +334,6 @@ static void *mymemcpy(void *, void *, size_t);
 #endif /* HAVE_UINTPTR_T || defined(uintptr_t) */
 #endif /* !defined(UINTPTR_T) */
 
-/* WinCE5.0 does not have uintptr_t defined */ 
-#if (_WIN32_WCE < 600) 
-#ifdef UINTPTR_T 
-#undef UINTPTR_T 
-#endif 
-#define UINTPTR_T unsigned long int 
-#endif 
-
-
 /* Support for ptrdiff_t. */
 #ifndef PTRDIFF_T
 #if HAVE_PTRDIFF_T || defined(ptrdiff_t)
@@ -829,7 +820,7 @@ util_vsnprintf(char *str, size_t size, const char *format, va_list args)
                                        break;
                                default:
                                        intptr = va_arg(args, int *);
-                                       *intptr = len;
+                                       *intptr = (int)len;
                                        break;
                                }
                                break;
@@ -1113,11 +1104,7 @@ again:
         * Factor of ten with the number of digits needed for the fractional
         * part.  For example, if the precision is 3, the mask will be 1000.
         */
-#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
-       mask = (unsigned long)mypow10(precision);
-#else
        mask = (UINTMAX_T)mypow10(precision);
-#endif
        /*
         * We "cheat" by converting the fractional part to integer by
         * multiplying by a factor of ten.
@@ -1369,11 +1356,7 @@ cast(LDOUBLE value)
        if (value >= UINTMAX_MAX)
                return UINTMAX_MAX;
 
-#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
-       result = (unsigned long)value;
-#else
        result = (UINTMAX_T)value;
-#endif
        /*
         * At least on NetBSD/sparc64 3.0.2 and 4.99.30, casting long double to
         * an integer type converts e.g. 1.9 to 2 instead of 1 (which violates