From 27cf81cde7618d199d5697d817b0c35018ef1466 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 27 Jun 2020 19:32:16 +0000 Subject: [PATCH] Attempt to make clang happier. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5713 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/common.h | 2 +- engine/common/gl_q2bsp.c | 4 ++-- engine/common/sys.h | 2 +- fteqtv/parse.c | 4 ++-- fteqtv/qw.c | 2 +- plugins/irc/ircclient.c | 2 +- plugins/models/models.c | 2 +- plugins/plugin.h | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/engine/common/common.h b/engine/common/common.h index 5550d7f6b..3d8d5fd67 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -430,7 +430,7 @@ unsigned int COM_DeQuake(unsigned int unichar); void COM_BiDi_Shutdown(void); //small macro to tell COM_ParseFunString (and related functions like con_printf) that the input is a utf-8 string. -#define U8(s) "^`u8:"s"`=" +#define U8(s) "^`u8:" s "`=" //handles whatever charset is active, including ^U stuff. unsigned int unicode_byteofsfromcharofs(const char *str, unsigned int charofs, qboolean markup); diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 08647e0df..62f69bc29 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -5250,8 +5250,8 @@ int CM_PointContents (model_t *mod, const vec3_t p) if (!mod) // map not loaded return 0; - if (mod->fromgame != fg_quake2 && ((cminfo_t*)mod->meshinfo)->bihnodes) - contents = CM_PointContentsBIH(((cminfo_t*)mod->meshinfo)->bihnodes, p); + if (mod->fromgame != fg_quake2 && prv->bihnodes) //just use leaf contents for q2. its faster and should be robust + contents = CM_PointContentsBIH(prv->bihnodes, p); else { i = CM_PointLeafnum_r (mod, p, mod->hulls[0].firstclipnode); diff --git a/engine/common/sys.h b/engine/common/sys.h index 5e52e50a9..75247afa3 100644 --- a/engine/common/sys.h +++ b/engine/common/sys.h @@ -57,7 +57,7 @@ typedef struct dllfunction_s { void **funcptr; char *name; } dllfunction_t; -typedef void dllhandle_t; //typically used as void* +#define dllhandle_t void extern qboolean sys_nounload; //blocks Sys_CloseLibrary. set before stack trace fatal shutdowns. dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs); void Sys_CloseLibrary(dllhandle_t *lib); diff --git a/fteqtv/parse.c b/fteqtv/parse.c index 0c1b43de2..e87397b80 100644 --- a/fteqtv/parse.c +++ b/fteqtv/parse.c @@ -1673,7 +1673,7 @@ void ParseDownload(sv_t *tv, netmsg_t *m) fclose(tv->downloadfile); tv->downloadfile = NULL; - snprintf(buffer, sizeof(buffer), "%s/%s", (tv->map.gamedir&&*tv->map.gamedir)?tv->map.gamedir:"id1", tv->map.modellist[1].name); + snprintf(buffer, sizeof(buffer), "%s/%s", (*tv->map.gamedir)?tv->map.gamedir:"id1", tv->map.modellist[1].name); rename(tv->downloadname, buffer); Sys_Printf(tv->cluster, "Download complete\n"); @@ -1984,7 +1984,7 @@ void ParseMessage(sv_t *tv, void *buffer, int length, int to, int mask) Sys_Printf(tv->cluster, "Was already downloading %s\nOld download canceled\n", tv->downloadname); tv->downloadfile = NULL; } - snprintf(tv->downloadname, sizeof(tv->downloadname), "%s/%s.tmp", (tv->map.gamedir&&*tv->map.gamedir)?tv->map.gamedir:"id1", tv->map.modellist[1].name); + snprintf(tv->downloadname, sizeof(tv->downloadname), "%s/%s.tmp", (*tv->map.gamedir)?tv->map.gamedir:"id1", tv->map.modellist[1].name); QTV_mkdir(tv->downloadname); tv->downloadfile = fopen(tv->downloadname, "wb"); if (!tv->downloadfile) diff --git a/fteqtv/qw.c b/fteqtv/qw.c index 56419b09e..c3799f480 100644 --- a/fteqtv/qw.c +++ b/fteqtv/qw.c @@ -2938,7 +2938,7 @@ tuiadmin: snprintf(buf, sizeof(buf), "[QuakeTV] %s\n", qtv->server); // Print a short line with info about the server - QW_PrintfToViewer(v, buf); + QW_PrintfToViewer(v, "%s", buf); } else if (!strcmp(command, "stream")) { diff --git a/plugins/irc/ircclient.c b/plugins/irc/ircclient.c index 1824ee3af..1032696bc 100644 --- a/plugins/irc/ircclient.c +++ b/plugins/irc/ircclient.c @@ -2363,7 +2363,7 @@ static int IRC_ClientFrame(ircclient_t *irc) eq = "Corrupted_Message"; str = NULL; } - IRC_Printf(irc, channel, va("Users on channel %s:\n", channel)); + IRC_Printf(irc, channel, "Users on channel %s:\n", channel); while (str) { str = COM_Parse(str, token, sizeof(token)); diff --git a/plugins/models/models.c b/plugins/models/models.c index 3ebf2144c..cea3d8478 100644 --- a/plugins/models/models.c +++ b/plugins/models/models.c @@ -827,7 +827,7 @@ qboolean Mod_ExecuteCommand(qboolean isinsecure) { model_t *mod; cmdfuncs->Argv(1, tok, sizeof(tok)); - mod = modfuncs->GetModel(tok, true); + mod = modfuncs->GetModel(tok, MLV_WARNSYNC); if (!mod || mod->type != mod_alias || !mod->meshinfo) Con_Printf("Couldn't load \"%s\"\n", tok); else diff --git a/plugins/plugin.h b/plugins/plugin.h index 8cf56c3e4..4060c3927 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -182,7 +182,7 @@ struct wstats_s; #define F(t, n, args) t (QDECL *n) args -typedef void dllhandle_t; +#define dllhandle_t void struct dllfunction_s; typedef struct //core stuff {