Added -Wpointer-arith gcc flag, and fixed the resulting warnings.

diff --git a/configure b/configure
index 36798bc..c2b9fd4 100755
--- a/configure
+++ b/configure
@@ -10668,7 +10668,7 @@
 
 if test "x${GCC}" = "xyes"
 then
-  CFLAGS="$CFLAGS -Wall"
+  CFLAGS="$CFLAGS -Wall -Wpointer-arith"
   echo "$as_me:$LINENO: checking for gcc strength-reduce bug" >&5
 echo $ECHO_N "checking for gcc strength-reduce bug... $ECHO_C" >&6
 if test "${ac_cv_c_gcc_strength_bug+set}" = set; then
diff --git a/configure.ac b/configure.ac
index 30b1700..f2d1b83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -638,7 +638,7 @@
 
 if test "x${GCC}" = "xyes"
 then
-  CFLAGS="$CFLAGS -Wall"
+  CFLAGS="$CFLAGS -Wall -Wpointer-arith"
   AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
                   AC_TRY_RUN([
 int	L[[4]] = {0,1,2,3};
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index e7c70d0..14f8d49 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -143,10 +143,10 @@
         BOOL                        isLastUByte4;
         int                         numTextures;
         int                         textureNo;
-        const void                 *curVtx = NULL;
+        const char                 *curVtx = NULL;
         const short                *pIdxBufS = NULL;
         const long                 *pIdxBufL = NULL;
-        const void                 *curPos;
+        const char                 *curPos;
         BOOL                        isLightingOn = FALSE;
         BOOL                        enableTexture = FALSE;
         int                         vx_index;
@@ -286,7 +286,7 @@
             glBegin(primType);
 
             /* Draw the primitives */
-            curVtx = vertexBufData + (StartVertexIndex * skip);
+            curVtx = (const char *)vertexBufData + (StartVertexIndex * skip);
 
             for (vx_index = 0; vx_index < NumVertexes; vx_index++) {
 
@@ -580,7 +580,7 @@
 
             /* Faster version, harder to debug */
             /* Shuffle to the beginning of the vertexes to render and index from there */
-            curVtx = vertexBufData + (StartVertexIndex * skip);
+            curVtx = (const char *)vertexBufData + (StartVertexIndex * skip);
             curPos = curVtx;
 
             /* Set up the vertex pointers */
@@ -727,17 +727,19 @@
                 TRACE("glElements(%x, %d, %d, ...)\n", primType, NumVertexes, minIndex);
                 if (idxBytes==2) {
 #if 1  /* FIXME: Want to use DrawRangeElements, but wrong calculation! */
-                    glDrawElements(primType, NumVertexes, GL_UNSIGNED_SHORT, idxData+(2 * StartIdx)); 
+                    glDrawElements(primType, NumVertexes, GL_UNSIGNED_SHORT,
+                                   (char *)idxData+(2 * StartIdx));
 #else
                     glDrawRangeElements(primType, minIndex, minIndex+NumVertexes-1, NumVertexes, 
-                                        GL_UNSIGNED_SHORT, idxData+(2 * StartIdx));      
+                                        GL_UNSIGNED_SHORT, (char *)idxData+(2 * StartIdx));
 #endif
                 } else {
 #if 1  /* FIXME: Want to use DrawRangeElements, but wrong calculation! */
-                    glDrawElements(primType, NumVertexes, GL_UNSIGNED_INT, idxData+(4 * StartIdx)); 
+                    glDrawElements(primType, NumVertexes, GL_UNSIGNED_INT,
+                                   (char *)idxData+(4 * StartIdx));
 #else
                     glDrawRangeElements(primType, minIndex, minIndex+NumVertexes-1, NumVertexes, 
-                                        GL_UNSIGNED_INT, idxData+(2 * StartIdx));
+                                        GL_UNSIGNED_INT, (char *)idxData+(2 * StartIdx));
 #endif
                 }
                 checkGLcall("glDrawRangeElements");
@@ -1436,15 +1438,15 @@
         int pitchFrom     = ((IDirect3DSurface8Impl *)pSourceSurface)->myDesc.Width * bytesPerPixel;
         int pitchTo       = ((IDirect3DSurface8Impl *)pDestinationSurface)->myDesc.Width * bytesPerPixel;
 
-        void *copyfrom = ((IDirect3DSurface8Impl *)pSourceSurface)->allocatedMemory;
-        void *copyto   = ((IDirect3DSurface8Impl *)pDestinationSurface)->allocatedMemory;
+        char *copyfrom = ((IDirect3DSurface8Impl *)pSourceSurface)->allocatedMemory;
+        char *copyto   = ((IDirect3DSurface8Impl *)pDestinationSurface)->allocatedMemory;
 
         /* Copy rect by rect */
         for (i=0; i<cRects; i++) {
             CONST RECT *r = &pSourceRectsArray[i];
             CONST POINT *p = &pDestPointsArray[i];
-            void *from;
-            void *to;
+            char *from;
+            char *to;
             int   copyperline   = (r->right - r->left) * bytesPerPixel;
             int j;
 
diff --git a/dlls/d3d8/indexbuffer.c b/dlls/d3d8/indexbuffer.c
index 7a0244b..cba7ae7 100644
--- a/dlls/d3d8/indexbuffer.c
+++ b/dlls/d3d8/indexbuffer.c
@@ -107,7 +107,7 @@
     } else {
         FIXME("(%p) : stub, offset %d, size %d, Flags=%lx\n", This, OffsetToLock, SizeToLock, Flags);
     }
-    *ppbData = This->allocatedMemory + OffsetToLock;
+    *ppbData = (BYTE *)This->allocatedMemory + OffsetToLock;
     return D3D_OK;
 }
 
