From 501180aaacd1ef7ef05e978b1bf6af2e07fc9461 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 8 Jun 2005 06:35:48 +0000 Subject: [PATCH] gcc-4.0 fixes. even found some bugs :) (names /not/ mangled this time) --- include/QF/console.h | 2 -- include/QF/plugin/snd_output.h | 4 ++-- include/QF/plugin/snd_render.h | 4 ++-- include/QF/riff.h | 8 +++++--- include/QF/sound.h | 18 ------------------ include/context_x11.h | 2 -- include/netchan.h | 4 ++-- libs/audio/renderer/midi.c | 2 ++ libs/audio/renderer/snd_mix.c | 2 +- libs/audio/renderer/vorbis.c | 3 ++- libs/audio/renderer/wav.c | 3 +-- libs/console/server.c | 4 ++-- libs/gib/gib_classes.c | 9 ++++++--- libs/gib/gib_function.c | 6 ++++-- libs/gib/gib_thread.c | 4 +++- libs/gib/regex.c | 3 ++- libs/net/nm/net_udp.c | 4 ++-- libs/util/info.c | 2 +- libs/util/msg.c | 2 +- libs/util/qfplist.c | 2 +- libs/video/targets/in_x11.c | 4 ++-- libs/video/targets/qfgl_ext.c | 6 +++--- libs/video/targets/vid_common_gl.c | 8 ++++---- libs/video/targets/vid_fbdev.c | 4 ++-- libs/video/targets/vid_svgalib.c | 4 ++-- nq/source/host.c | 2 +- nq/source/host_cmd.c | 2 +- nq/source/sv_main.c | 4 ++-- qw/include/server.h | 2 +- qw/source/cl_chat.c | 16 +++++++++++----- qw/source/cl_demo.c | 2 +- qw/source/cl_main.c | 2 +- qw/source/net_packetlog.c | 6 ++++-- qw/source/pmovetst.c | 2 ++ qw/source/sbar.c | 2 +- qw/source/sv_demo.c | 6 +++--- qw/source/sv_init.c | 2 +- qw/source/sv_pr_qwe.c | 6 +++--- qw/source/sv_send.c | 15 ++++++++------- tools/bsp2img/bsp2img.c | 5 +++-- tools/qfbsp/source/writebsp.c | 2 +- tools/qfcc/include/method.h | 2 -- tools/qflight/source/qflight.c | 2 +- tools/qfvis/source/qfvis.c | 4 ++-- tools/wad/wad.c | 2 +- 45 files changed, 100 insertions(+), 100 deletions(-) diff --git a/include/QF/console.h b/include/QF/console.h index fecc2a0da..bb499cc7f 100644 --- a/include/QF/console.h +++ b/include/QF/console.h @@ -141,6 +141,4 @@ void Menu_KeyEvent (knum_t key, short unicode, qboolean down); void Menu_Enter (void); void Menu_Leave (void); -extern struct cvar_s *con_size; - #endif // __console_h diff --git a/include/QF/plugin/snd_output.h b/include/QF/plugin/snd_output.h index 2c5e8ec71..eca8bc4f1 100644 --- a/include/QF/plugin/snd_output.h +++ b/include/QF/plugin/snd_output.h @@ -51,8 +51,8 @@ typedef struct snd_output_funcs_s { } snd_output_funcs_t; typedef struct snd_output_data_s { - int *soundtime; - int *paintedtime; + unsigned *soundtime; + unsigned *paintedtime; } snd_output_data_t; #endif // __QF_plugin_snd_output_h_ diff --git a/include/QF/plugin/snd_render.h b/include/QF/plugin/snd_render.h index cca755949..4814febe9 100644 --- a/include/QF/plugin/snd_render.h +++ b/include/QF/plugin/snd_render.h @@ -84,8 +84,8 @@ typedef struct snd_render_data_s { double *host_frametime; int *viewentity; - int *soundtime; - int *paintedtime; + unsigned int *soundtime; + unsigned int *paintedtime; struct plugin_s *output; } snd_render_data_t; diff --git a/include/QF/riff.h b/include/QF/riff.h index 2c560332e..989568383 100644 --- a/include/QF/riff.h +++ b/include/QF/riff.h @@ -35,7 +35,7 @@ #include "QF/quakeio.h" typedef struct riff_d_chunk_s { - unsigned char name[4]; + char name[4]; unsigned len; } riff_d_chunk_t; @@ -107,8 +107,10 @@ typedef struct riff_list_s { } riff_list_t; typedef riff_list_t riff_t; // a riff file is one huge list chunk -#define RIFF_SWITCH(name) switch (((name)[0] << 24) | ((name)[1] << 16) \ - | ((name)[2] << 8) | (name)[3]) +#define RIFF_SWITCH(name) switch ((((unsigned char) (name)[0]) << 24) \ + | (((unsigned char) (name)[1]) << 16) \ + | (((unsigned char) (name)[2]) << 8) \ + | ((unsigned char) (name)[3])) #define RIFF_CASE(a,b,c,d) (((unsigned char)(a) << 24) \ | ((unsigned char)(b) << 16) \ | ((unsigned char)(c) << 8) \ diff --git a/include/QF/sound.h b/include/QF/sound.h index c074385e8..abb7129b7 100644 --- a/include/QF/sound.h +++ b/include/QF/sound.h @@ -112,32 +112,14 @@ struct channel_s *S_AllocChannel (void); // number of times S_Update() is called per second. // -extern qboolean fakedma; -extern int fakedma_updates; extern unsigned paintedtime; -extern unsigned soundtime; -extern vec3_t listener_origin; -extern vec3_t listener_forward; -extern vec3_t listener_right; -extern vec3_t listener_up; -extern vec_t sound_nominal_clip_dist; extern struct cvar_s *snd_loadas8bit; -extern struct cvar_s *bgmvolume; extern struct cvar_s *volume; -extern struct cvar_s *snd_mixahead; -extern struct cvar_s *snd_device; -extern struct cvar_s *snd_rate; -extern struct cvar_s *snd_bits; -extern struct cvar_s *snd_stereo; extern struct cvar_s *snd_interp; extern struct cvar_s *snd_stereo_phase_separation; -extern qboolean snd_initialized; - -extern int snd_blocked; - void S_LocalSound (const char *s); void S_AmbientOff (void); diff --git a/include/context_x11.h b/include/context_x11.h index 5ad6158c0..61d379cfb 100644 --- a/include/context_x11.h +++ b/include/context_x11.h @@ -51,12 +51,10 @@ extern Visual *x_vis; extern Window x_root; extern Window x_win; extern XVisualInfo *x_visinfo; -extern vec3_t x_gamma; extern int x_screen; extern int x_shmeventtype; extern Time x_time; extern Time x_mouse_time; -extern qboolean doShm; extern qboolean oktodraw; extern qboolean x_have_focus; diff --git a/include/netchan.h b/include/netchan.h index b389fd5bd..d3e5a5e35 100644 --- a/include/netchan.h +++ b/include/netchan.h @@ -76,8 +76,8 @@ qboolean NET_IsClientLegal(netadr_t *adr); int Net_Log_Init (const char **sound_precache); void Net_LogPrintf (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); -void Log_Incoming_Packet (const char *p, int len, int has_sequence); -void Log_Outgoing_Packet (const char *p, int len, int has_sequence); +void Log_Incoming_Packet (const byte *p, int len, int has_sequence); +void Log_Outgoing_Packet (const byte *p, int len, int has_sequence); void Net_LogStop (void); void Analyze_Client_Packet (const byte * data, int len, int has_sequence); void Analyze_Server_Packet (const byte * data, int len, int has_sequence); diff --git a/libs/audio/renderer/midi.c b/libs/audio/renderer/midi.c index 2fceea09e..3b2b2cc66 100644 --- a/libs/audio/renderer/midi.c +++ b/libs/audio/renderer/midi.c @@ -73,6 +73,8 @@ get_info (void * handle) { wavinfo_t info; struct _WM_Info *wm_info; + memset (&info, 0, sizeof (info)); + if ((wm_info = WildMidi_GetInfo (handle)) == NULL) { Sys_Printf ("Could not obtain midi information\n"); return info; diff --git a/libs/audio/renderer/snd_mix.c b/libs/audio/renderer/snd_mix.c index a249dc8c2..ff687749c 100644 --- a/libs/audio/renderer/snd_mix.c +++ b/libs/audio/renderer/snd_mix.c @@ -268,7 +268,7 @@ snd_paint_mono_8 (int offs, channel_t *ch, void *bytes, unsigned int count) lscale = snd_scaletable[ch->leftvol >> 3]; rscale = snd_scaletable[ch->rightvol >> 3]; - sfx = (signed char *) bytes; + sfx = (unsigned char *) bytes; pair = paintbuffer + offs; diff --git a/libs/audio/renderer/vorbis.c b/libs/audio/renderer/vorbis.c index 220de84c5..efcb52a32 100644 --- a/libs/audio/renderer/vorbis.c +++ b/libs/audio/renderer/vorbis.c @@ -133,7 +133,8 @@ vorbis_read (OggVorbis_File *vf, byte *buf, int len) int current_section; while (len) { - int res = ov_read (vf, buf, len, 0, 2, 1, ¤t_section); + int res = ov_read (vf, (char *) buf, len, 0, 2, 1, + ¤t_section); if (res > 0) { count += res; len -= res; diff --git a/libs/audio/renderer/wav.c b/libs/audio/renderer/wav.c index 0fbed45ff..8b031f726 100644 --- a/libs/audio/renderer/wav.c +++ b/libs/audio/renderer/wav.c @@ -212,8 +212,7 @@ get_info (QFile *file) wavinfo_t info; - - info.rate = 0; + memset (&info, 0, sizeof (info)); if (!(riff = riff_read (file))) { Sys_Printf ("bad riff file\n"); diff --git a/libs/console/server.c b/libs/console/server.c index 59de45c11..99532498f 100644 --- a/libs/console/server.c +++ b/libs/console/server.c @@ -70,7 +70,7 @@ static __attribute__ ((unused)) const char rcsid[] = #include "compat.h" -static console_data_t con_data; +console_data_t con_data; static QFile *log_file; static cvar_t *sv_logfile; @@ -346,7 +346,7 @@ C_Print (const char *fmt, va_list args) dvsprintf (buffer, fmt, args); - txt = buffer->str; + txt = (unsigned char *) buffer->str; if (log_file) { Qputs (log_file, buffer->str); diff --git a/libs/gib/gib_classes.c b/libs/gib/gib_classes.c index 4ae54524f..8be77f73d 100644 --- a/libs/gib/gib_classes.c +++ b/libs/gib/gib_classes.c @@ -192,7 +192,8 @@ Object_Class_Children_f (gib_object_t *obj, gib_method_t *method, void *data, unsigned int size; unsigned int i = 0; - static qboolean + auto qboolean iterator (gib_class_t *class, void *unused); + qboolean iterator (gib_class_t *class, void *unused) { reply[i++] = class->name; @@ -610,13 +611,15 @@ GIB_Classes_Build_Scripted (const char *name, const char *parentname, gib_classdesc_t desc; enum {CLASS, INSTANCE} mode = INSTANCE; - static void + auto void mtabfree (void *mtab, void *unused); + void mtabfree (void *mtab, void *unused) { free (mtab); } - static const char * + auto const char *fname (const char *str); + const char * fname (const char *str) { if (mode == INSTANCE) diff --git a/libs/gib/gib_function.c b/libs/gib/gib_function.c index 76155549b..3c6a39a89 100644 --- a/libs/gib/gib_function.c +++ b/libs/gib/gib_function.c @@ -169,7 +169,8 @@ GIB_Function_Prepare_Args (cbuf_t * cbuf, const char **args, unsigned int gib_var_t *var; static char argss[] = "args"; - static qboolean + auto qboolean iterate (char *arg, llist_node_t *node); + qboolean iterate (char *arg, llist_node_t *node) { var = GIB_Var_Get_Complex (&GIB_DATA(cbuf)->locals, &zero, @@ -207,7 +208,8 @@ GIB_Function_Prepare_Args_D (cbuf_t * cbuf, dstring_t **args, unsigned int gib_var_t *var; static char argss[] = "args"; - static qboolean + auto qboolean iterate (char *arg, llist_node_t *node); + qboolean iterate (char *arg, llist_node_t *node) { var = GIB_Var_Get_Complex (&GIB_DATA(cbuf)->locals, &zero, diff --git a/libs/gib/gib_thread.c b/libs/gib/gib_thread.c index 70b8e546c..ef390b820 100644 --- a/libs/gib/gib_thread.c +++ b/libs/gib/gib_thread.c @@ -89,7 +89,9 @@ GIB_Thread_Count (void) void GIB_Thread_Execute (void) { - static qboolean iterator (cbuf_t *cbuf, llist_node_t *node) + auto qboolean iterator (cbuf_t *cbuf, llist_node_t *node); + qboolean + iterator (cbuf_t *cbuf, llist_node_t *node) { if (GIB_DATA(cbuf)->program) Cbuf_Execute_Stack (cbuf); diff --git a/libs/gib/regex.c b/libs/gib/regex.c index 21d83c2e1..4d49426c8 100644 --- a/libs/gib/regex.c +++ b/libs/gib/regex.c @@ -3839,7 +3839,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) /* Compare that many; failure if mismatch, else move past them. */ if (translate - ? bcmp_translate (d, d2, mcnt, translate) + ? bcmp_translate ((unsigned char *) d, + (unsigned char *) d2, mcnt, translate) : bcmp (d, d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; diff --git a/libs/net/nm/net_udp.c b/libs/net/nm/net_udp.c index 582607240..e366eb3c7 100644 --- a/libs/net/nm/net_udp.c +++ b/libs/net/nm/net_udp.c @@ -364,7 +364,7 @@ UDP_CheckNewConnections (void) int UDP_Read (int socket, byte * buf, int len, struct qsockaddr *addr) { - int addrlen = sizeof (struct qsockaddr); + size_t addrlen = sizeof (struct qsockaddr); int ret; ret = recvfrom (socket, buf, len, 0, (struct sockaddr *) addr, &addrlen); @@ -451,7 +451,7 @@ int UDP_GetSocketAddr (int socket, struct qsockaddr *addr) { unsigned int a; - int addrlen = sizeof (struct qsockaddr); + size_t addrlen = sizeof (struct qsockaddr); memset (addr, 0, sizeof (struct qsockaddr)); diff --git a/libs/util/info.c b/libs/util/info.c index 9e2f056df..8b1a59735 100644 --- a/libs/util/info.c +++ b/libs/util/info.c @@ -142,7 +142,7 @@ Info_SetValueForStarKey (info_t *info, const char *key, const char *value, } if (!(str = strdup (value))) Sys_Error ("Info_SetValueForStarKey: out of memory"); - for (d = s = str; *s; s++) { + for (d = s = (byte *) str; *s; s++) { if (flags & 1) { *s &= 127; if (*s < 32) diff --git a/libs/util/msg.c b/libs/util/msg.c index 5a7b4a1b9..3f9fa38bc 100644 --- a/libs/util/msg.c +++ b/libs/util/msg.c @@ -300,7 +300,7 @@ MSG_ReadString (qmsg_t *msg) return ""; } - string = &msg->message->data[msg->readcount]; + string = (char *) &msg->message->data[msg->readcount]; maxlen = msg->message->cursize - msg->readcount; len = strnlen (string, maxlen); diff --git a/libs/util/qfplist.c b/libs/util/qfplist.c index 34da7248a..54133c543 100644 --- a/libs/util/qfplist.c +++ b/libs/util/qfplist.c @@ -61,7 +61,7 @@ init_quotables (void) "abcdefghijklmnopqrstuvwxyz!#$%&*+-./:?@|~_^"; const byte *c; memset (quotable_bitmap, ~0, sizeof (quotable_bitmap)); - for (c = unquotables; *c; c++) + for (c = (byte *) unquotables; *c; c++) quotable_bitmap[*c / 8] &= ~(1 << (*c % 8)); } diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index f49a828ab..96f46e032 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -188,7 +188,7 @@ enter_notify (XEvent *event) static void XLateKey (XKeyEvent * ev, int *k, int *u) { - unsigned char buffer[4]; + char buffer[4]; int bytes, unicode; int key = 0; KeySym keysym, shifted_keysym; @@ -197,7 +197,7 @@ XLateKey (XKeyEvent * ev, int *k, int *u) keysym = XLookupKeysym (ev, 0); bytes = XLookupString (ev, buffer, sizeof(buffer), &shifted_keysym, &compose); - unicode = buffer[0]; + unicode = (byte) buffer[0]; switch (keysym) { case XK_KP_Page_Up: diff --git a/libs/video/targets/qfgl_ext.c b/libs/video/targets/qfgl_ext.c index f61cd4ed7..6427f1c5f 100644 --- a/libs/video/targets/qfgl_ext.c +++ b/libs/video/targets/qfgl_ext.c @@ -132,7 +132,7 @@ GLF_FindFunctions (void) string. Don't be fooled by sub-strings, etc. */ static qboolean -QFGL_ParseExtensionList (const GLubyte * list, const char *name) +QFGL_ParseExtensionList (const GLubyte *list, const char *name) { const char *start; char *where, *terminator; @@ -141,11 +141,11 @@ QFGL_ParseExtensionList (const GLubyte * list, const char *name) return 0; // Extension names must not have spaces. - where = (GLubyte *) strchr (name, ' '); + where = strchr (name, ' '); if (where || *name == '\0') return 0; - start = list; + start = (const char *) list; for (;;) { where = strstr (start, name); if (!where) diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index 90f342a63..b47101526 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -313,7 +313,7 @@ GL_Common_Init_Cvars (void) static void CheckGLVersionString (void) { - gl_version = qfglGetString (GL_VERSION); + gl_version = (char *) qfglGetString (GL_VERSION); if (sscanf (gl_version, "%d.%d", &gl_major, &gl_minor) == 2) { gl_release_number = 0; if (gl_major >= 1) { @@ -337,11 +337,11 @@ CheckGLVersionString (void) } Con_Printf ("GL_VERSION: %s\n", gl_version); - gl_vendor = qfglGetString (GL_VENDOR); + gl_vendor = (char *) qfglGetString (GL_VENDOR); Con_Printf ("GL_VENDOR: %s\n", gl_vendor); - gl_renderer = qfglGetString (GL_RENDERER); + gl_renderer = (char *) qfglGetString (GL_RENDERER); Con_Printf ("GL_RENDERER: %s\n", gl_renderer); - gl_extensions = qfglGetString (GL_EXTENSIONS); + gl_extensions = (char *) qfglGetString (GL_EXTENSIONS); Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions); if (strstr (gl_renderer, "Mesa DRI Mach64")) diff --git a/libs/video/targets/vid_fbdev.c b/libs/video/targets/vid_fbdev.c index 15b85efcf..400b196ea 100644 --- a/libs/video/targets/vid_fbdev.c +++ b/libs/video/targets/vid_fbdev.c @@ -92,7 +92,7 @@ static int fbdev_backgrounded = 0; static cvar_t *vid_redrawfull; static cvar_t *vid_waitforrefresh; -static char *framebuffer_ptr; +static byte *framebuffer_ptr; static byte backingbuf[48 * 24]; @@ -321,7 +321,7 @@ VID_SetMode (const char *name, unsigned char *palette) smem_start = (unsigned long)fix.smem_start & PAGE_MASK; smem_offset = (unsigned long)fix.smem_start & ~PAGE_MASK; fb_map_length = (smem_offset+fix.smem_len+~PAGE_MASK) & PAGE_MASK; - fb_map_addr = (char *)mmap(0, fb_map_length, PROT_WRITE, MAP_SHARED, + fb_map_addr = mmap(0, fb_map_length, PROT_WRITE, MAP_SHARED, fb_fd, 0); if (!fb_map_addr) Sys_Error ("This mode isn't hapnin'"); diff --git a/libs/video/targets/vid_svgalib.c b/libs/video/targets/vid_svgalib.c index 7ad921a3d..3108c66b5 100644 --- a/libs/video/targets/vid_svgalib.c +++ b/libs/video/targets/vid_svgalib.c @@ -70,7 +70,7 @@ static vga_modeinfo *modes; static byte vid_current_palette[768]; static byte backingbuf[48 * 24]; -static char *framebuffer_ptr; +static byte *framebuffer_ptr; static int svgalib_inited = 0; static int svgalib_backgrounded = 0; @@ -322,7 +322,7 @@ VID_SetMode (int modenum, unsigned char *palette) } VID_SetPalette (palette); - VGA_pagebase = vid.direct = framebuffer_ptr = (char *) vga_getgraphmem (); + VGA_pagebase = vid.direct = framebuffer_ptr = vga_getgraphmem (); #if 0 if (vga_setlinearaddressing () > 0) { framebuffer_ptr = (char *) vga_getgraphmem (); diff --git a/nq/source/host.c b/nq/source/host.c index 888e86730..860382d25 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -446,7 +446,7 @@ SV_DropClient (qboolean crash) void Host_ShutdownServer (qboolean crash) { - char message[4]; + byte message[4]; double start; int count, i; sizebuf_t buf; diff --git a/nq/source/host_cmd.c b/nq/source/host_cmd.c index 03b51ee58..589b42290 100644 --- a/nq/source/host_cmd.c +++ b/nq/source/host_cmd.c @@ -709,7 +709,7 @@ Host_Say (qboolean teamonly) client_t *save; int j; char *p; - unsigned char text[64]; + char text[64]; qboolean fromServer = false; if (cmd_source == src_command) { diff --git a/nq/source/sv_main.c b/nq/source/sv_main.c index 597d1071e..bf803b01b 100644 --- a/nq/source/sv_main.c +++ b/nq/source/sv_main.c @@ -850,7 +850,7 @@ SV_CreateBaseline (void) static void SV_SendReconnect (void) { - char data[128]; + byte data[128]; sizebuf_t msg; msg.data = data; @@ -1012,7 +1012,7 @@ SV_SpawnServer (const char *server) *sv_globals.serverflags = svs.serverflags; *sv_globals.time = sv.time; - if ((buf = QFS_LoadFile (va ("maps/%s.ent", server), 0))) { + if ((buf = (char *) QFS_LoadFile (va ("maps/%s.ent", server), 0))) { ED_LoadFromFile (&sv_pr_state, buf); free (buf); } else { diff --git a/qw/include/server.h b/qw/include/server.h index 698fac90d..2d3c0abb7 100644 --- a/qw/include/server.h +++ b/qw/include/server.h @@ -209,7 +209,7 @@ typedef struct client_s { // back buffers for client reliable data backbuf_t backbuf; - byte stufftext_buf[MAX_STUFFTEXT]; + char stufftext_buf[MAX_STUFFTEXT]; double connection_started; // or time of disconnect for zombies qboolean send_message; // set on frames a datagram arived on diff --git a/qw/source/cl_chat.c b/qw/source/cl_chat.c index 749dbd897..8fe3b142c 100644 --- a/qw/source/cl_chat.c +++ b/qw/source/cl_chat.c @@ -66,7 +66,9 @@ CL_Ignore_Compare (const void *ele, const void *cmp, void *unused) static void CL_Ignore_Sanity_Check (void) { - static qboolean iterator (ignore_t *ig, llist_node_t *node) + auto qboolean iterator (ignore_t *ig, llist_node_t *node); + qboolean + iterator (ignore_t *ig, llist_node_t *node) { if (cl.players[ig->slot].userid != ig->uid) // We got out of sync somehow llist_remove (node); @@ -80,12 +82,14 @@ CL_Ignore_f (void) { CL_Ignore_Sanity_Check (); if (Cmd_Argc () == 1) { - static qboolean live_iterator (ignore_t *ig, llist_node_t *node) + auto qboolean live_iterator (ignore_t *ig, llist_node_t *node); + qboolean live_iterator (ignore_t *ig, llist_node_t *node) { Sys_Printf ("%5i - %s\n", ig->uid, Info_ValueForKey (cl.players[ig->slot].userinfo, "name")); return true; } - static qboolean dead_iterator (ignore_t *ig, llist_node_t *node) + auto qboolean dead_iterator (ignore_t *ig, llist_node_t *node); + qboolean dead_iterator (ignore_t *ig, llist_node_t *node) { Sys_Printf ("%s\n", ig->lastname); return true; @@ -145,7 +149,8 @@ CL_Chat_Allow_Message (const char *str) dstring_t *test = dstring_newstr (); qboolean allowed = true; - static qboolean iterator (ignore_t *ig, llist_node_t *node) + auto qboolean iterator (ignore_t *ig, llist_node_t *node); + qboolean iterator (ignore_t *ig, llist_node_t *node) { if (cl.players[ig->slot].userid != ig->uid) { // We got out of sync somehow llist_remove (node); @@ -183,7 +188,8 @@ CL_Chat_Check_Name (const char *name, int slot) { ignore_t *found = 0; - static qboolean iterator (ignore_t *ig, llist_node_t *node) + auto qboolean iterator (ignore_t *ig, llist_node_t *node); + qboolean iterator (ignore_t *ig, llist_node_t *node) { if (!strcmp (ig->lastname, name)) { found = ig; diff --git a/qw/source/cl_demo.c b/qw/source/cl_demo.c index 7fc3ffe06..1b7a5d39f 100644 --- a/qw/source/cl_demo.c +++ b/qw/source/cl_demo.c @@ -512,7 +512,7 @@ CL_WriteSetDemoMessage (void) void CL_Record (const char *argv1) { - char buf_data[MAX_MSGLEN + 10]; // + 10 for header + byte buf_data[MAX_MSGLEN + 10]; // + 10 for header char name[MAX_OSPATH]; char *s; char timestring[20]; diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 334dd0e88..da8989b68 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -485,7 +485,7 @@ CL_Disconnect (void) CL_Stop_f (); final[0] = clc_stringcmd; - strcpy (final + 1, "drop"); + strcpy ((char *) final + 1, "drop"); Netchan_Transmit (&cls.netchan, 6, final); Netchan_Transmit (&cls.netchan, 6, final); Netchan_Transmit (&cls.netchan, 6, final); diff --git a/qw/source/net_packetlog.c b/qw/source/net_packetlog.c index 2f373f5b7..2332cea75 100644 --- a/qw/source/net_packetlog.c +++ b/qw/source/net_packetlog.c @@ -225,7 +225,7 @@ ascii_dump_buf (unsigned char *buf, int len) } */ void -Log_Incoming_Packet (const char *p, int len, int has_sequence) +Log_Incoming_Packet (const byte *p, int len, int has_sequence) { if (!net_loglevel->int_val) return; @@ -249,7 +249,7 @@ Log_Incoming_Packet (const char *p, int len, int has_sequence) } void -Log_Outgoing_Packet (const char *p, int len, int has_sequence) +Log_Outgoing_Packet (const byte *p, int len, int has_sequence) { if (!net_loglevel->int_val) return; @@ -281,6 +281,8 @@ Log_Delta (int bits) // set everything to the state we are delta'ing from to.number = bits & 511; + to.frame = 0; + to.effects = 0; bits &= ~511; if (bits & U_MOREBITS) { // read in the low order bits diff --git a/qw/source/pmovetst.c b/qw/source/pmovetst.c index 6fb338f6a..0e0eaef89 100644 --- a/qw/source/pmovetst.c +++ b/qw/source/pmovetst.c @@ -228,6 +228,8 @@ PM_PlayerMove (const vec3_t start, const vec3_t end) if (pe->hull) { hull = pe->hull; check_box = 0; + VectorZero (mins); + VectorZero (maxs); } else { check_box = 1; if (pe->model) { diff --git a/qw/source/sbar.c b/qw/source/sbar.c index c878c7845..5dd3944d6 100644 --- a/qw/source/sbar.c +++ b/qw/source/sbar.c @@ -1136,7 +1136,7 @@ Sbar_LogFrags (void) fph = calc_fph (f, total); name = malloc (strlen (s->name) + 1); - for (cp = s->name, d = 0; *cp; cp++, d++) + for (cp = (byte *) s->name, d = 0; *cp; cp++, d++) name[d] = sys_char_map[*cp]; name[d] = 0; diff --git a/qw/source/sv_demo.c b/qw/source/sv_demo.c index 0cb3fe088..6bbaf0b93 100644 --- a/qw/source/sv_demo.c +++ b/qw/source/sv_demo.c @@ -366,7 +366,7 @@ static void SV_Record (char *name) { sizebuf_t buf; - char buf_data[MAX_MSGLEN]; + byte buf_data[MAX_MSGLEN]; int n, i; const char *info; @@ -599,7 +599,7 @@ SV_Record (char *name) */ static char * -SV_CleanName (const unsigned char *name) +SV_CleanName (const char *name) { static char *text; static size_t text_len; @@ -612,7 +612,7 @@ SV_CleanName (const unsigned char *name) out = text; do { - c = sys_char_map[*name++]; + c = sys_char_map[(byte) *name++]; if (c != '_') *out++ = c; } while (c); diff --git a/qw/source/sv_init.c b/qw/source/sv_init.c index 2f91aa824..d6ecdbc8b 100644 --- a/qw/source/sv_init.c +++ b/qw/source/sv_init.c @@ -414,7 +414,7 @@ SV_SpawnServer (const char *server) // load and spawn all other entities *sv_globals.time = sv.time; - if ((buf = QFS_LoadFile (va ("maps/%s.ent", server), 0))) { + if ((buf = (char *) QFS_LoadFile (va ("maps/%s.ent", server), 0))) { ED_LoadFromFile (&sv_pr_state, buf); free (buf); } else { diff --git a/qw/source/sv_pr_qwe.c b/qw/source/sv_pr_qwe.c index a334560f6..d42809d96 100644 --- a/qw/source/sv_pr_qwe.c +++ b/qw/source/sv_pr_qwe.c @@ -229,7 +229,7 @@ PF_str2byte (progs_t * pr) static void PF_str2short (progs_t * pr) { - const unsigned char *str = P_GSTRING (pr, 0); + const byte *str = (byte *) P_GSTRING (pr, 0); R_FLOAT (pr) = (short) ((str[1] << 8) | str[0]); } @@ -429,10 +429,10 @@ PF_strstr (progs_t * pr) } static inline void -clean_text (unsigned char *text) +clean_text (char *text) { while (*text) { - *text = sys_char_map[*text]; + *text = sys_char_map[(byte) *text]; text++; } } diff --git a/qw/source/sv_send.c b/qw/source/sv_send.c index e4a150d6d..cb8b6f250 100644 --- a/qw/source/sv_send.c +++ b/qw/source/sv_send.c @@ -171,7 +171,8 @@ SV_Print (const char *fmt, va_list args) struct tm *local = NULL; qboolean timestamps = false; - unsigned char *in, *out; + char *in; + unsigned char *out; vsnprintf (premsg, sizeof (premsg), fmt, args); in = premsg; @@ -179,7 +180,7 @@ SV_Print (const char *fmt, va_list args) // expand FFnickFF to nick do { - switch (*in) { + switch ((byte) *in) { case 0xFF: { char *end = strchr (in + 1, 0xFF); int userid = 0; @@ -197,7 +198,7 @@ SV_Print (const char *fmt, va_list args) break; } } - len = snprintf (out, sizeof (msg) - (out - msg), + len = snprintf ((char *) out, sizeof (msg) - (out - msg), "%s <%d>", in + 1, userid); out += len; in = end + 1; @@ -210,7 +211,7 @@ SV_Print (const char *fmt, va_list args) *out = '\0'; if (sv_redirected) { // Add to redirected message - dstring_appendstr (&outputbuf, msg); + dstring_appendstr (&outputbuf, (char *) msg); } if (!con_printf_no_log) { // We want to output to console and maybe logfile @@ -242,8 +243,8 @@ SV_Print (const char *fmt, va_list args) static void SV_PrintToClient (client_t *cl, int level, const char *string) { - static unsigned char *buffer; - const unsigned char *a; + static char *buffer; + const char *a; unsigned char *b; int size; static int buffer_size; @@ -260,7 +261,7 @@ SV_PrintToClient (client_t *cl, int level, const char *string) } a = string; - b = buffer; + b = (byte *) buffer; // strip 0xFFs while ((*b = *a++)) if (*b != 0xFF) diff --git a/tools/bsp2img/bsp2img.c b/tools/bsp2img/bsp2img.c index 6c7a0d18e..6766f1d84 100644 --- a/tools/bsp2img/bsp2img.c +++ b/tools/bsp2img/bsp2img.c @@ -586,13 +586,14 @@ render_map (bsp_t *bsp) e1 = &edgelist[abs (ledges[j])]; e2 = &edgelist[abs (ledges[k])]; + //FIXME verify directions if (ledges[j] > 0) { SUB (vertexlist[e1->v[0]], vertexlist[e1->v[1]], v0); - SUB (vertexlist[e2->v[0]], vertexlist[e2->v[1]], v0); + SUB (vertexlist[e2->v[0]], vertexlist[e2->v[1]], v1); } else { /* negative index, therefore walk in reverse order */ SUB (vertexlist[e1->v[1]], vertexlist[e1->v[0]], v0); - SUB (vertexlist[e2->v[1]], vertexlist[e2->v[0]], v0); + SUB (vertexlist[e2->v[1]], vertexlist[e2->v[0]], v1); } /* cross product */ diff --git a/tools/qfbsp/source/writebsp.c b/tools/qfbsp/source/writebsp.c index 95e596bca..a3031ad86 100644 --- a/tools/qfbsp/source/writebsp.c +++ b/tools/qfbsp/source/writebsp.c @@ -460,7 +460,7 @@ WriteMiptex (void) if (!len) l->dataofs[i] = -1; // didn't find the texture } - BSP_AddTextures (bsp, data->str, data->size); + BSP_AddTextures (bsp, (byte *) data->str, data->size); } void diff --git a/tools/qfcc/include/method.h b/tools/qfcc/include/method.h index 3079b390f..8153cc8f4 100644 --- a/tools/qfcc/include/method.h +++ b/tools/qfcc/include/method.h @@ -102,6 +102,4 @@ void clear_selectors (void); struct expr_s *method_check_params (method_t *method, struct expr_s *args); -extern struct hashtab_s *known_methods; - #endif//__method_h diff --git a/tools/qflight/source/qflight.c b/tools/qflight/source/qflight.c index dfe3e446c..ce135a149 100644 --- a/tools/qflight/source/qflight.c +++ b/tools/qflight/source/qflight.c @@ -166,7 +166,7 @@ LightWorld (void) VisStats (); RunThreadsOn (LightThread); - BSP_AddLighting (bsp, lightdata->str, lightdata->size); + BSP_AddLighting (bsp, (byte *) lightdata->str, lightdata->size); if (options.verbosity >= 0) printf ("lightdatasize: %i\n", bsp->lightdatasize); diff --git a/tools/qfvis/source/qfvis.c b/tools/qfvis/source/qfvis.c index 7d6593227..806526b71 100644 --- a/tools/qfvis/source/qfvis.c +++ b/tools/qfvis/source/qfvis.c @@ -393,7 +393,7 @@ ClusterFlow (int clusternum) i = CompressRow (outbuffer, compressed); cluster->visofs = visdata->size; - dstring_append (visdata, compressed, i); + dstring_append (visdata, (char *) compressed, i); } static void @@ -849,7 +849,7 @@ main (int argc, char **argv) printf ("c_chains: %i%s\n", c_chains, options.threads > 1 ? " (not reliable)" :""); - BSP_AddVisibility (bsp, visdata->str, visdata->size); + BSP_AddVisibility (bsp, (byte *) visdata->str, visdata->size); if (options.verbosity >= 0) printf ("visdatasize:%i compressed from %i\n", bsp->visdatasize, originalvismapsize); diff --git a/tools/wad/wad.c b/tools/wad/wad.c index 5611c4881..b1ca88a7c 100644 --- a/tools/wad/wad.c +++ b/tools/wad/wad.c @@ -231,7 +231,7 @@ wad_extract (wad_t *wad, lumpinfo_t *pf) size_t count; int len, i; QFile *file; - char buffer[16384]; + byte buffer[16384]; pcx_t *pcx; qpic_t *qpic; miptex_t *mip;