]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
move two #defined to quakedef.h, and always include quakedef.h first before any other...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Nov 2007 14:28:40 +0000 (14:28 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Nov 2007 14:28:40 +0000 (14:28 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7689 d7cf8633-e32d-0410-b094-e92efae38249

34 files changed:
cd_bsd.c
cd_linux.c
cd_win.c
clvm_cmds.c
common.c
conproc.c
console.c
curves.c
fs.c
host.c
keys.c
lhnet.c
mathlib.c
matrixlib.c
mdfour.c
menu.c
menu.h
mvm_cmds.c
polygon.c
prvm_cmds.c
quakedef.h
snd_alsa.c
snd_bsd.c
snd_coreaudio.c
snd_oss.c
snd_sdl.c
svbsp.c
svvm_cmds.c
sys_linux.c
sys_sdl.c
vid_agl.c
vid_glx.c
vid_null.c
vid_sdl.c

index a514fc0bf23983a028b1fba6337b1e74307f96cd..e74a567a5a82f181b152f4d576d64bd36cf32702 100644 (file)
--- a/cd_bsd.c
+++ b/cd_bsd.c
@@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
 
+#include "quakedef.h"
+
 #include <sys/types.h>
 #include <sys/cdio.h>
 #include <sys/ioctl.h>
@@ -31,7 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # include <util.h>
 #endif
 
-#include "quakedef.h"
 #include "cdaudio.h"
 
 
index 2db702cb3f9f2b685ee644377b51e49c997a4fea..c8cdd6c38465303aab9c655e0cead2f532bf32f5 100644 (file)
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // rights reserved.
 
 // suggested by Zero_Dogg to fix a compile problem on Mandriva Linux
-#define __KERNEL_STRICT_NAMES
+#include "quakedef.h"
 
 #include <linux/cdrom.h>
 #include <sys/ioctl.h>
@@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <time.h>
 #include <unistd.h>
 
-#include "quakedef.h"
 #include "cdaudio.h"
 
 
index 495fe02091dd97e6cc5ac341e26868db9940a87e..2cc716133e12c7c4a77df297d06df6f6cf9b9235 100644 (file)
--- a/cd_win.c
+++ b/cd_win.c
@@ -20,10 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All
 // rights reserved.
 
+#include "quakedef.h"
 #include <windows.h>
 #include <mmsystem.h>
 
-#include "quakedef.h"
 #include "cdaudio.h"
 
 #if _MSC_VER < 1300
index 5547057df3f3a5e42246291ae02c928728cfdb87..92c2d8b4fb52cf37d0e3689fbb1a00897cc80789 100644 (file)
@@ -1,3 +1,5 @@
+#include "quakedef.h"
+
 #include "prvm_cmds.h"
 #include "csprogs.h"
 #include "cl_collision.h"
@@ -22,7 +24,7 @@ void Sbar_SortFrags (void);
 void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius);
 void CSQC_RelinkAllEntities (int drawmask);
 void CSQC_RelinkCSQCEntities (void);
-char *Key_GetBind (int key);
+const char *Key_GetBind (int key);
 
 
 
index 79325dc7328d572bdba45739d4439b83976e8689..42511e494bff671e8d094886b3ae8d5e640b2217 100644 (file)
--- a/common.c
+++ b/common.c
@@ -19,14 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // common.c -- misc functions used in client and server
 
+#include "quakedef.h"
+
 #include <stdlib.h>
 #include <fcntl.h>
 #ifndef WIN32
 #include <unistd.h>
 #endif
 
-#include "quakedef.h"
-
 cvar_t registered = {0, "registered","0", "indicates if this is running registered quake (whether gfx/pop.lmp was found)"};
 cvar_t cmdline = {0, "cmdline","0", "contains commandline the engine was launched with"};
 
index 63a1e465355256b3066d01510e8b263f83cc24ba..dd21407d79ba65e603b6edf656563ab608db8ca2 100644 (file)
--- a/conproc.c
+++ b/conproc.c
@@ -19,9 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // conproc.c
 
+#include "quakedef.h"
+
 #include <windows.h>
 #include <wchar.h>
-#include "quakedef.h"
 #include "conproc.h"
 
 HANDLE heventDone;
index eb13a112b5b90c51da610a39247843bc6dedaea5..c11f548c254aa4556bea08e505306c9681a1e95e 100644 (file)
--- a/console.c
+++ b/console.c
@@ -19,11 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // console.c
 
+#include "quakedef.h"
+
 #if !defined(WIN32) || defined(__MINGW32__)
 # include <unistd.h>
 #endif
 #include <time.h>
-#include "quakedef.h"
 
 int con_linewidth;
 
