diff options
author | Brian Paul <[email protected]> | 2004-08-25 15:59:48 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-08-25 15:59:48 +0000 |
commit | a6c423d95663cfd8601cf84e10e8e1b12fa6ef15 (patch) | |
tree | e4d68d47d99c2f747619829a488dd0b6ba5cf361 /src | |
parent | 866286936ac34070826382f1d1cd28b613dd4bd1 (diff) |
Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696)
Diffstat (limited to 'src')
53 files changed, 450 insertions, 107 deletions
diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c index 49cff3dae30..c33a4e3fe12 100644 --- a/src/mesa/array_cache/ac_import.c +++ b/src/mesa/array_cache/ac_import.c @@ -276,6 +276,7 @@ import_texcoord( GLcontext *ctx, GLuint unit, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.TexCoord[unit]; struct gl_client_array *to = &ac->Cache.TexCoord[unit]; + (void) type; (void) stride; ASSERT(unit < ctx->Const.MaxTextureCoordUnits); @@ -305,6 +306,7 @@ import_vertex( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Vertex; struct gl_client_array *to = &ac->Cache.Vertex; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -331,6 +333,7 @@ import_normal( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Normal; struct gl_client_array *to = &ac->Cache.Normal; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -355,6 +358,7 @@ import_color( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Color; struct gl_client_array *to = &ac->Cache.Color; + (void) stride; import( ctx, type, to, from ); @@ -367,6 +371,7 @@ import_index( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Index; struct gl_client_array *to = &ac->Cache.Index; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -391,6 +396,7 @@ import_secondarycolor( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.SecondaryColor; struct gl_client_array *to = &ac->Cache.SecondaryColor; + (void) stride; import( ctx, type, to, from ); @@ -403,6 +409,7 @@ import_fogcoord( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.FogCoord; struct gl_client_array *to = &ac->Cache.FogCoord; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -427,6 +434,7 @@ import_edgeflag( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.EdgeFlag; struct gl_client_array *to = &ac->Cache.EdgeFlag; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -451,6 +459,7 @@ import_attrib( GLcontext *ctx, GLuint index, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Attrib[index]; struct gl_client_array *to = &ac->Cache.Attrib[index]; + (void) type; (void) stride; ASSERT(index < VERT_ATTRIB_MAX); diff --git a/src/mesa/drivers/windows/gdi/colors.h b/src/mesa/drivers/windows/gdi/colors.h index 7070b85e325..5ee66e829de 100644 --- a/src/mesa/drivers/windows/gdi/colors.h +++ b/src/mesa/drivers/windows/gdi/colors.h @@ -24,6 +24,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/08/25 15:59:48 brianp + * Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) + * * Revision 1.1 2003/07/24 03:47:46 kschultz * Source code for GDI driver. * @@ -49,6 +52,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/08/25 15:59:48 brianp + * Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) + * * Revision 1.1 2003/07/24 03:47:46 kschultz * Source code for GDI driver. * @@ -74,6 +80,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/08/25 15:59:48 brianp + * Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) + * * Revision 1.1 2003/07/24 03:47:46 kschultz * Source code for GDI driver. * @@ -141,7 +150,7 @@ char ColorMap16[] = { 0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E, 0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}; -#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5))) +#define BGR8(r,g,b) (unsigned)(((BYTE)((b & 0xc0) | ((g & 0xe0)>>2) | ((r & 0xe0)>>5)))) #ifdef DDRAW #define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11))) #else diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 53850d1bdce..b530cfc02db 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -1,4 +1,4 @@ -/* $Id: wgl.c,v 1.4 2004/08/25 14:59:45 brianp Exp $ */ +/* $Id: wgl.c,v 1.5 2004/08/25 15:59:48 brianp Exp $ */ /* * This library is free software; you can redistribute it and/or @@ -107,6 +107,7 @@ static unsigned curPFD = 0; WGLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask) { + (void) hglrcSrc; (void) hglrcDst; (void) mask;
return(FALSE); } @@ -166,6 +167,7 @@ WGLAPI BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc) WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC hdc,int iLayerPlane) { + (void) hdc; (void) iLayerPlane;
SetLastError(0); return(NULL); } @@ -211,7 +213,8 @@ WGLAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc,HGLRC hglrc) } WGLAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,HGLRC hglrc2) -{ +{
+ (void) hglrc1; (void) hglrc2; return(TRUE); } @@ -219,7 +222,7 @@ WGLAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,HGLRC hglrc2) static FIXED FixedFromDouble(double d) { long l = (long) (d * 65536L); - return *(FIXED *)&l; + return *(FIXED *) (void *) &l; } @@ -258,9 +261,9 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, SetTextColor(bitDevice, tempColor); // Place chars based on base line - VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); + VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0); - for(i = 0; i < numChars; i++) { + for(i = 0; i < (int)numChars; i++) { SIZE size; char curChar; int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res; @@ -285,7 +288,7 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, // Assign the output bitmap to the device origBmap = SelectObject(bitDevice, bitObject); - VERIFY(origBmap); + (void) VERIFY(origBmap); VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); @@ -344,11 +347,7 @@ WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, MAT2 mat; int success = TRUE; - if (first<0) - return FALSE; - if (count<0) - return FALSE; - if (listBase<0) + if (count == 0) return FALSE; font_list = listBase; @@ -373,7 +372,7 @@ WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, /* ** Otherwise process all desired characters. */ - for (i = 0; i < count; i++) + for (i = 0; i < (int)count; i++) { DWORD err; @@ -432,6 +431,7 @@ WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase) { + (void) hdc; (void) first; (void) count; (void) listBase;
return FALSE; } @@ -440,6 +440,9 @@ WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf) { + (void) hdc; (void) first; (void) count;
+ (void) listBase; (void) deviation; (void) extrusion; (void) format;
+ (void) lpgmf;
SetLastError(0); return(FALSE); } @@ -449,6 +452,9 @@ WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf) { + (void) hdc; (void) first; (void) count;
+ (void) listBase; (void) deviation; (void) extrusion; (void) format;
+ (void) lpgmf;
SetLastError(0); return(FALSE); } @@ -457,6 +463,7 @@ WGLAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,int iPixelFormat, int iLayerPlane,UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd) { + (void) hdc; (void) iPixelFormat; (void) iLayerPlane; (void) nBytes; (void) plpd;
SetLastError(0); return(FALSE); } @@ -465,6 +472,7 @@ WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, int iStart,int cEntries, CONST COLORREF *pcr) { + (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
SetLastError(0); return(0); } @@ -473,18 +481,21 @@ WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,int iLayerPlane, int iStart,int cEntries, COLORREF *pcr) { + (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
SetLastError(0); return(0); } WGLAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) { + (void) hdc; (void) iLayerPlane; (void) bRealize;
SetLastError(0); return(FALSE); } WGLAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,UINT fuPlanes) { + (void) fuPlanes;
if( !hdc ) { WMesaSwapBuffers(); @@ -498,6 +509,7 @@ WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd) { int i,best = -1,bestdelta = 0x7FFFFFFF,delta,qt_valid_pix; + (void) hdc;
qt_valid_pix = qt_pix; if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) @@ -556,6 +568,7 @@ WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nByte LPPIXELFORMATDESCRIPTOR ppfd) { int qt_valid_pix; + (void) hdc;
qt_valid_pix = qt_pix; if(ppfd == NULL) @@ -584,6 +597,7 @@ WGLAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) { + (void) hdc;
if(curPFD == 0) { SetLastError(0); @@ -596,6 +610,7 @@ WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, PIXELFORMATDESCRIPTOR *ppfd) { int qt_valid_pix; + (void) hdc;
qt_valid_pix = qt_pix; if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) @@ -609,6 +624,7 @@ WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, WGLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) { + (void) hdc;
if (ctx_current < 0) return FALSE; diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index eb64cf69a59..53d202251ad 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -45,6 +45,7 @@ #include "array_cache/acache.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" +#include "swrast/s_alphabuf.h" #include "swrast/s_context.h" #include "swrast/s_depth.h" #include "swrast/s_lines.h" @@ -165,7 +166,6 @@ static BOOL DDCreateOffScreen(WMesaContext wc); #define USE_GDI_TO_CLEAR 1 #endif -static void FlushToFile(PWMC pwc, PSTR szFile); BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); BOOL wmDeleteBackingStore(PWMC pwc); void wmCreatePalette( PWMC pwdc ); @@ -347,15 +347,20 @@ BOOL wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); +#if 0 /* unused */ + /* Finish all pending operations and synchronize. */ static void finish(GLcontext* ctx) { /* No op */ + (void) ctx; } +#endif /* unused */ static void flush(GLcontext* ctx) { + (void) ctx; if((Current->rgb_flag &&!(Current->db_flag)) ||(!Current->rgb_flag)) { @@ -371,6 +376,7 @@ static void flush(GLcontext* ctx) */ static void clear_index(GLcontext* ctx, GLuint index) { + (void) ctx; Current->clearpixel = index; } @@ -382,6 +388,7 @@ static void clear_index(GLcontext* ctx, GLuint index) static void clear_color( GLcontext* ctx, const GLfloat color[4] ) { GLubyte col[4]; + (void) ctx; CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); @@ -400,7 +407,7 @@ static void clear_color( GLcontext* ctx, const GLfloat color[4] ) * Otherwise, we let swrast do it. */ -static clear(GLcontext* ctx, GLbitfield mask, +static void clear(GLcontext* ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height) { const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; @@ -467,7 +474,7 @@ static clear(GLcontext* ctx, GLbitfield mask, WORD wColor; BYTE bColor; LPDWORD lpdw = (LPDWORD)Current->pbPixels; - LPWORD lpw = (LPWORD)Current->pbPixels; + /*LPWORD lpw = (LPWORD)Current->pbPixels; */ LPBYTE lpb = Current->pbPixels; int lines; /* Double-buffering - clear back buffer */ @@ -513,7 +520,9 @@ static clear(GLcontext* ctx, GLbitfield mask, dwColor = BGR32(GetRValue(Current->clearpixel), GetGValue(Current->clearpixel), GetBValue(Current->clearpixel)); - } + } + else + dwColor = 0; if (nBypp != 3) { @@ -567,6 +576,7 @@ static clear(GLcontext* ctx, GLbitfield mask, static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) { + (void) ctx; if (!Current) return; @@ -592,6 +602,7 @@ static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) static void set_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit ) { + (void) ctx; (void) colorBuffer; (void) bufferBit; /* XXX todo - examine bufferBit and set read/write pointers */ return; } @@ -601,9 +612,10 @@ static void set_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, /* Return characteristics of the output buffer. */ static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { - GET_CURRENT_CONTEXT(ctx); + /*GET_CURRENT_CONTEXT(ctx);*/ int New_Size; RECT CR; + (void) buffer; GetClientRect(Current->Window,&CR); @@ -649,25 +661,36 @@ static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) /* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */ +#if 0 /* unused */ + static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) { + (void) ctx; (void) first; (void) last; } +#endif /* unused */ + /* Return pointer to accelerated points function */ extern tnl_points_func choose_points_function( GLcontext* ctx ) { + (void) ctx; return NULL; } +#if 0 /* unused */ + static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, GLuint v1, GLuint pv ) { + (void) ctx; (void) v0; (void) v1; (void) pv; } static tnl_line_func choose_line_function( GLcontext* ctx ) { + (void) ctx; } +#endif /* unused */ /**********************************************************************/ /***** Span-based pixel drawing *****/ @@ -682,6 +705,7 @@ static void write_ci32_span( const GLcontext* ctx, { GLuint i; PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) if (mask[i]) @@ -697,6 +721,7 @@ static void write_ci8_span( const GLcontext* ctx, { GLuint i; PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) if (mask[i]) @@ -715,6 +740,7 @@ static void write_mono_ci_span(const GLcontext* ctx, { GLuint i; BYTE *Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) if (mask[i]) @@ -731,11 +757,12 @@ static void write_rgba_span( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ) { PWMC pwc = Current; + (void) ctx; if (pwc->rgb_flag==GL_TRUE) { GLuint i; - HDC DC=DD_GETDC; + /*HDC DC=DD_GETDC;*/ y=FLIP(y); if (mask) { for (i=0; i<n; i++) @@ -779,11 +806,12 @@ static void write_rgb_span( const GLcontext* ctx, const GLubyte rgb[][3], const GLubyte mask[] ) { PWMC pwc = Current; - + (void) ctx; + if (pwc->rgb_flag==GL_TRUE) { GLuint i; - HDC DC=DD_GETDC; + /*HDC DC=DD_GETDC;*/ y=FLIP(y); if (mask) { for (i=0; i<n; i++) @@ -831,6 +859,7 @@ static void write_mono_rgba_span( const GLcontext* ctx, { GLuint i; PWMC pwc = Current; + (void) ctx; assert(Current->rgb_flag==GL_TRUE); y=FLIP(y); if(Current->rgb_flag==GL_TRUE) @@ -863,6 +892,7 @@ static void write_ci32_pixels( const GLcontext* ctx, const GLuint index[], const GLubyte mask[] ) { GLuint i; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) { if (mask[i]) { @@ -884,6 +914,7 @@ static void write_mono_ci_pixels( const GLcontext* ctx, GLuint colorIndex, const GLubyte mask[] ) { GLuint i; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) { if (mask[i]) { @@ -902,7 +933,8 @@ static void write_rgba_pixels( const GLcontext* ctx, { GLuint i; PWMC pwc = Current; - HDC DC=DD_GETDC; + /*HDC DC=DD_GETDC;*/ + (void) ctx; assert(Current->rgb_flag==GL_TRUE); for (i=0; i<n; i++) if (mask[i]) @@ -925,7 +957,8 @@ static void write_mono_rgba_pixels( const GLcontext* ctx, { GLuint i; PWMC pwc = Current; - HDC DC=DD_GETDC; + /*HDC DC=DD_GETDC;*/ + (void) ctx; assert(Current->rgb_flag==GL_TRUE); for (i=0; i<n; i++) if (mask[i]) @@ -946,6 +979,7 @@ static void read_ci32_span( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLuint index[]) { GLuint i; + (void) ctx; BYTE *Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) @@ -961,6 +995,7 @@ static void read_ci32_pixels( const GLcontext* ctx, GLuint indx[], const GLubyte mask[] ) { GLuint i; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; i<n; i++) { if (mask[i]) { @@ -979,6 +1014,7 @@ static void read_rgba_span( const GLcontext* ctx, UINT i; COLORREF Color; HDC DC=DD_GETDC; + (void) ctx; assert(Current->rgb_flag==GL_TRUE); y = Current->height - y - 1; for (i=0; i<n; i++) { @@ -1000,6 +1036,7 @@ static void read_rgba_pixels( const GLcontext* ctx, GLuint i; COLORREF Color; HDC DC=DD_GETDC; + (void) ctx; assert(Current->rgb_flag==GL_TRUE); for (i=0; i<n; i++) { if (mask[i]) { @@ -1022,6 +1059,7 @@ static void read_rgba_pixels( const GLcontext* ctx, static const GLubyte *get_string(GLcontext *ctx, GLenum name) { + (void) ctx; if (name == GL_RENDERER) { return (GLubyte *) "Mesa Windows"; } @@ -1074,7 +1112,7 @@ static void SetSWrastPointers(GLcontext *ctx) static void wmesa_update_state( GLcontext *ctx, GLuint new_state ) { - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); + /*struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx );*/ TNLcontext *tnl = TNL_CONTEXT(ctx); /* @@ -1166,7 +1204,7 @@ static void wmesa_update_state( GLcontext *ctx, GLuint new_state ) /***** WMesa API Functions *****/ /**********************************************************************/ - +#if 0 /* unused */ #define PAL_SIZE 256 static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) @@ -1178,11 +1216,9 @@ static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) WORD Version; WORD NumberOfEntries; PALETTEENTRY aEntries[PAL_SIZE]; - } Palette = - { - 0x300, - PAL_SIZE - }; + } Palette; + Palette.Version = 0x300; + Palette.NumberOfEntries = PAL_SIZE; hdc=GetDC(NULL); if (Pal!=NULL) GetPaletteEntries(Pal,0,PAL_SIZE,Palette.aEntries); @@ -1226,6 +1262,7 @@ static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) } } +#endif /* unused */ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, GLboolean rgb_flag, @@ -1236,6 +1273,7 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, WMesaContext c; GLboolean true_color_flag; struct dd_function_table functions; + (void) Pal; c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); if (!c) @@ -1436,7 +1474,7 @@ void WMesaMakeCurrent( WMesaContext c ) void WMesaSwapBuffers( void ) { - HDC DC = Current->hDC; +/* HDC DC = Current->hDC;*/ GET_CURRENT_CONTEXT(ctx); /* If we're swapping the buffer associated with the current context @@ -1699,6 +1737,8 @@ void wmCreateDIBSection( DWORD dwScanWidth; UINT nBypp = pwc->cColorBits / 8; HDC hic; + (void) hDC; + (void) pbmi; dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); @@ -1742,14 +1782,14 @@ void wmCreateDIBSection( pwc->hbmDIB = CreateDIBSection(hic, &(pwc->bmi), (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), + (void **)&(pwc->pbPixels), pwc->dib.hFileMap, 0); #else pwc->hbmDIB = CreateDIBSection(hic, &(pwc->bmi), (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), + (void **)&(pwc->pbPixels), 0, 0); #endif // USE_MAPPED_FILE @@ -1768,7 +1808,7 @@ void wmCreateDIBSection( BOOL wmFlush(PWMC pwc) { BOOL bRet = 0; - DWORD dwErr = 0; +/* DWORD dwErr = 0;*/ #ifdef DDRAW HRESULT ddrval; #endif @@ -3182,8 +3222,11 @@ static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, #endif /************** END DEAD TRIANGLE CODE ***********************/ +#if 0 /* unused */ + static tnl_triangle_func choose_triangle_function( GLcontext *ctx ) { + (void) ctx; #if 0 WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; int depth = wmesa->cColorBits; @@ -3277,6 +3320,8 @@ static tnl_triangle_func choose_triangle_function( GLcontext *ctx ) #endif } +#endif /* unused */ + /* * Define a new viewport and reallocate auxillary buffers if the size of * the window (color buffer) has changed. @@ -3284,6 +3329,7 @@ static tnl_triangle_func choose_triangle_function( GLcontext *ctx ) void WMesaViewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) { + (void) ctx; (void) x; (void) y; (void) width; (void) height; assert(0); /* I don't think that this is being used. */ #if 0 /* Save viewport */ diff --git a/src/mesa/drivers/windows/gdi/wmesadef.h b/src/mesa/drivers/windows/gdi/wmesadef.h index 29fff9f4f5e..3c267aa0f6a 100644 --- a/src/mesa/drivers/windows/gdi/wmesadef.h +++ b/src/mesa/drivers/windows/gdi/wmesadef.h @@ -93,6 +93,7 @@ typedef struct _dibSection{ }WMDIBSECTION, *PWMDIBSECTION; #ifdef COMPILE_SETPIXEL +struct wmesa_context; typedef void (*SETPIXELTYPE)(struct wmesa_context *pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b); #endif diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index d60570ca69b..0f0add89155 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -684,6 +684,7 @@ generate_entrypoint(GLuint functionOffset) } return code; #else + (void) functionOffset; return NULL; #endif /* USE_*_ASM */ } @@ -718,6 +719,12 @@ fill_in_entrypoint_offset(void *entrypoint, GLuint offset) __glapi_sparc_icache_flush(&code[2]); #endif /* __sparc_v9__ && !linux */ +#else + + /* an unimplemented architecture */ + (void) entrypoint; + (void) offset; + #endif /* USE_*_ASM */ } @@ -732,7 +739,7 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset) /* trivial rejection test */ #ifdef MANGLE if (!funcName || funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') - return NULL; + return GL_FALSE; #else if (!funcName || funcName[0] != 'g' || funcName[1] != 'l') return GL_FALSE; @@ -1006,5 +1013,7 @@ _glapi_check_table(const struct _glapi_table *table) assert(setFenceOffset == offset); assert(_glapi_get_proc_address("glSetFenceNV") == (void *) &glSetFenceNV); } +#else + (void) table; #endif } diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index e5e6717e835..d09a4496573 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -568,6 +568,7 @@ void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b ) */ void GLAPIENTRY _mesa_noop_Begin( GLenum mode ) { + (void) mode; } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 1f9b988d334..fab1059a182 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -142,6 +142,9 @@ struct gl_buffer_object * _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) { struct gl_buffer_object *obj; + + (void) ctx; + obj = MALLOC_STRUCT(gl_buffer_object); _mesa_initialize_buffer_object(obj, name, target); return obj; @@ -157,6 +160,8 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) void _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) { + (void) ctx; + if (bufObj->Data) _mesa_free(bufObj->Data); _mesa_free(bufObj); @@ -170,6 +175,8 @@ void _mesa_initialize_buffer_object( struct gl_buffer_object *obj, GLuint name, GLenum target ) { + (void) target; + _mesa_bzero(obj, sizeof(struct gl_buffer_object)); obj->RefCount = 1; obj->Name = name; @@ -231,7 +238,7 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, { void * new_data; - (void) target; + (void) ctx; (void) target; new_data = _mesa_realloc( bufObj->Data, bufObj->Size, size ); if ( new_data != NULL ) { @@ -269,6 +276,8 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data, struct gl_buffer_object * bufObj ) { + (void) ctx; (void) target; + if ( (bufObj->Data != NULL) && ((GLuint)(size + offset) <= bufObj->Size) ) { _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); @@ -299,6 +308,8 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data, struct gl_buffer_object * bufObj ) { + (void) ctx; (void) target; + if ( (bufObj->Data != NULL) && ((GLuint)(size + offset) <= bufObj->Size) ) { _mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size ); @@ -326,6 +337,7 @@ void * _mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, struct gl_buffer_object * bufObj ) { + (void) ctx; (void) target; (void) access; return bufObj->Data; } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index fd3174c0fa2..0330aa47beb 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -192,6 +192,7 @@ GLboolean _mesa_loseCurrent(__GLcontext *gc) { /* XXX unbind context from thread */ + (void) gc; return GL_TRUE; } @@ -212,6 +213,7 @@ GLboolean _mesa_makeCurrent(__GLcontext *gc) { /* XXX bind context to thread */ + (void) gc; return GL_TRUE; } @@ -267,6 +269,7 @@ _mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask) GLboolean _mesa_forceCurrent(__GLcontext *gc) { + (void) gc; return GL_TRUE; } @@ -302,6 +305,7 @@ void _mesa_notifyDestroy(__GLcontext *gc) { /* Unbind from it. */ + (void) gc; } /** @@ -322,6 +326,7 @@ _mesa_notifySwapBuffers(__GLcontext *gc) struct __GLdispatchStateRec * _mesa_dispatchExec(__GLcontext *gc) { + (void) gc; return NULL; } @@ -329,12 +334,14 @@ _mesa_dispatchExec(__GLcontext *gc) void _mesa_beginDispatchOverride(__GLcontext *gc) { + (void) gc; } /** No-op */ void _mesa_endDispatchOverride(__GLcontext *gc) { + (void) gc; } /** @@ -372,6 +379,8 @@ _mesa_init_default_exports(__GLexports *exports) exports->dispatchExec = _mesa_dispatchExec; exports->beginDispatchOverride = _mesa_beginDispatchOverride; exports->endDispatchOverride = _mesa_endDispatchOverride; +#else + (void) exports; #endif } @@ -759,6 +768,7 @@ static void one_time_init( GLcontext *ctx ) { static GLboolean alreadyCalled = GL_FALSE; + (void) ctx; _glthread_LOCK_MUTEX(OneTimeLock); if (!alreadyCalled) { GLuint i; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 77ac9e85bb1..7ce6cceed8f 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -180,6 +180,8 @@ static void add_debug_flags( const char *debug ) */ if (_mesa_strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; +#else + (void) debug; #endif } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index ea1a6ae1215..41b47722af8 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -165,6 +165,7 @@ do { \ * integer values starting at 0 is very important, see InstSize array usage) */ typedef enum { + OPCODE_INVALID = -1, /* Force signed enum */
OPCODE_ACCUM, OPCODE_ALPHA_FUNC, OPCODE_BIND_TEXTURE, diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 7a5e6ff8d95..38ae4df85be 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -6390,7 +6390,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); return; } - *params = (GLvoid *) ctx->FragmentProgram.Callback; + *params = *(GLvoid **) &ctx->FragmentProgram.Callback; break; case GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA: if (!ctx->Extensions.MESA_program_debug) { @@ -6404,7 +6404,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); return; } - *params = (GLvoid *) ctx->VertexProgram.Callback; + *params = *(GLvoid **) &ctx->VertexProgram.Callback; break; case GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA: if (!ctx->Extensions.MESA_program_debug) { diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 57fe6c3fbf7..fcac0437193 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -3778,6 +3778,8 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking ) { + (void) srcPacking; + switch (srcType) { case GL_BYTE: { diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 0afc4ea4313..2219468f75a 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -536,7 +536,7 @@ _mesa_bitcount(unsigned int n) GLhalfARB _mesa_float_to_half(float val) { - const int flt = *((int *) &val); + const int flt = *((int *) (void *) &val); const int flt_m = flt & 0x7fffff; const int flt_e = (flt >> 23) & 0xff; const int flt_s = (flt >> 31) & 0x1; @@ -662,7 +662,7 @@ _mesa_half_to_float(GLhalfARB val) } flt = (flt_s << 31) | (flt_e << 23) | flt_m; - result = *((float *) &flt); + result = *((float *) (void *) &flt); return result; } @@ -1004,6 +1004,7 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) { char s[MAXSTRING]; va_list args; + (void) ctx; va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); @@ -1094,6 +1095,7 @@ default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) { int r; va_list args; + (void) gc; va_start( args, fmt ); r = vsprintf( str, fmt, args ); va_end( args ); @@ -1104,6 +1106,7 @@ default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) static void * CAPI default_fopen(__GLcontext *gc, const char *path, const char *mode) { + (void) gc; return fopen(path, mode); } @@ -1111,6 +1114,7 @@ default_fopen(__GLcontext *gc, const char *path, const char *mode) static int CAPI default_fclose(__GLcontext *gc, void *stream) { + (void) gc; return fclose((FILE *) stream); } @@ -1120,6 +1124,7 @@ default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) { int r; va_list args; + (void) gc; va_start( args, fmt ); r = vfprintf( (FILE *) stream, fmt, args ); va_end( args ); @@ -1132,6 +1137,7 @@ default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) static __GLdrawablePrivate * default_GetDrawablePrivate(__GLcontext *gc) { + (void) gc; return NULL; } diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 6b705f64154..62b71e49be5 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -556,7 +556,7 @@ static INLINE int iceil(float f) ***/ #if defined(USE_IEEE) && !defined(DEBUG) #define COPY_FLOAT( dst, src ) \ - ((fi_type *) &(dst))->i = ((fi_type *) &(src))->i + ((fi_type *) &(dst))->i = ((fi_type *) (void *) &(src))->i #else #define COPY_FLOAT( dst, src ) (dst) = (src) #endif diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index d7a995917df..0cf2635765f 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1129,6 +1129,7 @@ _mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state ) { const GLuint oldneedeyecoords = ctx->_NeedEyeCoords; + (void) new_state; ctx->_NeedEyeCoords = 0; if (ctx->_ForceEyeCoords || diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index c4fa17f22f9..932dfce61cb 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -791,6 +791,8 @@ _mesa_scale_and_bias_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4], GLfloat rBias, GLfloat gBias, GLfloat bBias, GLfloat aBias) { + (void) ctx; + if (rScale != 1.0 || rBias != 0.0) { GLuint i; for (i = 0; i < n; i++) { diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 0f3750e61ca..997e3829c8a 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -119,10 +119,11 @@ generic_noop(void) void _mesa_init_no_op_table(struct _glapi_table *table, GLuint tableSize) { + typedef void (*func_ptr_t)(); GLuint i; - void **dispatch = (void **) table; + func_ptr_t *dispatch = (func_ptr_t *) table; for (i = 0; i < tableSize; i++) { - dispatch[i] = (void *) generic_noop; + dispatch[i] = (func_ptr_t)generic_noop; } } diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 3d0326fccac..396f14a5663 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -113,6 +113,7 @@ _mesa_compressed_texture_size( GLcontext *ctx, GLuint size; ASSERT(depth == 1); + (void) depth; switch (format) { case GL_COMPRESSED_RGB_FXT1_3DFX: diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 603f434f209..3aa5e663988 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -57,6 +57,7 @@ fxt1_decode_1 (const void *texture, int width, void _mesa_init_texture_fxt1( GLcontext *ctx ) { + (void) ctx; } @@ -76,6 +77,7 @@ texstore_rgb_fxt1(STORE_PARAMS) ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGB || srcType != CHAN_TYPE || @@ -131,6 +133,7 @@ texstore_rgba_fxt1(STORE_PARAMS) ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -174,6 +177,7 @@ static void fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, texel); } @@ -184,6 +188,7 @@ fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -196,6 +201,7 @@ static void fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, texel); texel[ACOMP] = 255; } @@ -207,6 +213,7 @@ fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -316,6 +323,7 @@ typedef struct { #endif /* !__GNUC__ */ +#if 0 /* unused */ static int fxt1_bestcol (float vec[][MAX_COMP], int nv, @@ -360,6 +368,7 @@ fxt1_worst (float vec[MAX_COMP], return worst; } +#endif /* unused */ static int fxt1_variance (double variance[MAX_COMP], @@ -390,6 +399,7 @@ fxt1_variance (double variance[MAX_COMP], return best; } +#if 0 /* unused */ static int fxt1_choose (float vec[][MAX_COMP], int nv, @@ -678,6 +688,7 @@ fxt1_quantize_ALPHA0 (unsigned long *cc, cc[0] = lolo; } +#endif /* unused */ static void fxt1_quantize_ALPHA1 (unsigned long *cc, @@ -868,6 +879,7 @@ fxt1_quantize_ALPHA1 (unsigned long *cc, ((Fx64 *)cc)[1] = hi; } +#if 0 /* unused*/ static void fxt1_quantize_HI (unsigned long *cc, @@ -966,6 +978,7 @@ fxt1_quantize_HI (unsigned long *cc, } } +#endif /* unused */ static void fxt1_quantize_MIXED1 (unsigned long *cc, @@ -1284,7 +1297,7 @@ fxt1_quantize_MIXED0 (unsigned long *cc, } /* funky encoding for LSB of green */ - if (((lolo >> 1) & 1) != (((vec[1][GCOMP] ^ vec[0][GCOMP]) >> 2) & 1)) { + if ((int)((lolo >> 1) & 1) != (((vec[1][GCOMP] ^ vec[0][GCOMP]) >> 2) & 1)) { for (i = 0; i < n_comp; i++) { vec[1][i] = input[minColL][i]; vec[0][i] = input[maxColL][i]; @@ -1339,7 +1352,7 @@ fxt1_quantize_MIXED0 (unsigned long *cc, } /* funky encoding for LSB of green */ - if (((lohi >> 1) & 1) != (((vec[3][GCOMP] ^ vec[2][GCOMP]) >> 2) & 1)) { + if ((int)((lohi >> 1) & 1) != (((vec[3][GCOMP] ^ vec[2][GCOMP]) >> 2) & 1)) { for (i = 0; i < n_comp; i++) { vec[3][i] = input[minColR][i]; vec[2][i] = input[maxColR][i]; @@ -1455,6 +1468,8 @@ fxt1_encode (GLcontext *ctx, unsigned long *encoded = dest; GLubyte *newSource = NULL; + (void) ctx; + /* * Rescale image if width is less than 8 or height is less than 4. */ diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 08697f46c42..572cdd25614 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -45,6 +45,7 @@ void _mesa_init_texture_s3tc( GLcontext *ctx ) { /* called during context initialization */ + (void) ctx; } @@ -64,6 +65,7 @@ texstore_rgb_dxt1(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGB || srcType != CHAN_TYPE || @@ -121,6 +123,7 @@ texstore_rgba_dxt1(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -176,6 +179,7 @@ texstore_rgba_dxt3(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -230,6 +234,7 @@ texstore_rgba_dxt5(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -272,6 +277,7 @@ static void fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } @@ -293,6 +299,7 @@ static void fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } @@ -314,6 +321,7 @@ static void fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } @@ -335,6 +343,7 @@ static void fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index c4f7a23e812..a496cf8cbf3 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -63,6 +63,7 @@ static void fetch_null_texel( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; texel[RCOMP] = 0; texel[GCOMP] = 0; texel[BCOMP] = 0; @@ -73,6 +74,7 @@ static void fetch_null_texel( const struct gl_texture_image *texImage, static void fetch_null_texelf( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { + (void) texImage; (void) i; (void) j; (void) k; texel[RCOMP] = 0.0; texel[GCOMP] = 0.0; texel[BCOMP] = 0.0; diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 0ccdead291b..d341c7864ae 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -44,34 +44,46 @@ #if DIM == 1 #define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLchan *)(t)->Data + (i) * (sz))) #define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLubyte *)(t)->Data + (i) * (sz))) #define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (i)) + ((void) (j), (void) (k), \ + ((GLushort *)(t)->Data + (i))) #define UINT_SRC( t, i, j, k ) \ - ((GLuint *)(t)->Data + (i)) + ((void) (j), (void) (k), \ + ((GLuint *)(t)->Data + (i))) #define FLOAT_SRC( t, i, j, k, sz ) \ - ((GLfloat *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLfloat *)(t)->Data + (i) * (sz))) #define HALF_SRC( t, i, j, k, sz ) \ - ((GLhalfARB *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLhalfARB *)(t)->Data + (i) * (sz))) #define FETCH(x) fetch_texel_1d_##x #elif DIM == 2 #define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i))) + ((void) (k), \ + ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))) #define UINT_SRC( t, i, j, k ) \ - ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i))) + ((void) (k), \ + ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i)))) #define FLOAT_SRC( t, i, j, k, sz ) \ - ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define HALF_SRC( t, i, j, k, sz ) \ - ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define FETCH(x) fetch_texel_2d_##x diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b1f526c175d..b60a91f3703 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -481,6 +481,7 @@ is_ycbcr_format(GLenum format) static GLboolean is_compressed_format(GLcontext *ctx, GLenum internalFormat) { + (void) ctx; switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: @@ -2846,6 +2847,7 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, GLenum format, GLsizei imageSize) { GLint expectedSize, maxLevels = 0, maxTextureSize; + (void) zoffset; if (dimensions == 1) { /* 1D compressed textures not allowed */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5cf71e872d8..74a5fdc06e9 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -64,6 +64,7 @@ struct gl_texture_object * _mesa_new_texture_object( GLcontext *ctx, GLuint name, GLenum target ) { struct gl_texture_object *obj; + (void) ctx; obj = MALLOC_STRUCT(gl_texture_object); _mesa_initialize_texture_object(obj, name, target); return obj; diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c6c7cb488ad..879f585a87f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -701,6 +701,7 @@ _mesa_texstore_rgba(GLcontext *ctx, GLuint dims, GLboolean _mesa_texstore_depth_component_float32(STORE_PARAMS) { + (void) dims; ASSERT(dstFormat == &_mesa_texformat_depth_component_float32); ASSERT(dstFormat->TexelBytes == sizeof(GLfloat)); @@ -744,6 +745,7 @@ _mesa_texstore_depth_component_float32(STORE_PARAMS) GLboolean _mesa_texstore_depth_component16(STORE_PARAMS) { + (void) dims; ASSERT(dstFormat == &_mesa_texformat_depth_component16); ASSERT(dstFormat->TexelBytes == sizeof(GLushort)); @@ -1553,6 +1555,7 @@ _mesa_texstore_a8(STORE_PARAMS) GLboolean _mesa_texstore_ci8(STORE_PARAMS) { + (void) dims; (void) baseInternalFormat; ASSERT(dstFormat == &_mesa_texformat_ci8); ASSERT(dstFormat->TexelBytes == 1); ASSERT(baseInternalFormat == GL_COLOR_INDEX); @@ -1599,6 +1602,7 @@ _mesa_texstore_ycbcr(STORE_PARAMS) { const GLuint ui = 1; const GLubyte littleEndian = *((const GLubyte *) &ui); + (void) ctx; (void) dims; (void) baseInternalFormat; ASSERT((dstFormat == &_mesa_texformat_ycbcr) || (dstFormat == &_mesa_texformat_ycbcr_rev)); @@ -1852,6 +1856,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, { GLint postConvWidth = width; GLint sizeInBytes; + (void) border; if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); @@ -1925,6 +1930,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, { GLint postConvWidth = width, postConvHeight = height; GLint texelBytes, sizeInBytes; + (void) border; if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, @@ -2004,6 +2010,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { GLint texelBytes, sizeInBytes; + (void) border; /* choose the texture format */ assert(ctx->Driver.ChooseTextureFormat); @@ -2228,6 +2235,13 @@ _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) internalFormat; + (void) width; (void) border; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } @@ -2243,6 +2257,8 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { + (void) width; (void) height; (void) border; + /* This is pretty simple, basically just do a memcpy without worrying * about the usual image unpacking or image transfer operations. */ @@ -2299,6 +2315,14 @@ _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) internalFormat; + (void) width; (void) height; (void) depth; + (void) border; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } @@ -2316,6 +2340,13 @@ _mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) xoffset; (void) width; + (void) format; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } @@ -2336,6 +2367,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLint i, rows; GLubyte *dest; const GLubyte *src; + (void) format; /* these should have been caught sooner */ ASSERT((width & 3) == 0 || width == 2 || width == 1); @@ -2389,6 +2421,14 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) xoffset; (void) yoffset; (void) zoffset; + (void) width; (void) height; (void) depth; + (void) format; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 4f9a7c0e24f..e45e5ca22e2 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -49,6 +49,7 @@ { \ GET_CURRENT_CONTEXT(ctx); \ struct gl_tnl_module *tnl = &(ctx->TnlModule); \ + typedef void (*func_ptr_t)(); \ \ ASSERT( tnl->Current ); \ ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \ @@ -56,7 +57,7 @@ /* Save the swapped function's dispatch entry so it can be */ \ /* restored later. */ \ tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC); \ - tnl->Swapped[tnl->SwapCount][1] = (void *)TAG(FUNC); \ + *(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC); \ tnl->SwapCount++; \ \ if ( 0 ) \ diff --git a/src/mesa/math/m_clip_tmp.h b/src/mesa/math/m_clip_tmp.h index 6551798c318..de9056333b5 100644 --- a/src/mesa/math/m_clip_tmp.h +++ b/src/mesa/math/m_clip_tmp.h @@ -129,6 +129,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, GLubyte tmpAndMask = *andMask; GLubyte tmpOrMask = *orMask; GLuint i; + (void) proj_vec; STRIDE_LOOP { const GLfloat cx = from[0]; const GLfloat cy = from[1]; @@ -176,6 +177,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; const GLfloat *from = (GLfloat *)clip_vec->start; + (void) proj_vec; GLubyte tmpOrMask = *orMask; GLubyte tmpAndMask = *andMask; @@ -209,6 +211,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; const GLfloat *from = (GLfloat *)clip_vec->start; + (void) proj_vec; GLubyte tmpOrMask = *orMask; GLubyte tmpAndMask = *andMask; diff --git a/src/mesa/math/m_xform_tmp.h b/src/mesa/math/m_xform_tmp.h index 7cf4780bd39..e9383772562 100644 --- a/src/mesa/math/m_xform_tmp.h +++ b/src/mesa/math/m_xform_tmp.h @@ -106,6 +106,7 @@ TAG(transform_points1_identity)( GLvector4f *to_vec, GLuint count = from_vec->count; GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -271,6 +272,7 @@ TAG(transform_points2_identity)( GLvector4f *to_vec, GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint count = from_vec->count; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -441,6 +443,7 @@ TAG(transform_points3_identity)( GLvector4f *to_vec, GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint count = from_vec->count; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -608,6 +611,7 @@ TAG(transform_points4_identity)( GLvector4f *to_vec, GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint count = from_vec->count; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -740,10 +744,10 @@ TAG(transform_points4_perspective)( GLvector4f *to_vec, to_vec->count = from_vec->count; } -static transform_func _XFORMAPI TAG(transform_tab_1)[7]; -static transform_func _XFORMAPI TAG(transform_tab_2)[7]; -static transform_func _XFORMAPI TAG(transform_tab_3)[7]; -static transform_func _XFORMAPI TAG(transform_tab_4)[7]; +static transform_func TAG(transform_tab_1)[7]; +static transform_func TAG(transform_tab_2)[7]; +static transform_func TAG(transform_tab_3)[7]; +static transform_func TAG(transform_tab_4)[7]; /* Similar functions could be called several times, with more highly * optimized routines overwriting the arrays. This only occurs during diff --git a/src/mesa/shader/arbfragparse.c b/src/mesa/shader/arbfragparse.c index 7192156463e..a0fc9dd5bb1 100644 --- a/src/mesa/shader/arbfragparse.c +++ b/src/mesa/shader/arbfragparse.c @@ -186,6 +186,7 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, { GLuint a, retval; struct arb_program ap; + (void) target; /* set the program target before parsing */ ap.Base.Target = GL_FRAGMENT_PROGRAM_ARB; diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 8e8051267d4..9d78027f636 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -42,6 +42,10 @@ #include "arbprogparse.h" #include "grammar_mesa.h" +#if !defined(__GNUC__) && !defined(__extension__) +# define __extension__ +#endif + /* TODO: * Fragment Program Stuff: * ----------------------------------------------------- @@ -129,7 +133,7 @@ typedef GLubyte *production; /** * This is the text describing the rules to parse the grammar */ -static char arb_grammar_text[] = +__extension__ static char arb_grammar_text[] = #include "arbprogram_syn.h" ; @@ -591,6 +595,7 @@ parse_string (GLubyte ** inst, struct var_cache **vc_head, { GLubyte *i = *inst; struct var_cache *va = NULL; + (void) Program; *inst += _mesa_strlen ((char *) i) + 1; @@ -614,7 +619,8 @@ static char * parse_string_without_adding (GLubyte ** inst, struct arb_program *Program) { GLubyte *i = *inst; - + (void) Program; + *inst += _mesa_strlen ((char *) i) + 1; return (char *) i; @@ -788,6 +794,7 @@ static GLuint parse_color_type (GLcontext * ctx, GLubyte ** inst, struct arb_program *Program, GLint * color) { + (void) ctx; (void) Program; *color = *(*inst)++ != COLOR_PRIMARY; return 0; } @@ -828,7 +835,7 @@ parse_texcoord_num (GLcontext * ctx, GLubyte ** inst, { GLint i = parse_integer (inst, Program); - if ((i < 0) || (i >= ctx->Const.MaxTextureUnits)) { + if ((i < 0) || (i >= (int)ctx->Const.MaxTextureUnits)) { _mesa_set_program_error (ctx, Program->Position, "Invalid texture unit index"); _mesa_error (ctx, GL_INVALID_OPERATION, "Invalid texture unit index"); @@ -1890,7 +1897,7 @@ parse_param (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, /* Test array length here! */ if (specified_length) { - if (specified_length != param_var->param_binding_length) { + if (specified_length != (int)param_var->param_binding_length) { _mesa_set_program_error (ctx, Program->Position, "Declared parameter array lenght does not match parameter list"); _mesa_error (ctx, GL_INVALID_OPERATION, @@ -2282,6 +2289,7 @@ parse_address_reg (GLcontext * ctx, GLubyte ** inst, { struct var_cache *dst; GLuint result; + (void) Index; dst = parse_string (inst, vc_head, Program, &result); Program->Position = parse_position (inst); @@ -2492,7 +2500,7 @@ parse_src_reg (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, offset = parse_integer (inst, Program); if ((offset < 0) - || (offset >= src->param_binding_length)) { + || (offset >= (int)src->param_binding_length)) { _mesa_set_program_error (ctx, Program->Position, "Index out of range"); _mesa_error (ctx, GL_INVALID_OPERATION, @@ -3686,7 +3694,7 @@ parse_arb_program (GLcontext * ctx, GLubyte * inst, struct var_cache **vc_head, } /* XXX temporary */ -static char core_grammar_text[] = +__extension__ static char core_grammar_text[] = #include "grammar_syn.h" ; diff --git a/src/mesa/shader/arbvertparse.c b/src/mesa/shader/arbvertparse.c index cfad87b5b1b..d0e776b47c1 100644 --- a/src/mesa/shader/arbvertparse.c +++ b/src/mesa/shader/arbvertparse.c @@ -175,6 +175,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, { GLuint retval; struct arb_program ap; + (void) target; /* set the program target before parsing */ ap.Base.Target = GL_VERTEX_PROGRAM_ARB; diff --git a/src/mesa/shader/grammar.c b/src/mesa/shader/grammar.c index af824f33843..fa2e96901d5 100644 --- a/src/mesa/shader/grammar.c +++ b/src/mesa/shader/grammar.c @@ -284,7 +284,7 @@ static void clear_last_error () /* free error parameter - if error_param is a "???" don't free it - it's static */ if (error_param != unknown) - mem_free ((void **) &error_param); + mem_free ((void **) (void *) &error_param); else error_param = NULL; @@ -297,7 +297,7 @@ static void set_last_error (const byte *msg, byte *param, int pos) /* error message can only be set only once */ if (error_message != NULL) { - mem_free ((void **) ¶m); + mem_free ((void **) (void *) ¶m); return; } @@ -1230,7 +1230,7 @@ static int get_identifier (const byte **text, byte **id) { if (string_grow (&p, &len, *t++)) { - mem_free ((void **) &p); + mem_free ((void **) (void *) &p); return 1; } } @@ -1379,7 +1379,7 @@ static int get_string (const byte **text, byte **str) if (string_grow (&p, &len, c)) { - mem_free ((void **) &p); + mem_free ((void **) (void *) &p); return 1; } } @@ -1424,7 +1424,7 @@ static int get_emtcode (const byte **text, map_byte **ma) } m->data = (byte) c[0]; - mem_free ((void **) &c); + mem_free ((void **) (void *) &c); } else { @@ -1502,11 +1502,11 @@ static int get_error (const byte **text, error **er, map_str *maps) if (!str_equal ((byte *) "error", temp)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); return 0; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); error_create (er); if (*er == NULL) @@ -1532,12 +1532,12 @@ static int get_error (const byte **text, error **er, map_str *maps) if (map_str_find (&maps, temp, &(**er).m_text)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); error_destroy (er); return 1; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); } /* try to extract "token" from "...$token$..." */ @@ -1558,7 +1558,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&processed, &len, '$')) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1569,7 +1569,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&processed, &len, (**er).m_text[i])) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1580,7 +1580,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&processed, &len, '$')) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1591,7 +1591,7 @@ static int get_error (const byte **text, error **er, map_str *maps) if (string_grow (&(**er).m_token_name, &tlen, '\0')) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1603,7 +1603,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&(**er).m_token_name, &tlen, (**er).m_text[i])) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1652,11 +1652,11 @@ static int get_emits (const byte **text, emit **em, map_byte *mapb) dest = ed_regbyte; else { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); return 0; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); emit_create (&e); if (e == NULL) @@ -1706,7 +1706,7 @@ static int get_emits (const byte **text, emit **em, map_byte *mapb) } e->m_byte = (byte) temp[0]; - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); e->m_emit_type = et_byte; } @@ -1720,12 +1720,12 @@ static int get_emits (const byte **text, emit **em, map_byte *mapb) if (map_byte_find (&mapb, temp, &e->m_byte)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); emit_destroy (&e); return 1; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); e->m_emit_type = et_byte; } @@ -1819,7 +1819,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb t = u; } - mem_free ((void **) &keyword); + mem_free ((void **) (void *) &keyword); } if (*t == '\'') @@ -1843,7 +1843,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb if (get_string (&t, &temp2)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); spec_destroy (&s); return 1; } @@ -1853,7 +1853,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb s->m_byte[0] = *temp; s->m_byte[1] = *temp2; - mem_free ((void **) &temp2); + mem_free ((void **) (void *) &temp2); } else { @@ -1861,7 +1861,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb *s->m_byte = *temp; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); } else if (*t == '"') { @@ -1908,7 +1908,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb { if (get_identifier (&t, &s->m_string)) { - mem_free ((void **) &keyword); + mem_free ((void **) (void *) &keyword); spec_destroy (&s); return 1; } @@ -1917,7 +1917,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb s->m_spec_type = st_identifier_loop; } - mem_free ((void **) &keyword); + mem_free ((void **) (void *) &keyword); } else { @@ -1993,7 +1993,7 @@ static int get_rule (const byte **text, rule **ru, map_str *maps, map_byte *mapb r->m_oper = op_or; } - mem_free ((void **) &op); + mem_free ((void **) (void *) &op); if (get_spec (&t, &sp, maps, mapb)) { @@ -2550,7 +2550,7 @@ grammar grammar_load_from_text (const byte *text) { map_byte *ma = NULL; - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (get_emtcode (&text, &ma)) { @@ -2565,7 +2565,7 @@ grammar grammar_load_from_text (const byte *text) { map_byte *ma = NULL; - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (get_regbyte (&text, &ma)) { @@ -2580,7 +2580,7 @@ grammar grammar_load_from_text (const byte *text) { map_str *ma = NULL; - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (get_errtext (&text, &ma)) { @@ -2593,7 +2593,7 @@ grammar grammar_load_from_text (const byte *text) /* .string */ else if (is_dot && str_equal (symbol, (byte *) "string")) { - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (g->di->m_string != NULL) { @@ -2760,7 +2760,7 @@ void grammar_get_last_error (byte *text, unsigned int size, int *pos) *text = '\0'; #define APPEND_CHARACTER(x) if (dots_made == 0) {\ - if (len < size - 1) {\ + if (len < (int)size - 1) {\ text[len++] = (x); text[len] = '\0';\ } else {\ int i;\ diff --git a/src/mesa/shader/nvfragprog.h b/src/mesa/shader/nvfragprog.h index ae26a7b5743..8f02f228770 100644 --- a/src/mesa/shader/nvfragprog.h +++ b/src/mesa/shader/nvfragprog.h @@ -62,6 +62,7 @@ /* Fragment program instruction opcodes */ enum fp_opcode { + FP_OPCODE_INVALID = -1, /* Force signed enum */ FP_OPCODE_ABS = 1000, /* ARB_f_p only */ FP_OPCODE_ADD, FP_OPCODE_CMP, /* ARB_f_p only */ diff --git a/src/mesa/shader/nvvertexec.c b/src/mesa/shader/nvvertexec.c index f92396c955d..e10cb1ac48a 100644 --- a/src/mesa/shader/nvvertexec.c +++ b/src/mesa/shader/nvvertexec.c @@ -358,8 +358,8 @@ store_vector4( const struct vp_dst_register *dest, * Set x to positive or negative infinity. */ #if defined(USE_IEEE) || defined(_WIN32) -#define SET_POS_INFINITY(x) ( *((GLuint *) &x) = 0x7F800000 ) -#define SET_NEG_INFINITY(x) ( *((GLuint *) &x) = 0xFF800000 ) +#define SET_POS_INFINITY(x) ( *((GLuint *) (void *)&x) = 0x7F800000 ) +#define SET_NEG_INFINITY(x) ( *((GLuint *) (void *)&x) = 0xFF800000 ) #elif defined(VMS) #define SET_POS_INFINITY(x) x = __MAXFLOAT #define SET_NEG_INFINITY(x) x = -__MAXFLOAT @@ -368,7 +368,7 @@ store_vector4( const struct vp_dst_register *dest, #define SET_NEG_INFINITY(x) x = (GLfloat) -HUGE_VAL #endif -#define SET_FLOAT_BITS(x, bits) ((fi_type *) &(x))->i = bits +#define SET_FLOAT_BITS(x, bits) ((fi_type *) (void *) &(x))->i = bits /** @@ -467,7 +467,7 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) GLint ii = (GLint) floor_t0; ii = (ii < 23) + 0x3f800000; SET_FLOAT_BITS(q[0], ii); - q[0] = *((GLfloat *) &ii); + q[0] = *((GLfloat *) (void *)&ii); #else q[0] = (GLfloat) pow(2.0, floor_t0); #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index aa6ea2ef0bb..7e8e749d8cc 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1023,6 +1023,7 @@ static GLboolean Parse_OptionSequence(struct parse_state *parseState, struct vp_instruction program[]) { + (void) program; while (1) { if (!Parse_String(parseState, "OPTION")) return GL_TRUE; /* ok, not an OPTION statement */ diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index daec9252fff..c451fede923 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -167,6 +167,7 @@ static struct program * _mesa_init_program_struct( GLcontext *ctx, struct program *prog, GLenum target, GLuint id) { + (void) ctx; if (prog) { prog->Id = id; prog->Target = target; @@ -239,6 +240,7 @@ _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id) void _mesa_delete_program(GLcontext *ctx, struct program *prog) { + (void) ctx; ASSERT(prog); if (prog->String) diff --git a/src/mesa/swrast/s_auxbuffer.c b/src/mesa/swrast/s_auxbuffer.c index 05a06bde53e..5d58c106852 100644 --- a/src/mesa/swrast/s_auxbuffer.c +++ b/src/mesa/swrast/s_auxbuffer.c @@ -93,6 +93,7 @@ void _swrast_use_aux_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + (void) buffer; switch (bufferBit) { case DD_AUX0_BIT: diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 7888bb618f7..26b4f902e14 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -176,6 +176,7 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask, GLint x, GLint y, GLint width, GLint height ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + (void) all; (void) x; (void) y; (void) width; (void) height; #ifdef DEBUG { const GLbitfield legalBits = @@ -254,6 +255,7 @@ _swrast_alloc_buffers( GLframebuffer *buffer ) void _swrast_DrawBuffer( GLcontext *ctx, GLenum mode ) { + (void) mode; _swrast_use_draw_buffer(ctx); } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 32475cf5391..a678e0b55b2 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -403,6 +403,7 @@ _swrast_validate_texture_sample( GLcontext *ctx, GLuint texUnit, static void _swrast_sleep( GLcontext *ctx, GLuint new_state ) { + (void) ctx; (void) new_state; } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 0627dea9ddf..46f59ef3c02 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -151,6 +151,7 @@ interpolate_colors(GLcontext *ctx, struct sw_span *span) const GLuint n = span->end; GLchan (*rgba)[4] = span->array->rgba; GLuint i; + (void) ctx; ASSERT((span->interpMask & SPAN_RGBA) && !(span->arrayMask & SPAN_RGBA)); @@ -211,6 +212,7 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span) const GLuint n = span->end; GLuint *indexes = span->array->index; GLuint i; + (void) ctx; ASSERT((span->interpMask & SPAN_INDEX) && !(span->arrayMask & SPAN_INDEX)); @@ -236,6 +238,7 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span) static void interpolate_specular(GLcontext *ctx, struct sw_span *span) { + (void) ctx; if (span->interpMask & SPAN_FLAT) { /* constant color */ const GLchan r = FixedToChan(span->specRed); diff --git a/src/mesa/swrast/s_tcc.c b/src/mesa/swrast/s_tcc.c index 3d8f550ece7..550a2aabdb3 100644 --- a/src/mesa/swrast/s_tcc.c +++ b/src/mesa/swrast/s_tcc.c @@ -179,6 +179,10 @@ _swrast_execute_codegen_program( GLcontext *ctx, struct fp_machine *machine, const struct sw_span *span, GLuint column ) { + (void) ctx; + (void) program; (void) maxInst; + (void) machine; (void) span; + (void) column; return 0; } diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 59f884c00f4..834c72c50bf 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -456,6 +456,7 @@ sample_1d_nearest(GLcontext *ctx, { const GLint width = img->Width2; /* without border, power of two */ GLint i; + (void) ctx; COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); @@ -486,6 +487,7 @@ sample_1d_linear(GLcontext *ctx, GLint i0, i1; GLfloat u; GLuint useBorderColor; + (void) ctx; COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); @@ -657,6 +659,7 @@ sample_nearest_1d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;i<n;i++) { sample_1d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); @@ -673,6 +676,7 @@ sample_linear_1d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;i<n;i++) { sample_1d_linear(ctx, tObj, image, texcoords[i], rgba[i]); @@ -774,6 +778,7 @@ sample_2d_nearest(GLcontext *ctx, const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ GLint i, j; + (void) ctx; COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j); @@ -809,6 +814,7 @@ sample_2d_linear(GLcontext *ctx, GLint i0, j0, i1, j1; GLuint useBorderColor; GLfloat u, v; + (void) ctx; COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1); @@ -917,7 +923,9 @@ sample_2d_linear_repeat(GLcontext *ctx, const GLint height = img->Height2; GLint i0, j0, i1, j1; GLfloat u, v; - + (void) ctx; + (void) tObj; + ASSERT(tObj->WrapS == GL_REPEAT); ASSERT(tObj->WrapT == GL_REPEAT); ASSERT(img->Border == 0); @@ -1117,6 +1125,7 @@ sample_nearest_2d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;i<n;i++) { sample_2d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); @@ -1133,6 +1142,7 @@ sample_linear_2d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;i<n;i++) { sample_2d_linear(ctx, tObj, image, texcoords[i], rgba[i]); @@ -1161,6 +1171,8 @@ opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit, const GLint rowMask = img->Height - 1; const GLint shift = img->WidthLog2; GLuint k; + (void) ctx; + (void) texUnit; (void) lambda; ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); @@ -1201,6 +1213,8 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit, const GLint rowMask = img->Height - 1; const GLint shift = img->WidthLog2; GLuint i; + (void) ctx; + (void) texUnit; (void) lambda; ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); @@ -1366,6 +1380,7 @@ sample_3d_nearest(GLcontext *ctx, const GLint height = img->Height2; /* without border, power of two */ const GLint depth = img->Depth2; /* without border, power of two */ GLint i, j, k; + (void) ctx; COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j); @@ -1400,6 +1415,7 @@ sample_3d_linear(GLcontext *ctx, GLint i0, j0, k0, i1, j1, k1; GLuint useBorderColor; GLfloat u, v, w; + (void) ctx; COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1); @@ -1651,6 +1667,7 @@ sample_nearest_3d(GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;i<n;i++) { sample_3d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); @@ -1667,6 +1684,7 @@ sample_linear_3d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;i<n;i++) { sample_3d_linear(ctx, tObj, image, texcoords[i], rgba[i]); @@ -1836,6 +1854,7 @@ sample_nearest_cube(GLcontext *ctx, GLuint texUnit, GLchan rgba[][4]) { GLuint i; + (void) texUnit; (void) lambda; for (i = 0; i < n; i++) { const struct gl_texture_image **images; @@ -1854,6 +1873,7 @@ sample_linear_cube(GLcontext *ctx, GLuint texUnit, const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; + (void) texUnit; (void) lambda; for (i = 0; i < n; i++) { const struct gl_texture_image **images; @@ -1872,6 +1892,7 @@ sample_cube_nearest_mipmap_nearest(GLcontext *ctx, GLuint texUnit, const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; + (void) texUnit; ASSERT(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; @@ -1891,6 +1912,7 @@ sample_cube_linear_mipmap_nearest(GLcontext *ctx, GLuint texUnit, const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; + (void) texUnit; ASSERT(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; @@ -1910,6 +1932,7 @@ sample_cube_nearest_mipmap_linear(GLcontext *ctx, GLuint texUnit, const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; + (void) texUnit; ASSERT(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; @@ -1942,6 +1965,7 @@ sample_cube_linear_mipmap_linear(GLcontext *ctx, GLuint texUnit, const GLfloat lambda[], GLchan rgba[][4]) { GLuint i; + (void) texUnit; ASSERT(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; @@ -2053,6 +2077,7 @@ sample_nearest_rect(GLcontext *ctx, GLuint texUnit, const GLint height_minus_1 = img->Height - 1; GLuint i; + (void) ctx; (void) texUnit; (void) lambda; @@ -2108,6 +2133,7 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit, const GLint height_minus_1 = img->Height - 1; GLuint i; + (void) ctx; (void) texUnit; (void) lambda; @@ -2284,6 +2310,7 @@ sample_depth_texture( GLcontext *ctx, GLuint unit, GLenum function; GLchan result; + (void) lambda; (void) unit; ASSERT(tObj->Image[0][tObj->BaseLevel]->Format == GL_DEPTH_COMPONENT); @@ -3494,6 +3521,7 @@ texture_apply( const GLcontext *ctx, GLuint i; GLint Rc, Gc, Bc, Ac; GLenum format; + (void) primary_rgba; ASSERT(texUnit); ASSERT(texUnit->_Current); diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 5c8d1ebe294..a1a629c18d2 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -927,7 +927,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, const GLuint *zRow = (const GLuint *) \ _swrast_zbuffer_address(ctx, span.x, span.y); \ for (i = 0; i < span.end; i++) { \ - if (span.z < zRow[i]) { \ + if ((GLuint)span.z < zRow[i]) { \ ctx->OcclusionResult = GL_TRUE; \ ctx->Occlusion.PassedCounter++; \ } \ diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index cc709d3641d..c3e63582214 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -438,4 +438,5 @@ void _tnl_array_init( GLcontext *ctx ) */ void _tnl_array_destroy( GLcontext *ctx ) { + (void) ctx; } diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 0e50c6fa9a1..dac64631558 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -201,6 +201,7 @@ static void _tnl_import_edgeflag( GLcontext *ctx, struct gl_client_array *tmp; GLboolean is_writeable = 0; const GLubyte *data; + (void) writeable; (void) stride; tmp = _ac_import_edgeflag(ctx, GL_UNSIGNED_BYTE, sizeof(GLubyte), diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 14a7d6089be..7e4f3fd2399 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -51,6 +51,7 @@ _tnl_MakeCurrent( GLcontext *ctx, GLframebuffer *drawBuffer, GLframebuffer *readBuffer ) { + (void) ctx; (void) drawBuffer; (void) readBuffer; } diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c index c40de16fcac..5a7e6b5666b 100644 --- a/src/mesa/tnl/t_save_api.c +++ b/src/mesa/tnl/t_save_api.c @@ -179,6 +179,7 @@ build_normal_lengths( struct tnl_vertex_list *node ) static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx ) { struct tnl_vertex_store *store = MALLOC_STRUCT(tnl_vertex_store); + (void) ctx; store->used = 0; store->refcount = 1; return store; @@ -187,6 +188,7 @@ static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx ) static struct tnl_primitive_store *alloc_prim_store( GLcontext *ctx ) { struct tnl_primitive_store *store = MALLOC_STRUCT(tnl_primitive_store); + (void) ctx; store->used = 0; store->refcount = 1; return store; @@ -1241,6 +1243,7 @@ static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum typ const GLvoid *indices) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) count; (void) type; (void) indices; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" ); } @@ -1251,24 +1254,28 @@ static void GLAPIENTRY _save_DrawRangeElements(GLenum mode, const GLvoid *indices) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" ); } static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) start; (void) count; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" ); } static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) { GET_CURRENT_CONTEXT(ctx); + (void) x1; (void) y1; (void) x2; (void) y2; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" ); } static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) i1; (void) i2; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" ); } @@ -1276,12 +1283,14 @@ static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) i1; (void) i2; (void) j1; (void) j2; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" ); } static void GLAPIENTRY _save_Begin( GLenum mode ) { GET_CURRENT_CONTEXT( ctx ); + (void) mode; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" ); } @@ -1467,6 +1476,8 @@ void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + (void) list; (void) mode; + if (!tnl->save.prim_store) tnl->save.prim_store = alloc_prim_store( ctx ); @@ -1481,21 +1492,25 @@ void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) void _tnl_EndList( GLcontext *ctx ) { + (void) ctx; assert(TNL_CONTEXT(ctx)->save.vertex_size == 0); } void _tnl_BeginCallList( GLcontext *ctx, GLuint list ) { + (void) ctx; (void) list; } void _tnl_EndCallList( GLcontext *ctx ) { + (void) ctx; } static void _tnl_destroy_vertex_list( GLcontext *ctx, void *data ) { struct tnl_vertex_list *node = (struct tnl_vertex_list *)data; + (void) ctx; if ( --node->vertex_store->refcount == 0 ) FREE( node->vertex_store ); @@ -1512,6 +1527,7 @@ static void _tnl_print_vertex_list( GLcontext *ctx, void *data ) { struct tnl_vertex_list *node = (struct tnl_vertex_list *)data; GLuint i; + (void) ctx; _mesa_debug(0, "TNL-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", node->count, @@ -1597,4 +1613,5 @@ void _tnl_save_init( GLcontext *ctx ) */ void _tnl_save_destroy( GLcontext *ctx ) { + (void) ctx; } diff --git a/src/mesa/tnl/t_save_loopback.c b/src/mesa/tnl/t_save_loopback.c index 088b73609a6..18ecc3514fa 100644 --- a/src/mesa/tnl/t_save_loopback.c +++ b/src/mesa/tnl/t_save_loopback.c @@ -164,11 +164,13 @@ static attr_func mat_attrfunc[4] = { static void index_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v) { + (void) target; ctx->Exec->Indexf(v[0]); } static void edgeflag_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v) { + (void) target; ctx->Exec->EdgeFlag((GLboolean)(v[0] == 1.0)); } diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index cbeb9d5f71f..44a09f56c07 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -353,6 +353,7 @@ static void check_render( GLcontext *ctx, struct tnl_pipeline_stage *stage ) static void dtr( struct tnl_pipeline_stage *stage ) { + (void) stage; } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index bfa96a457d4..7147193a0d6 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -160,6 +160,7 @@ static void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -170,6 +171,7 @@ static void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -180,6 +182,7 @@ static void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -190,6 +193,7 @@ static void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = 0; @@ -200,6 +204,7 @@ static void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -208,12 +213,14 @@ static void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, con static void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; (void) v; (void) in; abort(); } static void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -223,6 +230,7 @@ static void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -232,6 +240,7 @@ static void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = 0; @@ -242,6 +251,7 @@ static void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -250,6 +260,7 @@ static void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = 0; @@ -258,7 +269,8 @@ static void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); - + (void) a; + out[0] = in[0]; } @@ -266,6 +278,7 @@ static void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); @@ -276,6 +289,7 @@ static void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); @@ -286,6 +300,7 @@ static void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); c[2] = 0; @@ -296,6 +311,7 @@ static void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); c[1] = 0; c[2] = 0; @@ -305,6 +321,7 @@ static void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte static void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); @@ -314,6 +331,7 @@ static void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); @@ -323,6 +341,7 @@ static void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[2] = 0; @@ -332,6 +351,7 @@ static void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); v[1] = 0; v[2] = 0; @@ -341,6 +361,7 @@ static void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); @@ -350,6 +371,7 @@ static void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); @@ -359,6 +381,7 @@ static void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[0] = 0; @@ -368,6 +391,7 @@ static void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); v[1] = 0; v[0] = 0; @@ -377,6 +401,7 @@ static void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); @@ -385,6 +410,7 @@ static void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[2] = 0; @@ -393,6 +419,7 @@ static void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); v[1] = 0; v[2] = 0; @@ -401,6 +428,7 @@ static void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); @@ -409,6 +437,7 @@ static void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[0] = 0; @@ -417,6 +446,7 @@ static void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); v[1] = 0; v[0] = 0; @@ -426,6 +456,7 @@ static void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); } @@ -481,6 +512,7 @@ static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -491,6 +523,7 @@ static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -502,6 +535,7 @@ static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, co static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -513,6 +547,7 @@ static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -523,6 +558,7 @@ static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = 0; @@ -534,6 +570,7 @@ static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat * const GLubyte *v ) { GLchan *c = (GLchan *)v; + (void) a; out[0] = CHAN_TO_FLOAT(c[0]); out[1] = CHAN_TO_FLOAT(c[1]); @@ -544,6 +581,7 @@ static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat * static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[0] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[2] = UBYTE_TO_FLOAT(v[2]); @@ -553,6 +591,7 @@ static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *ou static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[2] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[0] = UBYTE_TO_FLOAT(v[2]); @@ -562,6 +601,7 @@ static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *ou static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[0] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[2] = UBYTE_TO_FLOAT(v[2]); @@ -571,6 +611,7 @@ static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[2] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[0] = UBYTE_TO_FLOAT(v[2]); @@ -579,6 +620,7 @@ static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[0] = UBYTE_TO_FLOAT(v[0]); out[1] = 0; out[2] = 0; @@ -731,6 +773,7 @@ static void generic_interp( GLcontext *ctx, const struct tnl_clipspace_attr *a = vtx->attr; const GLuint attr_count = vtx->attr_count; GLuint j; + (void) force_boundary; if (tnl->NeedNdcCoords) { const GLfloat *dstclip = VB->ClipPtr->data[edst]; diff --git a/src/mesa/tnl/t_vertex_codegen.c b/src/mesa/tnl/t_vertex_codegen.c index e3e7f2ef1d2..4ff96430700 100644 --- a/src/mesa/tnl/t_vertex_codegen.c +++ b/src/mesa/tnl/t_vertex_codegen.c @@ -161,6 +161,7 @@ static GLboolean emit_3f_xyw_4( struct tnl_clipspace_codegen *p ) static GLboolean emit_3f_xyw_err( struct tnl_clipspace_codegen *p ) { + (void) p; assert(0); return GL_FALSE; } diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c index e75ac5b3397..a6b8cc30130 100644 --- a/src/mesa/tnl/t_vtx_api.c +++ b/src/mesa/tnl/t_vtx_api.c @@ -345,6 +345,7 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; } +#ifdef USE_X86_ASM static struct _tnl_dynfn *lookup( struct _tnl_dynfn *l, GLuint key ) { @@ -382,11 +383,13 @@ static tnl_attrfv_func do_codegen( GLcontext *ctx, GLuint attr, GLuint sz ) } if (dfn) - return (tnl_attrfv_func) dfn->code; + return *(tnl_attrfv_func *) &dfn->code; else return 0; } +#endif /* USE_X86_ASM */ + /* Helper function for 'CHOOSE' macro. Do what's necessary when an * entrypoint is called for the first time. */ @@ -824,6 +827,7 @@ static void _tnl_exec_vtxfmt_init( GLcontext *ctx ) void _tnl_FlushVertices( GLcontext *ctx, GLuint flags ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + (void) flags; if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) return; @@ -860,6 +864,7 @@ static void _tnl_current_init( GLcontext *ctx ) static struct _tnl_dynfn *no_codegen( GLcontext *ctx, int key ) { + (void) ctx; (void) key; return 0; } |