Package: quake2
Version: 1:0.3-1
Severity: wishlist
Tags: patch

Because of '-Werrror' option passed by default, compilation aborted on my
system:
====
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -pipe -Wall -Werror -ffast-math 
-funroll-loops -fomit-frame-pointer -fexpensive-optimizations -falign-loops=2 
-falign-jumps=2
-falign-functions=2 -fPIC -I/usr/X11R6/include -Wall -g -I/usr/local/include/ 
-MT ref_softx_la-rw_x11.lo -MD -MP -MF .deps/ref_softx_la-rw_x11.Tpo -c rw_x11.c
-fPIC -DPIC -o .libs/ref_softx_la-rw_x11.o
rw_x11.c: In function `install_grabs':
rw_x11.c:553: warning: unused variable `MajorVersion'
rw_x11.c:553: warning: unused variable `MinorVersion'
----
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -pipe -Wall -Werror -ffast-math -funroll-loops
 -fomit-frame-pointer -fexpensive-optimizations -falign-loops=2 -falign-jumps=2
 -falign-functions=2 -fPIC -I/usr/X11R6/include -Wall -g -I/usr/local/include/
 -MT ref_glx_la-gl_glx.lo -MD -MP -MF .deps/ref_glx_la-gl_glx.Tpo -c gl_glx.c
 -fPIC -DPIC -o .libs/ref_glx_la-gl_glx.o
 gl_glx.c: In function `GLimp_SetMode':
 gl_glx.c:1011: warning: unused variable `actualWidth'
 gl_glx.c:1011: warning: unused variable `actualHeight'
 gl_glx.c:1012: warning: unused variable `i'
 gl_glx.c: At top level:
 gl_glx.c:219: warning: 'num_vidmodes' defined but not used
 gl_glx.c:231: warning: 'vidmode_ext' defined but not used
----
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -pipe -Wall -Werror -ffast-math -funroll-loops
 -fomit-frame-pointer -fexpensive-optimizations -falign-loops=2 -falign-jumps=2
 -falign-functions=2 -fPIC -I/usr/X11R6/include -Wall -g -I/usr/local/include/
 -MT ref_glx_la-gl_glx.lo -MD -MP -MF .deps/ref_glx_la-gl_glx.Tpo -c gl_glx.c
 -fPIC -DPIC -o .libs/ref_glx_la-gl_glx.o
 gl_glx.c:219: warning: 'num_vidmodes' defined but not used
 gl_glx.c:231: warning: 'vidmode_ext' defined but not used
====

This could be fixed by using --disable-warn, but neither README nor INSTALL
files say anything about this option.

I've fixed these warnings, patch included.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R

Versions of packages quake2 depends on:
ii  libao2                    0.8.5-1        Cross Platform Audio Output Librar
ii  libasound2                1.0.6-2        Advanced Linux Sound Architecture 
ii  libc6                     2.3.2.ds1-17   GNU C Library: Shared libraries an
ii  libice6                   4.3.0.dfsg.1-8 Inter-Client Exchange library
ii  libsdl1.2debian           1.2.7-10       Simple DirectMedia Layer
ii  libsm6                    4.3.0.dfsg.1-8 X Window System Session Management
ii  libsvga1                  1:1.4.3-18     console SVGA display libraries
ii  libx11-6                  4.3.0.dfsg.1-8 X Window System protocol client li
ii  libxext6                  4.3.0.dfsg.1-8 X Window System miscellaneous exte
ii  quake2-data               13             Installer for Quake II data files
ii  xlibmesa-gl [libgl1]      4.3.0.dfsg.1-8 Mesa 3D graphics library [XFree86]
ii  xlibs                     4.3.0.dfsg.1-8 X Window System client libraries m

-- no debconf information
diff -rux '*.l[ao]' -x '*.loT' -x quake2 -x '*.[ao]' -x 'Makefile*' -x '*.Plo' -x '*.Po' -x .libs quake2-0.3.orig/src/gl_glx.c quake2-0.3/src/gl_glx.c
--- quake2-0.3.orig/src/gl_glx.c	2005-01-20 02:48:11.000000000 +0300
+++ quake2-0.3/src/gl_glx.c	2005-01-20 03:15:58.000000000 +0300
@@ -216,7 +216,7 @@
 static XF86VidModeModeInfo **vidmodes;
 #endif // HAVE_XF86_VIDMODE
 //static int default_dotclock_vidmode;
-static int num_vidmodes;
+//static int num_vidmodes;
 static qboolean vidmode_active = false;
 
 /* hardware gamma */
@@ -228,7 +228,7 @@
 
 static qboolean mouse_active = false;
 static qboolean dgamouse = false;
-static qboolean vidmode_ext = false;
+//static qboolean vidmode_ext = false;
 
 /* stencilbuffer shadows */
 qboolean have_stencil = false;
@@ -1008,8 +1008,8 @@
 	XWMHints *wmhints;
 	unsigned long mask;
 	int MajorVersion, MinorVersion;
-	int actualWidth, actualHeight;
-	int i;
+//	int actualWidth, actualHeight;
+//	int i;
 
 	r_fakeFullscreen = ri.Cvar_Get( "r_fakeFullscreen", "0", CVAR_ARCHIVE);
 
@@ -1113,6 +1113,8 @@
 
 		// Are we going fullscreen?  If so, let's change video mode
 		if (fullscreen && !r_fakeFullscreen->value) {
+			int i;
+			
 			best_dist = 9999999;
 			best_fit = -1;
 
@@ -1131,8 +1133,8 @@
 			}
 
 			if (best_fit != -1) {
-				actualWidth = vidmodes[best_fit]->hdisplay;
-				actualHeight = vidmodes[best_fit]->vdisplay;
+//				actualWidth = vidmodes[best_fit]->hdisplay;
+//				actualHeight = vidmodes[best_fit]->vdisplay;
 
 				// change to the mode
 				XF86VidModeSwitchToMode(dpy, scrnum, vidmodes[best_fit]);
diff -rux '*.l[ao]' -x '*.loT' -x quake2 -x '*.[ao]' -x 'Makefile*' -x '*.Plo' -x '*.Po' -x .libs quake2-0.3.orig/src/rw_x11.c quake2-0.3/src/rw_x11.c
--- quake2-0.3.orig/src/rw_x11.c	2005-01-20 02:48:11.000000000 +0300
+++ quake2-0.3/src/rw_x11.c	2005-01-20 02:52:39.000000000 +0300
@@ -550,9 +550,9 @@
 				 CurrentTime);
 
 	if (in_dgamouse->value) {
+#ifdef HAVE_XF86_DGA
 		int MajorVersion, MinorVersion;
 
-#ifdef HAVE_XF86_DGA
 		if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) { 
 			// unable to query, probalby not supported
 			ri.Con_Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" );

Reply via email to