Attempt to make clang happier.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5713 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-06-27 19:32:16 +00:00
parent 18b2ee695f
commit 27cf81cde7
8 changed files with 10 additions and 10 deletions

View file

@ -430,7 +430,7 @@ unsigned int COM_DeQuake(unsigned int unichar);
void COM_BiDi_Shutdown(void); 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. //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. //handles whatever charset is active, including ^U stuff.
unsigned int unicode_byteofsfromcharofs(const char *str, unsigned int charofs, qboolean markup); unsigned int unicode_byteofsfromcharofs(const char *str, unsigned int charofs, qboolean markup);

View file

@ -5250,8 +5250,8 @@ int CM_PointContents (model_t *mod, const vec3_t p)
if (!mod) // map not loaded if (!mod) // map not loaded
return 0; return 0;
if (mod->fromgame != fg_quake2 && ((cminfo_t*)mod->meshinfo)->bihnodes) if (mod->fromgame != fg_quake2 && prv->bihnodes) //just use leaf contents for q2. its faster and should be robust
contents = CM_PointContentsBIH(((cminfo_t*)mod->meshinfo)->bihnodes, p); contents = CM_PointContentsBIH(prv->bihnodes, p);
else else
{ {
i = CM_PointLeafnum_r (mod, p, mod->hulls[0].firstclipnode); i = CM_PointLeafnum_r (mod, p, mod->hulls[0].firstclipnode);

View file

@ -57,7 +57,7 @@ typedef struct dllfunction_s {
void **funcptr; void **funcptr;
char *name; char *name;
} dllfunction_t; } 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. extern qboolean sys_nounload; //blocks Sys_CloseLibrary. set before stack trace fatal shutdowns.
dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs); dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs);
void Sys_CloseLibrary(dllhandle_t *lib); void Sys_CloseLibrary(dllhandle_t *lib);

View file

@ -1673,7 +1673,7 @@ void ParseDownload(sv_t *tv, netmsg_t *m)
fclose(tv->downloadfile); fclose(tv->downloadfile);
tv->downloadfile = NULL; 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); rename(tv->downloadname, buffer);
Sys_Printf(tv->cluster, "Download complete\n"); 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); Sys_Printf(tv->cluster, "Was already downloading %s\nOld download canceled\n", tv->downloadname);
tv->downloadfile = NULL; 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); QTV_mkdir(tv->downloadname);
tv->downloadfile = fopen(tv->downloadname, "wb"); tv->downloadfile = fopen(tv->downloadname, "wb");
if (!tv->downloadfile) if (!tv->downloadfile)

View file

@ -2938,7 +2938,7 @@ tuiadmin:
snprintf(buf, sizeof(buf), "[QuakeTV] %s\n", qtv->server); snprintf(buf, sizeof(buf), "[QuakeTV] %s\n", qtv->server);
// Print a short line with info about the server // Print a short line with info about the server
QW_PrintfToViewer(v, buf); QW_PrintfToViewer(v, "%s", buf);
} }
else if (!strcmp(command, "stream")) else if (!strcmp(command, "stream"))
{ {

View file

@ -2363,7 +2363,7 @@ static int IRC_ClientFrame(ircclient_t *irc)
eq = "Corrupted_Message"; eq = "Corrupted_Message";
str = NULL; 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) while (str)
{ {
str = COM_Parse(str, token, sizeof(token)); str = COM_Parse(str, token, sizeof(token));

View file

@ -827,7 +827,7 @@ qboolean Mod_ExecuteCommand(qboolean isinsecure)
{ {
model_t *mod; model_t *mod;
cmdfuncs->Argv(1, tok, sizeof(tok)); 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) if (!mod || mod->type != mod_alias || !mod->meshinfo)
Con_Printf("Couldn't load \"%s\"\n", tok); Con_Printf("Couldn't load \"%s\"\n", tok);
else else

View file

@ -182,7 +182,7 @@ struct wstats_s;
#define F(t, n, args) t (QDECL *n) args #define F(t, n, args) t (QDECL *n) args
typedef void dllhandle_t; #define dllhandle_t void
struct dllfunction_s; struct dllfunction_s;
typedef struct //core stuff typedef struct //core stuff
{ {