1
0
Fork 0
forked from fte/fteqw

Misc compile fixes (mostly warnings)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5395 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2019-01-29 19:41:31 +00:00
parent cd97d1fff3
commit 4757bd34c6
12 changed files with 61 additions and 41 deletions

View file

@ -133,7 +133,7 @@ IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
#might as well do this, public builds use the regular Makefile.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-pointer-sign -Wno-unknown-pragmas -Wno-format-zero-length -Wno-strict-aliasing")
ELSE()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
ENDIF()

View file

@ -8320,15 +8320,20 @@ void CL_ShowTrafficUsage(float x, float y)
size_t svccount, i, j=0;
size_t total;
struct sortedsvcs_s sorted[256];
if (cls.protocol == CP_NETQUAKE)
switch(cls.protocol)
{
#ifdef NQPROT
case CP_NETQUAKE:
svcnames = svc_nqstrings;
svccount = countof(svc_nqstrings);
}
else
{
break;
#endif
case CP_QUAKEWORLD:
svcnames = svc_qwstrings;
svccount = countof(svc_qwstrings);
break;
default:
return; //panic!
}
total = 0;
for (i = 0; i < 256; i++)

View file

@ -689,7 +689,7 @@ int SCR_DrawCenterString (vrect_t *rect, cprint_t *p, struct font_s *font)
}
if (rect->width < 32)
return;
return 0;
rect->x += 16;
rect->width -= 32;

View file