index de3f423ab0875659c9c6326c8b9be554692de106..3a9e22a1f26ec4c38243e8967a4dd173a31aae24 100644 (file)
--- a/curves.c
+++ b/curves.c
@@ -39,6 +39,8 @@ double bsplinesample(int dimensions, double t, double *param)
 }
 */
 
+#include "quakedef.h"
+
 #include <math.h>
 #include "curves.h"
 
diff --git a/fs.c b/fs.c
index 362b36ad71c1b5cd0093ecf5b617d66c2123b4ce..8f66fe884efe43babe3c4fa69d18fe18d0506c22 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -22,9 +22,6 @@
                Boston, MA  02111-1307, USA
 */
 
-// on UNIX platforms we need to define this so that video saving does not cause a SIGFSZ (file size) signal when a video clip exceeds 2GB
-#define _FILE_OFFSET_BITS 64
-
 #include "quakedef.h"
 
 #include <limits.h>
diff --git a/host.c b/host.c
index 36fa7ac59e621588c30878e616c7afa415107c3e..4638ee8fae2226dbf3fb2cf3952e5bf783030193 100644 (file)
--- a/host.c
+++ b/host.c
@@ -19,8 +19,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // host.c -- coordinates spawning and killing of local servers
 
-#include <time.h>
 #include "quakedef.h"
+
+#include <time.h>
 #include "libcurl.h"
 #include "cdaudio.h"
 #include "cl_video.h"
diff --git a/keys.c b/keys.c
index 610f448a7186d290cc82d29782b13f44bb5e4456..11280e0f9acb24af4878e6b72b6ea43aa336a2ce 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -506,7 +506,7 @@ qboolean    chat_team;
 char           chat_buffer[MAX_INPUTLINE];
 unsigned int   chat_bufferlen = 0;
 
-extern unsigned int Nicks_CompleteChatLine(char *buffer, size_t size, int pos);
+extern int Nicks_CompleteChatLine(char *buffer, size_t size, unsigned int pos);
 
 static void
 Key_Message (int key, char ascii)
diff --git a/lhnet.c b/lhnet.c
index b97be361e24cb6a4629ab478fe4bd814c45def4f..d72589d1da946794cd7f9d1e6eae691592f8520b 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -1,6 +1,10 @@
 
 // Written by Forest Hale 2003-06-15 and placed into public domain.
 
+#ifndef STANDALONETEST
+#include "quakedef.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <time.h>
@@ -23,7 +27,6 @@
 
 // for Z_Malloc/Z_Free in quake
 #ifndef STANDALONETEST
-#include "quakedef.h"
 #include "zone.h"
 #include "sys.h"
 #include "netconn.h"
index eaa1a765d8e05bc5c65328a808591ad5053941e1..c1e65b5a06c3d37537d03ec37f007ce693bf114c 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -19,9 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // mathlib.c -- math primitives
 
-#include <math.h>
 #include "quakedef.h"
 
+#include <math.h>
+
 vec3_t vec3_origin = {0,0,0};
 float ixtable[4096];
 
index e430a7d476a03693e16e2c157a4043f100b1c0dd..a0499861b6161ccdb86ecdc48a8b1a977758b285 100644 (file)
@@ -1,3 +1,4 @@
+#include "quakedef.h"
 
 #include <math.h>
 #include "matrixlib.h"
index 9859f94ac01aae219c51fce2fefc48c6fec9f0fe..c550651ec37b8eba38d1f747631e2ba425baef5f 100644 (file)
--- a/mdfour.c
+++ b/mdfour.c
@@ -27,6 +27,8 @@
        $Id$
 */
 
+#include "quakedef.h"
+
 #include <string.h>            /* XoXus: needed for memset call */
 #include "mdfour.h"
 
diff --git a/menu.c b/menu.c
index fe931e6edc34c08d405cba74842080863541c295..54e2e52055fc25a59d7b7967b9f36e4f11321127 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -2764,14 +2764,6 @@ static void M_Reset_Draw (void)
 /* VIDEO MENU */
 
 // note: if modes are added to the beginning of this list, update VID_DEFAULT
