assorted warning clean-ups for x86_64, etc (Mikko T.)
diff --git a/progs/demos/Makefile b/progs/demos/Makefile
index 5827b46..75e2f58 100644
--- a/progs/demos/Makefile
+++ b/progs/demos/Makefile
@@ -127,4 +127,4 @@
 clean:
 	-rm -f $(PROGS)
 	-rm -f *.o *~
-	-rm -f readtex.[ch]
+	-rm -f readtex.[ch] showbuffer.[ch]
diff --git a/progs/samples/Makefile b/progs/samples/Makefile
index 0a87506..f14b7df 100644
--- a/progs/samples/Makefile
+++ b/progs/samples/Makefile
@@ -45,3 +45,4 @@
 clean:
 	-rm -f $(PROGS)
 	-rm -f *.o *~
+	-rm -f readtex.c readtex.h
diff --git a/progs/samples/blendxor.c b/progs/samples/blendxor.c
index 6f34e28..5bc4aa9 100644
--- a/progs/samples/blendxor.c
+++ b/progs/samples/blendxor.c
@@ -14,7 +14,9 @@
 #include <windows.h>
 #endif
 #define GL_GLEXT_LEGACY
+#define GL_GLEXT_PROTOTYPES
 #include <GL/glut.h>
+#include <GL/glext.h>
 
 
 GLenum doubleBuffer;
diff --git a/progs/samples/loadppm.c b/progs/samples/loadppm.c
index b4b1b38..be056d6 100644
--- a/progs/samples/loadppm.c
+++ b/progs/samples/loadppm.c
@@ -37,7 +37,7 @@
 	exit(1);
     }
 
