From 3351ce053db3ef031b59dd83b47342343c01cb17 Mon Sep 17 00:00:00 2001 From: Gregor Anich Date: Fri, 16 Jul 2004 23:48:54 +0000 Subject: [PATCH] Fixed more warnings, compiles with -Werror now. svn path=/trunk/; revision=10165 --- reactos/lib/mesa32/Makefile | 2 +- .../mesa32/src/drivers/windows/gdi/colors.h | 11 +++++- .../mesa32/src/drivers/windows/gdi/wmesa.c | 38 ++++++++++--------- .../lib/mesa32/src/drivers/windows/icd/icd.c | 13 +++---- 4 files changed, 38 insertions(+), 26 deletions(-) diff --git a/reactos/lib/mesa32/Makefile b/reactos/lib/mesa32/Makefile index 0566a2f5944..72faf6cbf59 100644 --- a/reactos/lib/mesa32/Makefile +++ b/reactos/lib/mesa32/Makefile @@ -238,7 +238,7 @@ TARGET_NAME = mesa32 TARGET_BASE = $(TARGET_BASE_LIB_MESA32) -TARGET_CFLAGS = -D__USE_W32API -Wall $(MESA_CFLAGS) +TARGET_CFLAGS = -D__USE_W32API -Wall -Werror $(MESA_CFLAGS) TARGET_GCCLIBS = gdi32 diff --git a/reactos/lib/mesa32/src/drivers/windows/gdi/colors.h b/reactos/lib/mesa32/src/drivers/windows/gdi/colors.h index 19f11eacc0f..9db5a5cac47 100644 --- a/reactos/lib/mesa32/src/drivers/windows/gdi/colors.h +++ b/reactos/lib/mesa32/src/drivers/windows/gdi/colors.h @@ -24,6 +24,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/07/16 23:48:24 blight + * Fixed more warnings, compiles with -Werror now. + * * Revision 1.1 2004/07/16 22:12:32 blight * Import Mesa-6.0.1 for use as software OpenGL renderer. * @@ -52,6 +55,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/07/16 23:48:24 blight + * Fixed more warnings, compiles with -Werror now. + * * Revision 1.1 2004/07/16 22:12:32 blight * Import Mesa-6.0.1 for use as software OpenGL renderer. * @@ -80,6 +86,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/07/16 23:48:24 blight + * Fixed more warnings, compiles with -Werror now. + * * Revision 1.1 2004/07/16 22:12:32 blight * Import Mesa-6.0.1 for use as software OpenGL renderer. * @@ -150,7 +159,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/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c b/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c index 0e6bd796fe4..37aae513dd9 100644 --- a/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c +++ b/reactos/lib/mesa32/src/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" @@ -164,7 +165,7 @@ static BOOL DDCreateOffScreen(WMesaContext wc); #define USE_GDI_TO_CLEAR 1 #endif -static void FlushToFile(PWMC pwc, PSTR szFile); +//static void FlushToFile(PWMC pwc, PSTR szFile); BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); BOOL wmDeleteBackingStore(PWMC pwc); void wmCreatePalette( PWMC pwdc ); @@ -347,11 +348,12 @@ BOOL wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); /* Finish all pending operations and synchronize. */ +#if 0 static void finish(GLcontext* ctx) { /* No op */ } - +#endif static void flush(GLcontext* ctx) { @@ -466,7 +468,7 @@ static void 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 */ @@ -600,7 +602,7 @@ 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; @@ -647,7 +649,7 @@ static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) /**********************************************************************/ /* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */ - +#if 0 static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) { } @@ -667,6 +669,7 @@ static line_func choose_line_function( GLcontext* ctx ) { return NULL; } +#endif /**********************************************************************/ @@ -735,7 +738,7 @@ static void write_rgba_span( const GLcontext* ctx, GLuint n, GLint x, GLint y, if (pwc->rgb_flag==GL_TRUE) { GLuint i; - HDC DC=DD_GETDC; + //HDC DC=DD_GETDC; y=FLIP(y); if (mask) { for (i=0; irgb_flag==GL_TRUE) { GLuint i; - HDC DC=DD_GETDC; + //HDC DC=DD_GETDC; y=FLIP(y); if (mask) { for (i=0; irgb_flag==GL_TRUE); for (i=0; irgb_flag==GL_TRUE); for (i=0; ihDC; +// HDC DC = Current->hDC; GET_CURRENT_CONTEXT(ctx); /* If we're swapping the buffer associated with the current context @@ -1764,14 +1768,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 @@ -1790,7 +1794,7 @@ void wmCreateDIBSection( BOOL wmFlush(PWMC pwc) { BOOL bRet = 0; - DWORD dwErr = 0; +// DWORD dwErr = 0; #ifdef DDRAW HRESULT ddrval; #endif @@ -3204,9 +3208,9 @@ static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, #endif /************** END DEAD TRIANGLE CODE ***********************/ +#if 0 static triangle_func choose_triangle_function( GLcontext *ctx ) { -#if 0 WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; int depth = wmesa->cColorBits; @@ -3296,8 +3300,8 @@ static triangle_func choose_triangle_function( GLcontext *ctx ) return NULL; } -#endif } +#endif /* * Define a new viewport and reallocate auxillary buffers if the size of diff --git a/reactos/lib/mesa32/src/drivers/windows/icd/icd.c b/reactos/lib/mesa32/src/drivers/windows/icd/icd.c index 0be278102c5..7d605b5a4a6 100644 --- a/reactos/lib/mesa32/src/drivers/windows/icd/icd.c +++ b/reactos/lib/mesa32/src/drivers/windows/icd/icd.c @@ -29,9 +29,8 @@ extern "C" { #include #define GL_GLEXT_PROTOTYPES -#include -#include -//#include +#include "GL/gl.h" +#include "GL/glext.h" #ifdef __cplusplus } @@ -39,7 +38,7 @@ extern "C" { #include #include -#include "wmesadef.h" +#include "../gdi/wmesadef.h" #include "GL/wmesa.h" #include "mtypes.h" #include "glapi.h" @@ -53,7 +52,7 @@ typedef struct _icdTable { } ICDTABLE, *PICDTABLE; static ICDTABLE icdTable = { 336, { -#define ICD_ENTRY(func) mgl##func, +#define ICD_ENTRY(func) (PROC)mgl##func, #include "icdlist.h" #undef ICD_ENTRY } }; @@ -218,13 +217,13 @@ WGLAPI BOOL GLAPIENTRY DrvShareLists(HGLRC hglrc1,HGLRC hglrc2) return(TRUE); } - +#if 0 static FIXED FixedFromDouble(double d) { long l = (long) (d * 65536L); return *(FIXED *)&l; } - +#endif WGLAPI BOOL GLAPIENTRY DrvDescribeLayerPlane(HDC hdc,int iPixelFormat, int iLayerPlane,UINT nBytes,