@ -175,7 +175,7 @@ cvar_t r_hdr_irisadaptation_fade_up = CVAR ("r_hdr_irisadaptation_fade_up", "0
cvar_t r_loadlits = CVARF ("r_loadlit", "1", CVAR_ARCHIVE);
cvar_t r_menutint = CVARF ("r_menutint", "0.68 0.4 0.13",
CVAR_RENDERERCALLBACK);
cvar_t r_netgraph = CVAR ("r_netgraph", "0");
cvar_t r_netgraph = CVARD ("r_netgraph", "0", "Displays a graph of packet latency. A value of 2 will give additional info about what sort of data is being received from the server.");
extern cvar_t r_lerpmuzzlehack;
cvar_t r_nolerp = CVARF ("r_nolerp", "0", CVAR_ARCHIVE);
cvar_t r_noframegrouplerp = CVARF ("r_noframegrouplerp", "0", CVAR_ARCHIVE);

View file

@ -1134,7 +1134,21 @@ int COM_EncodeSize(vec3_t mins, vec3_t maxs)
return solid;
}
static unsigned int MSG_ReadEntity(void)
#if defined(HAVE_CLIENT) || defined(HAVE_SERVER)
void MSG_WriteEntity(sizebuf_t *sb, unsigned int entnum)
{
if (entnum > MAX_EDICTS)
Host_EndGame("index %#x is not a valid entity\n", entnum);
if (entnum >= 0x8000)
{
MSG_WriteShort(sb, (entnum>>8) | 0x8000);
MSG_WriteByte(sb, entnum & 0xff);
}
else
MSG_WriteShort(sb, entnum);
}
static unsigned int MSG_ReadBigEntity(void)
{
unsigned int num;
num = MSG_ReadShort();
@ -1145,15 +1159,17 @@ static unsigned int MSG_ReadEntity(void)
}
return num;
}
#endif
//we use the high bit of the entity number to state that this is a large entity.
#ifdef HAVE_SERVER
unsigned int MSGSV_ReadEntity(client_t *fromclient)
{
unsigned int num;
if (fromclient->fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
num = MSG_ReadEntity();
num = MSG_ReadBigEntity();
else
num = (unsigned short)(short)MSG_ReadEntity();
num = (unsigned short)(short)MSG_ReadShort();
if (num >= sv.world.max_edicts)
{
Con_Printf("client %s sent invalid entity\n", fromclient->name);
@ -1168,27 +1184,12 @@ unsigned int MSGCL_ReadEntity(void)
{
unsigned int num;
if (cls.fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
num = MSG_ReadEntity();
num = MSG_ReadBigEntity();
else
num = (unsigned short)(short)MSG_ReadShort();
return num;
}
#endif
#if defined(HAVE_CLIENT) || defined(HAVE_SERVER)
void MSG_WriteEntity(sizebuf_t *sb, unsigned int entnum)
{
if (entnum > MAX_EDICTS)
Host_EndGame("index %#x is not a valid entity\n", entnum);
if (entnum >= 0x8000)
{
MSG_WriteShort(sb, (entnum>>8) | 0x8000);
MSG_WriteByte(sb, entnum & 0xff);
}
else
MSG_WriteShort(sb, entnum);
}
#endif
void MSG_WriteDeltaUsercmd (sizebuf_t *buf, usercmd_t *from, usercmd_t *cmd)
{

View file

@ -184,6 +184,8 @@ static int debuggerstacky;
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX)
#include <windows.h>
void INS_UpdateGrabs(int fullscreen, int activeapp);
#else
#include <unistd.h>
#endif
int QCLibEditor(pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, int firststatement, char *error, pbool fatal);

View file

@ -658,9 +658,10 @@ qboolean Sys_rmdir (const char *path)
}
#else
#include <unistd.h>
#include <sys/stat.h>
void FS_CreatePath(const char *pname, enum fs_relative relativeto)
{
mkdir(pname);
mkdir(pname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}
qboolean Sys_rmdir (const char *path)
{

View file

@ -2450,7 +2450,7 @@ char *DecompileValueString(etype_t type, void *val)
char *DecompilePrintParameter(QCC_ddef_t * def)
{
static char line[128];
static char line[256];
static char debug[128];
line[0] = '0';

View file

@ -427,7 +427,7 @@ static void PKG_ParseOutput(struct pkgctx_s *ctx, pbool diff)
}
}
static void PKG_AddOldPack(struct pkgctx_s *ctx, const char *fname)
/*static void PKG_AddOldPack(struct pkgctx_s *ctx, const char *fname)
{
struct oldpack_s *pack;
@ -437,17 +437,17 @@ static void PKG_AddOldPack(struct pkgctx_s *ctx, const char *fname)
pack->file = NULL;
pack->next = ctx->oldpacks;
ctx->oldpacks = pack;
}
}*/
static void PKG_ParseOldPack(struct pkgctx_s *ctx)
{
char token[MAX_OSPATH];
char oldpack[MAX_OSPATH];
if (!PKG_GetStringToken(ctx, token, sizeof(token)))
return;
#ifdef _WIN32
{
char oldpack[MAX_OSPATH];
WIN32_FIND_DATA fd;
HANDLE h;
QCC_Canonicalize(oldpack, sizeof(oldpack), token, ctx->gamepath);
@ -594,7 +594,7 @@ static void PKG_ParseRule(struct pkgctx_s *ctx)
r->next = ctx->rules;
ctx->rules = r;
}
static void PKG_AddClassFile(struct pkgctx_s *ctx, struct class_s *c, const char *fname, time_t mtime)
/*static void PKG_AddClassFile(struct pkgctx_s *ctx, struct class_s *c, const char *fname, time_t mtime)
{
struct file_s *f;
struct tm *t;
@ -614,7 +614,7 @@ static void PKG_AddClassFile(struct pkgctx_s *ctx, struct class_s *c, const char
f->write.dosdate = (t->tm_mday<<0)|(t->tm_mon<<5)|((t->tm_year+1900-1980)<<9);
f->next = c->files;
c->files = f;
}
}*/
static void PKG_AddClassFiles(struct pkgctx_s *ctx, struct class_s *c, const char *fname)
{
#ifdef _WIN32

View file

@ -870,7 +870,9 @@ void PR_LoadGlabalStruct(qboolean muted)
static float writeonly;
static int writeonly_int;
static int endcontentsi, surfaceflagsi;
#ifndef NOLEGACY
static float endcontentsf, surfaceflagsf;
#endif
static float dimension_send_default;
static float dimension_default = 255;
static float zero_default;

View file

@ -208,7 +208,7 @@ static void SVM_RemoveOldServers(void)
}
}
int SVM_AddIPAddresses(sizebuf_t *sb, int first, const char *gamename, int v4, int v6, qboolean prefixes)
int SVM_AddIPAddresses(sizebuf_t *sb, int first, const char *gamename, int v4, int v6, qboolean prefixes, int gametype)
{
int number = 0;
svm_server_t *server;
@ -227,6 +227,9 @@ int SVM_AddIPAddresses(sizebuf_t *sb, int first, const char *gamename, int v4, i
for (; server; server = server->next)
{
//FIXME
// if (gametype != -1 && server->gametype != gametype)
// continue;
switch(server->adr.type)
{
case NA_IP:
@ -246,7 +249,7 @@ int SVM_AddIPAddresses(sizebuf_t *sb, int first, const char *gamename, int v4, i
}
if (prefixes)
MSG_WriteByte(sb, prefixes);
MSG_WriteByte(sb, prefix);
SZ_Write(sb, server->adr.address.ip, len);
MSG_WriteShort(sb, server->adr.port);
@ -308,7 +311,7 @@ vfsfile_t *SVM_GenerateIndex(const char *fname)
f = VFSPIPE_Open(1, false);
VFS_PRINTF(f, "%s", thecss);
VFS_PRINTF(f, "<h1>Single Server Info</h1>\n", tmpbuf);
VFS_PRINTF(f, "<h1>Single Server Info</h1>\n");
VFS_PRINTF(f, "<table border=1>\n");
VFS_PRINTF(f, "<tr><th>Game</th><th>Address</th><th>Hostname</th><th>Mod dir</th><th>Mapname</th><th>Players</th></tr>\n");
@ -476,6 +479,11 @@ void SVM_Think(int port)
gametype = GT_CTF;
else if (!strncmp(com_token, "gametype=", 9))
gametype = atoi(com_token+9);
else
{
char buf[256];
Con_DPrintf("Unknown request filter: %s\n", COM_QuotedString(com_token, buf, sizeof(buf), false));
}
}
svm.total.queries++;
memset(&sb, 0, sizeof(sb));
@ -485,15 +493,16 @@ void SVM_Think(int port)
if (!ipv4 && !ipv6)
ipv4 = ipv6 = true; //neither specified? use both
(void)ver, (void)full, (void)empty;
if (ext)
{ //ipv6 and ipv4 addresses
MSG_WriteString(&sb, "getserversExtResponse");
SVM_AddIPAddresses(&sb, 0, game, ipv4, ipv6, true);
SVM_AddIPAddresses(&sb, 0, game, ipv4, ipv6, true, gametype);
}
else
{ //ipv4 only
MSG_WriteString(&sb, "getserversResponse");
SVM_AddIPAddresses(&sb, 0, game, ipv4, ipv6, true);
SVM_AddIPAddresses(&sb, 0, game, ipv4, ipv6, true, gametype);
}
sb.maxsize+=2;
MSG_WriteByte(&sb, '\\'); //otherwise the last may be considered invalid and ignored.
@ -557,7 +566,7 @@ void SVM_Think(int port)
MSG_WriteLong(&sb, -1);
MSG_WriteString(&sb, "servers\n");
sb.cursize--;
SVM_AddIPAddresses(&sb, 0, "Quake2", true, false, false);
SVM_AddIPAddresses(&sb, 0, "Quake2", true, false, false, -1);
NET_SendPacket(svm_sockets, sb.cursize, sb.data, &net_from);
}
else if (*com_token == S2M_HEARTBEAT) //sequence, players
@ -580,7 +589,7 @@ void SVM_Think(int port)
MSG_WriteLong(&sb, -1);
MSG_WriteByte(&sb, M2C_MASTER_REPLY);
MSG_WriteByte(&sb, '\n');
SVM_AddIPAddresses(&sb, 0, "QuakeWorld", true, false, false);
SVM_AddIPAddresses(&sb, 0, "QuakeWorld", true, false, false, -1);
NET_SendPacket(svm_sockets, sb.cursize, sb.data, &net_from);
}
else if (*com_token == A2A_PING)

View file

@ -1100,7 +1100,7 @@ static void numbered_command(int comm, char *msg, ircclient_t *irc) // move vars
}
case 323: /* RPL_LISTEND*/
{
char *endoflist = casevar[3]+1;
//char *endoflist = casevar[3]+1;
// IRC_Printf(irc, "list", "%s\n",endoflist);