summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dlist.c30
-rw-r--r--src/mesa/main/glheader.h10
-rw-r--r--src/mesa/main/imports.h94
-rw-r--r--src/mesa/main/vtxfmt_tmp.h4
4 files changed, 73 insertions, 65 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 1fc0d39f8bd..6282b5b4147 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -98,7 +98,7 @@
* - glFinish
* - glIsEnabled
* - glGet*
- *
+ *
* Functions which cause errors if called while compiling a display list:
* - glNewList
*/
@@ -114,7 +114,7 @@
/**
* How many nodes to allocate at a time.
- *
+ *
* \note Reduced now that we hold vertices etc. elsewhere.
*/
#define BLOCK_SIZE 256
@@ -305,7 +305,7 @@ union node {
/**
- * Number of nodes of storage needed for each instruction.
+ * Number of nodes of storage needed for each instruction.
* Sizes for dynamically allocated opcodes are stored in the context struct.
*/
static GLuint InstSize[ OPCODE_END_OF_LIST+1 ];
@@ -1459,7 +1459,7 @@ save_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
}
-static void
+static void
save_CopyPixels( GLint x, GLint y,
GLsizei width, GLsizei height, GLenum type )
{
@@ -2367,7 +2367,7 @@ static void save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
static void save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
GLint vn, GLdouble v1, GLdouble v2 )
{
- save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
+ save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
vn, (GLfloat) v1, (GLfloat) v2);
}
@@ -2890,7 +2890,7 @@ static void save_RasterPos3sv(const GLshort *v)
static void save_RasterPos4dv(const GLdouble *v)
{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
@@ -2901,7 +2901,7 @@ static void save_RasterPos4fv(const GLfloat *v)
static void save_RasterPos4iv(const GLint *v)
{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
@@ -3630,7 +3630,7 @@ static void save_WindowPos3svMESA(const GLshort *v)
static void save_WindowPos4dvMESA(const GLdouble *v)
{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
@@ -3641,7 +3641,7 @@ static void save_WindowPos4fvMESA(const GLfloat *v)
static void save_WindowPos4ivMESA(const GLint *v)
{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
@@ -5471,7 +5471,7 @@ _mesa_CallList( GLuint list )
/* execute the display list, and restore the CompileFlag. */
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCallList %d\n", list);
+ _mesa_debug(ctx, "glCallList %d\n", list);
if (list == 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
@@ -5509,7 +5509,7 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
GLboolean save_compile_flag;
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCallLists %d\n", n);
+ _mesa_debug(ctx, "glCallLists %d\n", n);
switch (type) {
case GL_BYTE:
@@ -5860,7 +5860,7 @@ static void exec_DisableClientState( GLenum cap )
ctx->Exec->DisableClientState( cap );
}
-static void exec_EdgeFlagPointer(GLsizei stride, const void *vptr)
+static void exec_EdgeFlagPointer(GLsizei stride, const GLvoid *vptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
@@ -6901,12 +6901,12 @@ static void print_list( GLcontext *ctx, GLuint list )
_mesa_lookup_enum_by_nr(n[1].ui));
break;
case OPCODE_MAP1:
- _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
+ _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].i, n[5].i);
break;
case OPCODE_MAP2:
- _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].f, n[5].f,
n[6].i, n[7].i, n[8].i, n[9].i);
@@ -6916,7 +6916,7 @@ static void print_list( GLcontext *ctx, GLuint list )
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_MAPGRID2:
- _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
n[1].i, n[2].f, n[3].f,
n[4].i, n[5].f, n[6].f);
break;
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index bef72783a6d..f0cc2df0750 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -1,7 +1,7 @@
/**
* \file glheader.h
* Top-most include file.
- *
+ *
* This is the top-most include file of the Mesa sources.
* It includes gl.h and all system headers which are needed.
* Other Mesa source files should \e not directly include any system
@@ -9,7 +9,7 @@
* allows system-dependent hacks/workarounds to be collected in one place.
*
* \note Actually, a lot of system-dependent stuff is now in imports.[ch].
- *
+ *
* If you touch this file, everything gets recompiled!
*
* This file should be included before any other header in the .c files.
@@ -252,6 +252,8 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
# define INLINE __inline
#elif defined(__ICL)
# define INLINE __inline
+#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
+# define INLINE __inline
#else
# define INLINE
#endif
@@ -259,9 +261,9 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
/*
* Provide a reasonable replacement for __FUNCTION__ when using
- * non-GNU C compilers.
+ * non-GNU C compilers. Watcom C/C++ 11.0 and later provide this also.
*/
-#if !defined(__GNUC__)
+#if !defined(__GNUC__) && !(defined(__WATCOMC__) && (__WATCOMC__ >= 1100))
#define STRINGIZE(x) #x
#define STRINGIZE_EVAL(x) STRINGIZE(x)
#define __FUNCTION__ STRINGIZE_EVAL(__FILE__) ", line " STRINGIZE_EVAL(__LINE__)
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 47cf2312dfb..532649a354c 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -1,7 +1,7 @@
/**
* \file imports.h
* Standard C library function wrappers.
- *
+ *
* This file provides wrappers for all the standard C library functions
* like malloc(), free(), printf(), getenv(), etc.
*/
@@ -94,24 +94,24 @@ extern "C" {
/**********************************************************************/
/** \name [Pseudo] static array declaration.
- *
- * MACs and BeOS don't support static larger than 32kb, so ...
+ *
+ * MACs and BeOS don't support static larger than 32kb, so ...
*/
/*@{*/
-/**
+/**
* \def DEFARRAY
- * Define a [static] unidimensional array
+ * Define a [static] unidimensional array
*/
-/**
+/**
* \def DEFMARRAY
- * Define a [static] bi-dimensional array
+ * Define a [static] bi-dimensional array
*/
-/**
+/**
* \def DEFMNARRAY
- * Define a [static] tri-dimensional array
+ * Define a [static] tri-dimensional array
*/
/**
@@ -156,18 +156,18 @@ extern "C" {
* specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC and implement
* _ext_mesa_alloc_pixelbuffer() _ext_mesa_free_pixelbuffer() in your
* application.
- *
+ *
* \author
* Contributed by Gerk Huisma ([email protected]).
*/
/*@{*/
-/**
+/**
* \def MESA_PBUFFER_ALLOC
* Allocate a pixel buffer.
*/
-/**
+/**
* \def MESA_PBUFFER_FREE
* Free a pixel buffer.
*/
@@ -196,7 +196,7 @@ extern void _ext_mesa_free_pixelbuffer( void *pb );
#define MAX_GLUINT 0xffffffff
#ifndef M_PI
-#define M_PI (3.1415926536)
+#define M_PI (3.1415926536)
#endif
/* Degrees to radians conversion: */
@@ -206,8 +206,8 @@ extern void _ext_mesa_free_pixelbuffer( void *pb );
/***
*** USE_IEEE: Determine if we're using IEEE floating point
***/
-#if defined(__i386__) || defined(__sparc__) || defined(__s390x__) || \
- defined(__powerpc__) || \
+#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
+ defined(__s390x__) || defined(__powerpc__) || \
( defined(__alpha__) && ( defined(__IEEE_FLOAT) || !defined(VMS) ) )
#define USE_IEEE
#define IEEE_ONE 0x3f800000
@@ -217,15 +217,7 @@ extern void _ext_mesa_free_pixelbuffer( void *pb );
/***
*** SQRTF: single-precision square root
***/
-#if defined(__WATCOMC__) && defined(USE_X86_ASM)
-float asm_sqrt (float x);
-#pragma aux asm_sqrt = \
- "fsqrt" \
- parm [8087] \
- value [8087] \
- modify exact [];
-# define SQRTF(X) asm_sqrt(X)
-#elif 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
+#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
# define SQRTF(X) _mesa_sqrtf(X)
#elif defined(XFree86LOADER) && defined(IN_MODULE)
# define SQRTF(X) (float) xf86sqrt((float) (X))
@@ -306,7 +298,7 @@ static INLINE int IS_INF_OR_NAN( float x )
#define IS_INF_OR_NAN(x) (!isfinite(x))
#else
#define IS_INF_OR_NAN(x) (!finite(x))
-#endif
+#endif
/***
@@ -360,9 +352,9 @@ static INLINE int IS_INF_OR_NAN( float x )
#if defined(USE_SPARC_ASM) && defined(__GNUC__) && defined(__sparc__)
static INLINE int iround(float f)
{
- int r;
- __asm__ ("fstoi %1, %0" : "=f" (r) : "f" (f));
- return r;
+ int r;
+ __asm__ ("fstoi %1, %0" : "=f" (r) : "f" (f));
+ return r;
}
#define IROUND(x) iround(x)
#elif defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
@@ -398,7 +390,7 @@ long iround(float f);
#ifndef FIST_MAGIC
#define FIST_MAGIC ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0))
#endif
-inline int iround(float x)
+static INLINE int iround(float x)
{
double dtemp = FIST_MAGIC + x;
return ((*(int *)&dtemp) - 0x80000000);
@@ -601,21 +593,35 @@ do { \
__asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \
} while (0)
-#elif defined(__WATCOMC__) && !defined(NO_FAST_MATH)
-void _wacom_start_fast_math(unsigned short *x);
-#pragma aux _wacom_start_fast_math = \
- "fstcw word ptr [esi]" \
- "or word ptr [esi], 0x3f" \
- "fldcw word ptr [esi]" \
- parm [esi] \
- modify exact [];
-void _wacom_end_fast_math(unsigned short *x);
-#pragma aux _wacom_end_fast_math = \
- "fldcw word ptr [esi]" \
- parm [esi] \
- modify exact [];
-#define START_FAST_MATH(x) _wacom_start_fast_math(& x)
-#define END_FAST_MATH(x) _wacom_end_fast_math(& x)
+#elif defined(__WATCOMC__) && defined(__386__)
+#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
+#define FAST_X86_FPU 0x003f /* See GCC comments above */
+void _watcom_start_fast_math(unsigned short *x,unsigned short *mask);
+#pragma aux _watcom_start_fast_math = \
+ "fnstcw word ptr [eax]" \
+ "fldcw word ptr [ecx]" \
+ parm [eax ecx] \
+ modify exact [];
+void _watcom_end_fast_math(unsigned short *x);
+#pragma aux _watcom_end_fast_math = \
+ "fnclex" \
+ "fldcw word ptr [eax]" \
+ parm [eax] \
+ modify exact [];
+#if defined(NO_FAST_MATH)
+#define START_FAST_MATH(x) \
+do { \
+ static GLushort mask = DEFAULT_X86_FPU; \
+ _watcom_start_fast_math(&x,&mask); \
+} while (0)
+#else
+#define START_FAST_MATH(x) \
+do { \
+ static GLushort mask = FAST_X86_FPU; \
+ _watcom_start_fast_math(&x,&mask); \
+} while (0)
+#endif
+#define END_FAST_MATH(x) _watcom_end_fast_math(&x)
#else
#define START_FAST_MATH(x) x = 0
#define END_FAST_MATH(x) (void)(x)
diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h
index 0900d6e3fc9..33140359526 100644
--- a/src/mesa/main/vtxfmt_tmp.h
+++ b/src/mesa/main/vtxfmt_tmp.h
@@ -363,7 +363,7 @@ static void TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count )
}
static void TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type,
- const void *indices )
+ const GLvoid *indices )
{
PRE_LOOPBACK( DrawElements );
_glapi_Dispatch->DrawElements( mode, count, type, indices );
@@ -371,7 +371,7 @@ static void TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type,
static void TAG(DrawRangeElements)( GLenum mode, GLuint start,
GLuint end, GLsizei count,
- GLenum type, const void *indices )
+ GLenum type, const GLvoid *indices )
{
PRE_LOOPBACK( DrawRangeElements );
_glapi_Dispatch->DrawRangeElements( mode, start, end, count, type, indices );