-typedef struct video_resolution_s
-{
-       const char *type;
-       int width, height;
-       int conwidth, conheight;
-       double pixelheight; // pixel aspect
-}
-video_resolution_t;
 video_resolution_t video_resolutions[] =
 {
 {"Standard 4x3"              ,  320, 240, 320, 240, 1     },
diff --git a/menu.h b/menu.h
index 8fdba99d725cf5e98e27d9a1a756677b6e85fe85..df58facb50488d1c08a903bac835d1011f6f182d 100644 (file)
--- a/menu.h
+++ b/menu.h
@@ -83,5 +83,15 @@ extern void (*MR_KeyEvent) (int key, char ascii, qboolean downevent);
 extern void (*MR_Draw) (void);
 extern void (*MR_ToggleMenu_f) (void);
 extern void (*MR_Shutdown) (void);
+
+typedef struct video_resolution_s
+{
+       const char *type;
+       int width, height;
+       int conwidth, conheight;
+       double pixelheight; // pixel aspect
+}
+video_resolution_t;
+video_resolution_t video_resolutions[];
 #endif
 
index 304be4c3c5c246c2cb802fa679121d8c4ebb99e9..e3aea4b48a226e0e5edb2eb3e1c2ee5724fcbf47 100644 (file)
@@ -1,4 +1,7 @@
+#include "quakedef.h"
+
 #include "prvm_cmds.h"
+#include "menu.h"
 
 //============================================================================
 // Menu
@@ -195,7 +198,6 @@ VM_M_getresolution
 vector getresolution(float number)
 =========
 */
-extern unsigned short video_resolutions[][2];
 void VM_M_getresolution(void)
 {
        int nr;
@@ -203,9 +205,9 @@ void VM_M_getresolution(void)
 
        nr = (int)PRVM_G_FLOAT(OFS_PARM0);
 
-
-       PRVM_G_VECTOR(OFS_RETURN)[0] = video_resolutions[nr][0];
-       PRVM_G_VECTOR(OFS_RETURN)[1] = video_resolutions[nr][1];
+       // FIXME bounds check
+       PRVM_G_VECTOR(OFS_RETURN)[0] = video_resolutions[nr].width;
+       PRVM_G_VECTOR(OFS_RETURN)[1] = video_resolutions[nr].height;
        PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
 }
 
index 2bc897fbe8baec206093b5fe6bb26308b1a15793..a02c032c1370da4fd85ed960d47e74a624069789 100644 (file)
--- a/polygon.c
+++ b/polygon.c
@@ -3,6 +3,8 @@
 Polygon clipping routines written by Forest Hale and placed into public domain.
 */
 
+#include "quakedef.h"
+
 #include <math.h>
 #include "polygon.h"
 
index 57f192b39212fbefd1994a514b815cbf80c4b104..73d36bca1fd8b831192b60586aeb58ed86b25edb 100644 (file)
@@ -4,6 +4,8 @@
 // cause large (I think they will) parts are from pr_cmds the same copyright like in pr_cmds
 // also applies here
 
+#include "quakedef.h"
+
 #include "prvm_cmds.h"
 #include <time.h>
 
index 1d9c771560f161bf17d87f132abf139e61cd9e13..c2843b31486d387d76e9d4432dffeb1355e8b11f 100644 (file)
@@ -22,6 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifndef QUAKEDEF_H
 #define QUAKEDEF_H
 
+// on UNIX platforms we need to define this so that video saving does not cause a SIGFSZ (file size) signal when a video clip exceeds 2GB
+#define _FILE_OFFSET_BITS 64
+
+// for cd_linux.c
+#define __KERNEL_STRICT_NAMES
+
 #if defined(__GNUC__) && (__GNUC__ > 2)
 #define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
 #else
index bed25d2b0964387179871c3081daacde02fb3272..96c8b2d1abeee45cb058ca48b16791ea6b967bfc 100644 (file)
 
 // ALSA module, used by Linux
 
+#include "quakedef.h"
 
 #include <alsa/asoundlib.h>
 
-#include "quakedef.h"
 #include "snd_main.h"
 
 
index e202342b798ba331575571cdbd82a355b09769fc..0dd7186a19ef0cae7ddcfc67243b0af8cccf5153 100644 (file)
--- a/snd_bsd.c
+++ b/snd_bsd.c
@@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
+#include "quakedef.h"
 
 #include <sys/param.h>
 #include <sys/audioio.h>
@@ -31,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #endif
 #include <unistd.h>
 
-#include "quakedef.h"
 #include "snd_main.h"
 
 
index 246cff1d5f1a51e18c1569bc3088024954c8442e..1e36c7683e199809d5015d15b19bb6224cbfbca8 100644 (file)
@@ -20,12 +20,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 ===========================================================================
 */
 
+#include "quakedef.h"
+
 #include <limits.h>
 #include <pthread.h>
 
 #include <CoreAudio/AudioHardware.h>
 
-#include "quakedef.h"
 #include "snd_main.h"
 
 
index c991516b871c8599c5458c26b96468b697ceea40..bde3d50836e48178e600f95591b7824d3e6e169c 100644 (file)
--- a/snd_oss.c
+++ b/snd_oss.c
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 // OSS module, used by Linux and FreeBSD
 
+#include "quakedef.h"
 
 #include <errno.h>
 #include <fcntl.h>
@@ -27,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <sys/soundcard.h>
 #include <unistd.h>
 
-#include "quakedef.h"
 #include "snd_main.h"
 
 
index bcef10da61f624eeed322fc850dbb7be369f6a4d..64f0dde64c3870c0db6d171ade524a9e70786282 100644 (file)
--- a/snd_sdl.c
+++ b/snd_sdl.c
@@ -16,11 +16,11 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
+#include "quakedef.h"
 
 #include <math.h>
 #include <SDL.h>
 
-#include "quakedef.h"
 #include "snd_main.h"
 
 
diff --git a/svbsp.c b/svbsp.c
index ca6a1cf4dc47e606d572a0c66b51d82871ead170..7dcfffed61e75629e97c5f3654ae85996b712185 100644 (file)
--- a/svbsp.c
+++ b/svbsp.c
@@ -2,6 +2,8 @@
 // Shadow Volume BSP code written by Forest "LordHavoc" Hale on 2003-11-06 and placed into public domain.
 // Modified by LordHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25
 
+#include "quakedef.h"
+
 #include <math.h>
 #include <string.h>
 #include "svbsp.h"
index 5700b21aca1a34d8fcf9e2b5422c4bfba0fa980e..dffc4fda6681cdad0621b4de8cff199a19d0bbd1 100644 (file)
@@ -1,3 +1,5 @@
+#include "quakedef.h"
+
 #include "prvm_cmds.h"
 
 //============================================================================
index 725eecace8dc1b10d9205ef7ab488fa0e24f0b6c..6a876d1b029086fce435cb5e0d1c6027c1ff6833 100644 (file)
@@ -1,3 +1,4 @@
+#include "quakedef.h"
 
 #ifdef WIN32
 #include <io.h>
@@ -10,8 +11,6 @@
 
 #include <signal.h>
 
-#include "quakedef.h"
-
 
 #ifdef WIN32
 cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1", "use windows timeGetTime function (which has issues on some motherboards) for timing rather than QueryPerformanceCounter timer (which has issues on multicore/multiprocessor machines and processors which are designed to conserve power)"};
index c781cfed3cff43f632c862a2e312362ca5887a31..d7ed9179f717e3f73231ba240cd7474897ad81c8 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -1,3 +1,4 @@
+#include "quakedef.h"
 
 #ifdef WIN32
 #include <io.h>
@@ -10,8 +11,6 @@
 
 #include <signal.h>
 
-#include "quakedef.h"
-
 #include <SDL.h>
 
 // =======================================================================
index 944f955901113b829bcec5e693f98f7dd3240f41..5937a167ee4f7ad85ae7f5e3dace0a4830b50917 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -21,6 +21,8 @@
 */
 
 
+#include "quakedef.h"
+
 #include <dlfcn.h>
 #include <signal.h>
 #include <AGL/agl.h>
@@ -30,7 +32,6 @@
 #include <IOKit/hidsystem/IOHIDParameter.h>
 #include <IOKit/hidsystem/event_status_driver.h>
 #include "vid_agl_mackeys.h" // this is SDL/src/video/maccommon/SDL_mackeys.h
-#include "quakedef.h"
 
 #ifndef kCGLCEMPEngine
 #define kCGLCEMPEngine 313
index dd7ad346be76ba67b41d3a285e04c04b285d1c0e..68896def99ebd74095bb2629026ced921ae26548 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
+#include "quakedef.h"
+
 #include <signal.h>
 
 #include <dlfcn.h>
@@ -35,8 +37,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #endif
 #include <X11/extensions/xf86vmode.h>
 
-#include "quakedef.h"
-
 #include "nexuiz.xpm"
 #include "darkplaces.xpm"
 
index 28f92f8cb46bef2fec55c6914db1fc30ca4748c5..48755028ac8facc007677c274fa5a71077675e7e 100644 (file)
@@ -17,9 +17,10 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-#include <signal.h>
 #include "quakedef.h"
 
+#include <signal.h>
+
 int cl_available = false;
 
 qboolean vid_supportrefreshrate = false;
index 39755e526f71ed4df038470ad131e35ed66cdab0..22376f66019de4db68f4c106f44337bd5abdcb8e 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -16,12 +16,12 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
+#include "quakedef.h"
+
 #undef WIN32_LEAN_AND_MEAN  //hush a warning, SDL.h redefines this
 #include <SDL.h>
 #include <stdio.h>
 
-#include "quakedef.h"
-
 // Tell startup code that we have a client
 int cl_available = true;