-    if (fscanf(fp, "%d %d", &result->sizeX, &result->sizeY) != 2)
+    if (fscanf(fp, "%lu %lu", &result->sizeX, &result->sizeY) != 2)
     {
 	fprintf(stderr, "Error loading image `%s'\n", filename);
 	exit(1);
diff --git a/progs/xdemos/glxgears_fbconfig.c b/progs/xdemos/glxgears_fbconfig.c
index cadcaec..ba692b4 100644
--- a/progs/xdemos/glxgears_fbconfig.c
+++ b/progs/xdemos/glxgears_fbconfig.c
@@ -360,19 +360,19 @@
 
    if ( glx_1_3_supported ) {
       choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB( 
-		(GLbyte *) "glXChooseFBConfig");
+		(GLubyte *) "glXChooseFBConfig");
       get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB( 
-		(GLbyte *) "glXGetVisualFromFBConfig");
+		(GLubyte *) "glXGetVisualFromFBConfig");
       create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB(
-		(GLbyte *) "glXCreateNewContext");
+		(GLubyte *) "glXCreateNewContext");
    }
    else if ( ext_version_supported ) {
       choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB( 
-		(GLbyte *) "glXChooseFBConfigSGIX");
+		(GLubyte *) "glXChooseFBConfigSGIX");
       get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB( 
-		(GLbyte *) "glXGetVisualFromFBConfigSGIX");
+		(GLubyte *) "glXGetVisualFromFBConfigSGIX");
       create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB(
-		(GLbyte *) "glXCreateContextWithConfigSGIX");
+		(GLubyte *) "glXCreateContextWithConfigSGIX");
    }
    else {
       printf( "This demo requires either GLX 1.3 or %s be supported.\n",
diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index b81b9bc..ea17438 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -1169,15 +1169,15 @@
     for (i = 0; i < newheight; i++) {
 	for (j = 0; j < newwidth; j++) {
 	    for (k = 0; k < components; k++) {
-		GLuint b;
-		b = __GLU_SWAP_4_BYTES(t);
-		s[0] = *(GLfloat*)&b;
-		b = __GLU_SWAP_4_BYTES(t+group_size);
-		s[0] += *(GLfloat*)&b;
-		b = __GLU_SWAP_4_BYTES(t+ysize);
-		s[0] += *(GLfloat*)&b;
-		b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
-		s[0] += *(GLfloat*)&b;
+		union { GLuint b; GLfloat f; } swapbuf;
+		swapbuf.b = __GLU_SWAP_4_BYTES(t);
+		s[0] = swapbuf.f;
+		swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size);
+		s[0] += swapbuf.f;
+		swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize);
+		s[0] += swapbuf.f;
+		swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
+		s[0] += swapbuf.f;
 		s[0] /= 4;
 		s++; t += element_size;
 	    }
@@ -2980,7 +2980,7 @@
     int l, m;
     const char *left, *right;
 
-    GLuint swapbuf;	/* unsigned buffer */
+    union { GLuint b; GLfloat f; } swapbuf;
 
     if (widthin == widthout*2 && heightin == heightout*2) {
 	halveImage_float(components, widthin, heightin,
@@ -3029,8 +3029,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3041,8 +3041,8 @@
 		    for (k = 0, temp_index = temp; k < components;
 			 k++, temp_index += element_size) {
 			if (myswap_bytes) {
-			    swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			    totals[k] += *(const GLfloat*)&swapbuf * y_percent;
+			    swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			    totals[k] += swapbuf.f * y_percent;
 			} else {
 			    totals[k] += *(const GLfloat*)temp_index * y_percent;
 			}
@@ -3054,8 +3054,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3068,8 +3068,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3079,8 +3079,8 @@
 		    for (k = 0, temp_index = temp; k < components;
 			 k++, temp_index += element_size) {
 			if (myswap_bytes) {
-			    swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			    totals[k] += *(const GLfloat*)&swapbuf * y_percent;
+			    swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			    totals[k] += swapbuf.f * y_percent;
 			} else {
 			    totals[k] += *(const GLfloat*)temp_index * y_percent;
 			}
@@ -3091,8 +3091,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3105,10 +3105,10 @@
 		    for (k = 0; k < components;
 			 k++, left += element_size, right += element_size) {
 			if (myswap_bytes) {
-			    swapbuf = __GLU_SWAP_4_BYTES(left);
-			    totals[k] += *(const GLfloat*)&swapbuf * (1-lowx_float);
-			    swapbuf = __GLU_SWAP_4_BYTES(right);
-			    totals[k] += *(const GLfloat*)&swapbuf * highx_float;
+			    swapbuf.b = __GLU_SWAP_4_BYTES(left);
+			    totals[k] += swapbuf.f * (1-lowx_float);
+			    swapbuf.b = __GLU_SWAP_4_BYTES(right);
+			    totals[k] += swapbuf.f * highx_float;
 			} else {
 			    totals[k] += *(const GLfloat*)left * (1-lowx_float)
 				       + *(const GLfloat*)right * highx_float;
@@ -3122,8 +3122,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3133,8 +3133,8 @@
 		    for (k = 0, temp_index = temp; k < components;
 			 k++, temp_index += element_size) {
 			if (myswap_bytes) {
-			    swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			    totals[k] += *(const GLfloat*)&swapbuf * x_percent;
+			    swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			    totals[k] += swapbuf.f * x_percent;
 			} else {
 			    totals[k] += *(const GLfloat*)temp_index * x_percent;
 			}
@@ -3145,8 +3145,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3159,8 +3159,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3170,8 +3170,8 @@
 		    for (k = 0, temp_index = temp; k < components;
 			 k++, temp_index += element_size) {
 			if (myswap_bytes) {
-			    swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			    totals[k] += *(const GLfloat*)&swapbuf * y_percent;
+			    swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			    totals[k] += swapbuf.f * y_percent;
 			} else {
 			    totals[k] += *(const GLfloat*)temp_index * y_percent;
 			}
@@ -3182,8 +3182,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3194,8 +3194,8 @@
 		for (k = 0, temp_index = temp; k < components;
 		     k++, temp_index += element_size) {
 		    if (myswap_bytes) {
-			swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			totals[k] += *(const GLfloat*)&swapbuf * percent;
+			swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			totals[k] += swapbuf.f * percent;
 		    } else {
 			totals[k] += *(const GLfloat*)temp_index * percent;
 		    }
@@ -3211,8 +3211,8 @@
 		    for (k = 0, temp_index = temp; k < components;
 			 k++, temp_index += element_size) {
 			if (myswap_bytes) {
-			    swapbuf = __GLU_SWAP_4_BYTES(temp_index);
-			    totals[k] += *(const GLfloat*)&swapbuf;
+			    swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+			    totals[k] += swapbuf.f;
 			} else {
 			    totals[k] += *(const GLfloat*)temp_index;
 			}
@@ -7397,19 +7397,17 @@
       GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
 			      depthPowerOf2 >> 1 :
 			      depthPowerOf2;
-      GLenum proxyTarget;
+      GLenum proxyTarget = GL_PROXY_TEXTURE_3D;
       assert(widthAtLevelOne > 0);
       assert(heightAtLevelOne > 0);
       assert(depthAtLevelOne > 0);
 
       /* does width x height x depth at level 1 & all their mipmaps fit? */
-      if (target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D) {
-	 proxyTarget = GL_PROXY_TEXTURE_3D;
-	 gluTexImage3D(proxyTarget, 1, /* must be non-zero */
-		      internalFormat,
-		      widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
-		      0,format,type,NULL);
-      }
+      assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D);
+      gluTexImage3D(proxyTarget, 1, /* must be non-zero */
+                    internalFormat,
+                    widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
+                    0,format,type,NULL);
       glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
       /* does it fit??? */
       if (proxyWidth == 0) { /* nope, so try again with these sizes */
diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile
index 0b43aeac..2b71804 100644
--- a/src/glut/glx/Makefile
+++ b/src/glut/glx/Makefile
@@ -101,7 +101,7 @@
 	-rm -f *.lo
 	-rm -f *.la
 	-rm -rf .libs
-	-rm -rf depend
+	-rm -rf depend depend.bak
 
 
 depend: $(SOURCES)
diff --git a/src/glut/glx/glut_cursor.c b/src/glut/glx/glut_cursor.c
index ff5c89f..797cb49 100644
--- a/src/glut/glx/glut_cursor.c
+++ b/src/glut/glx/glut_cursor.c
@@ -61,7 +61,7 @@
   Atom crosshairAtom, actualType;
   int rc, actualFormat;
   unsigned long n, left;
-  unsigned long *value;
+  unsigned char *value;
 
   if (fullCrosshairCusor == None) {
     crosshairAtom = XInternAtom(__glutDisplay,
@@ -70,9 +70,9 @@
       value = 0;        /* Make compiler happy. */
       rc = XGetWindowProperty(__glutDisplay, __glutRoot,
         crosshairAtom, 0, 1, False, XA_CURSOR, &actualType,
-        &actualFormat, &n, &left, (unsigned char **) &value);
+        &actualFormat, &n, &left, &value);
       if (rc == Success && actualFormat == 32 && n >= 1) {
-        cursor = value[0];
+        cursor = ((unsigned long *)value)[0];
         XFree(value);
         return cursor;
       }
diff --git a/src/glw/Makefile b/src/glw/Makefile
index b426d75..4f1abf5 100644
--- a/src/glw/Makefile
+++ b/src/glw/Makefile
@@ -27,7 +27,7 @@
 
 
 clean:
-	-rm depend
+	-rm depend depend.bak
 	-rm -f *.o *~
 
 
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index b59b7f1..d5e2c79 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -932,7 +932,7 @@
    /* add in texels */
    for (k = N_TEXELS - 1; k >= 0; k--) {
       GLint t = k * 3;
-      GLuint *kk = (GLuint *)((GLuint)cc + t / 8);
+      GLuint *kk = (GLuint *)((char *)cc + t / 8);
       GLint texel = n_vect + 1; /* transparent black */
 
       if (!ISTBLACK(input[k])) {
@@ -1011,7 +1011,7 @@
    /* left microtile */
    if (maxColL == -1) {
       /* all transparent black */
-      cc[0] = ~0ul;
+      cc[0] = ~0u;
       for (i = 0; i < n_comp; i++) {
          vec[0][i] = 0;
          vec[1][i] = 0;
@@ -1045,7 +1045,7 @@
    /* right microtile */
    if (maxColR == -1) {
       /* all transparent black */
-      cc[1] = ~0ul;
+      cc[1] = ~0u;
       for (i = 0; i < n_comp; i++) {
          vec[2][i] = 0;
          vec[3][i] = 0;
@@ -1332,7 +1332,7 @@
    if (trualpha) {
       fxt1_quantize_ALPHA1(cc, input);
    } else if (l == 0) {
-      cc[0] = cc[1] = cc[2] = ~0ul;
+      cc[0] = cc[1] = cc[2] = ~0u;
       cc[3] = 0;
    } else if (l < N_TEXELS) {
       fxt1_quantize_MIXED1(cc, input);