diff --git a/dlls/d3d8/shader.c b/dlls/d3d8/shader.c
index f62b4c7..36fe083 100644
--- a/dlls/d3d8/shader.c
+++ b/dlls/d3d8/shader.c
@@ -957,7 +957,7 @@
   /*DWORD tokenlen;*/
   DWORD tokentype;
   /** for input readers */
-  const void* curPos = NULL;
+  const char* curPos = NULL;
   FLOAT x, y, z, w;
   SHORT u, v, r, t;
   DWORD dw;
@@ -970,7 +970,7 @@
     /** FVF generation block */
     if (D3DVSD_TOKEN_STREAM == tokentype && 0 == (D3DVSD_STREAMTESSMASK & token)) {
       IDirect3DVertexBuffer8* pVB;
-      const void* startVtx = NULL;
+      const char* startVtx = NULL;
       int skip = 0;
 
       ++pToken;
@@ -982,7 +982,7 @@
 
       if (0 == stream) {
 	skip = device->StateBlock.stream_stride[0];
-	startVtx = vertexFirstStream + (StartVertexIndex * skip);
+	startVtx = (const char *)vertexFirstStream + (StartVertexIndex * skip);
 	curPos = startVtx + idxDecal;
 	/*TRACE(" using stream[%lu] with %lu decal => curPos %p\n", stream, idxDecal, curPos);*/
       } else {
diff --git a/dlls/ddraw/d3dexecutebuffer.c b/dlls/ddraw/d3dexecutebuffer.c
index 656857a..53ff2f2 100644
--- a/dlls/ddraw/d3dexecutebuffer.c
+++ b/dlls/ddraw/d3dexecutebuffer.c
@@ -192,8 +192,8 @@
     /* DWORD vc = This->data.dwVertexCount; */
     DWORD is = This->data.dwInstructionOffset;
     /* DWORD il = This->data.dwInstructionLength; */
-    
-    void *instr = This->desc.lpData + is;
+
+    char *instr = (char *)This->desc.lpData + is;
 
     /* Should check if the viewport was added or not to the device */
 
@@ -504,7 +504,7 @@
 		    /* Enough for the moment */
 		    if (ci->dwFlags == D3DPROCESSVERTICES_TRANSFORMLIGHT) {
 		        int nb;
-			D3DVERTEX  *src = ((LPD3DVERTEX)  (This->desc.lpData + vs)) + ci->wStart;
+			D3DVERTEX  *src = ((LPD3DVERTEX)  ((char *)This->desc.lpData + vs)) + ci->wStart;
 			OGL_Vertex *dst = ((OGL_Vertex *) (This->vertex_data)) + ci->wDest;
 			D3DMATRIX *mat = lpDevice->world_mat;
 			
@@ -533,7 +533,7 @@
 			}
 		    } else if (ci->dwFlags == D3DPROCESSVERTICES_TRANSFORM) {
 		        int nb;
-			D3DLVERTEX *src  = ((LPD3DLVERTEX) (This->desc.lpData + vs)) + ci->wStart;
+			D3DLVERTEX *src  = ((LPD3DLVERTEX) ((char *)This->desc.lpData + vs)) + ci->wStart;
 			OGL_LVertex *dst = ((OGL_LVertex *) (This->vertex_data)) + ci->wDest;
 			D3DMATRIX *mat = lpDevice->world_mat;
 			
@@ -558,7 +558,7 @@
 			    dst++;
 			}
 		    } else if (ci->dwFlags == D3DPROCESSVERTICES_COPY) {
-		        D3DTLVERTEX *src = ((LPD3DTLVERTEX) (This->desc.lpData + vs)) + ci->wStart;
+		        D3DTLVERTEX *src = ((LPD3DTLVERTEX) ((char *)This->desc.lpData + vs)) + ci->wStart;
 			D3DTLVERTEX *dst = ((LPD3DTLVERTEX) (This->vertex_data)) + ci->wDest;
 			
 			This->vertex_type = D3DVT_TLVERTEX;
diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c
index 65e7cc9..6865b1d 100644
--- a/dlls/gdi/freetype.c
+++ b/dlls/gdi/freetype.c
@@ -1597,7 +1597,7 @@
 
         for(contour = 0; contour < outline->n_contours; contour++) {
 	    pph_start = needed;
-	    pph = buf + needed;
+	    pph = (TTPOLYGONHEADER *)((char *)buf + needed);
 	    first_pt = point;
 	    if(buf) {
 	        pph->dwType = TT_POLYGON_TYPE;
@@ -1606,7 +1606,7 @@
 	    needed += sizeof(*pph);
 	    point++;
 	    while(point <= outline->contours[contour]) {
-	        ppc = buf + needed;
+	        ppc = (TTPOLYCURVE *)((char *)buf + needed);
 		type = (outline->tags[point] & FT_Curve_Tag_On) ?
 		  TT_PRIM_LINE : TT_PRIM_QSPLINE;
 		cpfx = 0;
@@ -1673,7 +1673,7 @@
 
         for(contour = 0; contour < outline->n_contours; contour++) {
 	    pph_start = needed;
-	    pph = buf + needed;
+	    pph = (TTPOLYGONHEADER *)((char *)buf + needed);
 	    first_pt = point;
 	    if(buf) {
 	        pph->dwType = TT_POLYGON_TYPE;
@@ -1682,7 +1682,7 @@
 	    needed += sizeof(*pph);
 	    point++;
 	    while(point <= outline->contours[contour]) {
-	        ppc = buf + needed;
+	        ppc = (TTPOLYCURVE *)((char *)buf + needed);
 		type = (outline->tags[point] & FT_Curve_Tag_On) ?
 		  TT_PRIM_LINE : TT_PRIM_CSPLINE;
 		cpfx = 0;
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index 3b73a6d..aad20d6 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -1172,7 +1172,7 @@
     }
     else
     {
-        cmd.buffer     = ((void*)pPacket) + pPacket->DataBufferOffset;
+        cmd.buffer     = (char*)pPacket + pPacket->DataBufferOffset;
     }
     cmd.buflen         = pPacket->DataTransferLength;
     cmd.sense          = &sense;
diff --git a/dlls/oleaut32/safearray.c b/dlls/oleaut32/safearray.c
index 5805de9..ef4e035 100644
--- a/dlls/oleaut32/safearray.c
+++ b/dlls/oleaut32/safearray.c
@@ -165,7 +165,7 @@
 {
   SAFEARRAYBOUND *sab;
   LONG allocSize = 0;
-  LPVOID ptr;
+  char *ptr;
 
   if (!cDims || cDims >= 0x10000) /* 65536 appears to be the limit */
     return E_INVALIDARG;
@@ -181,7 +181,7 @@
   ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, allocSize);
   if (!ptr)
     return E_OUTOFMEMORY;
-  *ppsaOut = ptr+sizeof(GUID);
+  *ppsaOut = (SAFEARRAY *)(ptr + sizeof(GUID));
   (*ppsaOut)->cDims	= cDims;
   TRACE("(%d): %lu bytes allocated for descriptor.\n", cDims, allocSize);
 
diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c
index 42fe308..c655bfe 100644
--- a/dlls/winedos/vga.c
+++ b/dlls/winedos/vga.c
@@ -76,7 +76,7 @@
 static int   vga_fb_pitch;
 static int   vga_fb_offset;
 static int   vga_fb_size = 0;
-static void *vga_fb_data = 0;
+static char *vga_fb_data = 0;
 static int   vga_fb_window = 0;
 
 /*
diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c
index 333e9d1..05e7f01 100644
--- a/dlls/winmm/lolvldrv.c
+++ b/dlls/winmm/lolvldrv.c
@@ -290,21 +290,21 @@
 			    DWORD* dwCallback, DWORD* dwInstance, BOOL bFrom32)
 {
     LPWINE_MLD	mld;
+    UINT i;
 
     mld = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
     if (!mld)	return NULL;
 
     /* find an empty slot in MM_MLDrvs table */
-    for (*hndl = 0; (DWORD)*hndl < MAX_MM_MLDRVS; (*hndl)++) {
-	if (!MM_MLDrvs[(UINT)*hndl]) break;
-    }
-    if ((DWORD)*hndl == MAX_MM_MLDRVS) {
+    for (i = 0; i < MAX_MM_MLDRVS; i++) if (!MM_MLDrvs[i]) break;
+
+    if (i == MAX_MM_MLDRVS) {
 	/* the MM_MLDrvs table could be made growable in the future if needed */
 	ERR("Too many open drivers\n");
 	return NULL;
     }
-    MM_MLDrvs[(UINT)*hndl] = mld;
-    *hndl = (HANDLE)((UINT)*hndl | 0x8000);
+    MM_MLDrvs[i] = mld;
+    *hndl = (HANDLE)(i | 0x8000);
 
     mld->type = type;
     if ((UINT)*hndl < MMDRV_GetNum(type) || HIWORD(*hndl) != 0) {
diff --git a/dlls/winmm/wineoss/audio.c b/dlls/winmm/wineoss/audio.c
index 675101d..ab24acf 100644
--- a/dlls/winmm/wineoss/audio.c
+++ b/dlls/winmm/wineoss/audio.c
@@ -2257,7 +2257,7 @@
     DWORD		dwSleepTime;
     DWORD		bytesRead;
     LPVOID		buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, wwi->dwFragmentSize);
-    LPVOID		pOffset = buffer;
+    char               *pOffset = buffer;
     audio_buf_info 	info;
     int 		xs;
     enum win_wm_message msg;
diff --git a/dlls/x11drv/clipboard.c b/dlls/x11drv/clipboard.c
index f92397c..eea0cde 100644
--- a/dlls/x11drv/clipboard.c
+++ b/dlls/x11drv/clipboard.c
@@ -1363,10 +1363,10 @@
             h = GlobalAlloc(0, size + sizeof(METAFILEPICT));
             if (h)
             {
-                LPVOID pdata = GlobalLock(h);
+                METAFILEPICT *pdata = GlobalLock(h);
 
                 memcpy(pdata, lpmfp, sizeof(METAFILEPICT));
-                GetMetaFileBitsEx(lpmfp->hMF, size, pdata + sizeof(METAFILEPICT));
+                GetMetaFileBitsEx(lpmfp->hMF, size, pdata + 1);
 
                 GlobalUnlock(h);
             }
@@ -1397,7 +1397,7 @@
 
                 memcpy(pmfp, (LPVOID)hdata, sizeof(METAFILEPICT));
                 pmfp->hMF = SetMetaFileBitsEx(cbytes - sizeof(METAFILEPICT),
-                                              (LPVOID)hdata + sizeof(METAFILEPICT));
+                                              (char *)hdata + sizeof(METAFILEPICT));
 
                 GlobalUnlock(h);
             }
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 4fed937..8609680 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -122,20 +122,22 @@
 
 static void hex_from(void* dst, const char* src, size_t len)
 {
+    unsigned char *p = dst;
     while (len--)
     {
-        *(unsigned char*)dst++ = (hex_from0(src[0]) << 4) | hex_from0(src[1]);
+        *p++ = (hex_from0(src[0]) << 4) | hex_from0(src[1]);
         src += 2;
     }
 }
 
 static void hex_to(char* dst, const void* src, size_t len)
 {
+    const unsigned char *p = src;
     while (len--)
     {
-        *dst++ = hex_to0(*(const unsigned char*)src >> 4);
-        *dst++ = hex_to0(*(const unsigned char*)src & 0x0F);
-        src++;
+        *dst++ = hex_to0(*p >> 4);
+        *dst++ = hex_to0(*p & 0x0F);
+        p++;
     }
 }