diff options
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_atomic.h | 5 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.c | 47 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_refcnt.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_math.h | 68 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_snprintf.c | 8 |
5 files changed, 3 insertions, 127 deletions
diff --git a/src/gallium/auxiliary/util/u_atomic.h b/src/gallium/auxiliary/util/u_atomic.h index 8434491a421..2f2b42b346f 100644 --- a/src/gallium/auxiliary/util/u_atomic.h +++ b/src/gallium/auxiliary/util/u_atomic.h @@ -18,10 +18,7 @@ * locally coded assembly, compiler intrinsic or ultimately a * mutex-based implementation. */ -#if (defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || \ - defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)) -#define PIPE_ATOMIC_OS_UNLOCKED -#elif defined(PIPE_OS_SOLARIS) +#if defined(PIPE_OS_SOLARIS) #define PIPE_ATOMIC_OS_SOLARIS #elif defined(PIPE_CC_MSVC) #define PIPE_ATOMIC_MSVC_INTRINSIC diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index b3a30adadb0..df1d8e68cfd 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -274,11 +274,7 @@ void _debug_assert_fail(const char *expr, const char *function) { _debug_printf("%s:%u:%s: Assertion `%s' failed.\n", file, line, function, expr); -#if defined(PIPE_OS_WINDOWS) && !defined(PIPE_SUBSYSTEM_WINDOWS_USER) - if (debug_get_bool_option("GALLIUM_ABORT_ON_ASSERT", FALSE)) -#else if (debug_get_bool_option("GALLIUM_ABORT_ON_ASSERT", TRUE)) -#endif os_abort(); else _debug_printf("continuing...\n"); @@ -453,42 +449,6 @@ void debug_dump_image(const char *prefix, unsigned stride, const void *data) { -#ifdef PIPE_SUBSYSTEM_WINDOWS_DISPLAY - static unsigned no = 0; - char filename[256]; - WCHAR wfilename[sizeof(filename)]; - ULONG_PTR iFile = 0; - struct { - unsigned format; - unsigned cpp; - unsigned width; - unsigned height; - } header; - unsigned char *pMap = NULL; - unsigned i; - - util_snprintf(filename, sizeof(filename), "\\??\\c:\\%03u%s.raw", ++no, prefix); - for(i = 0; i < sizeof(filename); ++i) - wfilename[i] = (WCHAR)filename[i]; - - pMap = (unsigned char *)EngMapFile(wfilename, sizeof(header) + height*width*cpp, &iFile); - if(!pMap) - return; - - header.format = format; - header.cpp = cpp; - header.width = width; - header.height = height; - memcpy(pMap, &header, sizeof(header)); - pMap += sizeof(header); - - for(i = 0; i < height; ++i) { - memcpy(pMap, (unsigned char *)data + stride*i, cpp*width); - pMap += cpp*width; - } - - EngUnmapFile(iFile); -#elif defined(PIPE_OS_UNIX) /* write a ppm file */ char filename[256]; FILE *f; @@ -534,7 +494,6 @@ void debug_dump_image(const char *prefix, else { fprintf(stderr, "Can't open %s for writing\n", filename); } -#endif } /* FIXME: dump resources, not surfaces... */ @@ -636,7 +595,6 @@ debug_dump_surface_bmp(struct pipe_context *pipe, const char *filename, struct pipe_surface *surface) { -#ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT struct pipe_transfer *transfer; struct pipe_resource *texture = surface->texture; @@ -647,7 +605,6 @@ debug_dump_surface_bmp(struct pipe_context *pipe, debug_dump_transfer_bmp(pipe, filename, transfer); pipe->transfer_destroy(pipe, transfer); -#endif } void @@ -655,7 +612,6 @@ debug_dump_transfer_bmp(struct pipe_context *pipe, const char *filename, struct pipe_transfer *transfer) { -#ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT float *rgba; if (!transfer) @@ -679,7 +635,6 @@ debug_dump_transfer_bmp(struct pipe_context *pipe, FREE(rgba); error1: ; -#endif } void @@ -687,7 +642,6 @@ debug_dump_float_rgba_bmp(const char *filename, unsigned width, unsigned height, float *rgba, unsigned stride) { -#ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT FILE *stream; struct bmp_file_header bmfh; struct bmp_info_header bmih; @@ -738,7 +692,6 @@ debug_dump_float_rgba_bmp(const char *filename, fclose(stream); error1: ; -#endif } #endif diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c index 2679932008d..b94f1af1851 100644 --- a/src/gallium/auxiliary/util/u_debug_refcnt.c +++ b/src/gallium/auxiliary/util/u_debug_refcnt.c @@ -24,7 +24,7 @@ * **************************************************************************/ -#if defined(DEBUG) && (!defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_WINDOWS_USER)) +#if defined(DEBUG) /* see http://www.mozilla.org/performance/refcnt-balancer.html for what do with the output * on Linux, use tools/addr2line.sh to postprocess it before anything else diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 551463f75cd..f908341f624 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -48,74 +48,8 @@ extern "C" { #endif -#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) -__inline double ceil(double val) -{ - double ceil_val; - - if ((val - (long) val) == 0) { - ceil_val = val; - } - else { - if (val > 0) { - ceil_val = (long) val + 1; - } - else { - ceil_val = (long) val; - } - } - - return ceil_val; -} - -#ifndef PIPE_SUBSYSTEM_WINDOWS_CE_OGL -__inline double floor(double val) -{ - double floor_val; - - if ((val - (long) val) == 0) { - floor_val = val; - } - else { - if (val > 0) { - floor_val = (long) val; - } - else { - floor_val = (long) val - 1; - } - } - - return floor_val; -} -#endif - -#pragma function(pow) -__inline double __cdecl pow(double val, double exponent) -{ - /* XXX */ - assert(0); - return 0; -} - -#pragma function(log) -__inline double __cdecl log(double val) -{ - /* XXX */ - assert(0); - return 0; -} - -#pragma function(atan2) -__inline double __cdecl atan2(double val) -{ - /* XXX */ - assert(0); - return 0; -} -#else #include <math.h> #include <stdarg.h> -#endif #ifndef M_SQRT2 @@ -125,7 +59,7 @@ __inline double __cdecl atan2(double val) #if defined(_MSC_VER) -#if _MSC_VER < 1400 && !defined(__cplusplus) || defined(PIPE_SUBSYSTEM_WINDOWS_CE) +#if _MSC_VER < 1400 && !defined(__cplusplus) static INLINE float cosf( float f ) { diff --git a/src/gallium/auxiliary/util/u_snprintf.c b/src/gallium/auxiliary/util/u_snprintf.c index 65bdd0df2b7..f0d53b3cecd 100644 --- a/src/gallium/auxiliary/util/u_snprintf.c +++ b/src/gallium/auxiliary/util/u_snprintf.c @@ -1113,11 +1113,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 +1365,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 |