Fix various warnings

This commit is contained in:
Tim Angus committed 2025-09-07 17:03:20 +01:00
1 parent 549b686e22
commit f976711fb4
58 files changed
+384 -425

No files matched your search

+34 -34
View File
@@ -1260,7 +1260,7 @@ void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patchCollid
qboolean frontFacing[MAX_PATCH_PLANES];
float intersection[MAX_PATCH_PLANES];
float intersect;
const patchPlane_t *planes;
const patchPlane_t *pcPlanes;
const facet_t *facet;
int i, j, k;
float offset;
@@ -1276,11 +1276,11 @@ void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patchCollid
#endif
// determine the trace's relationship to all planes
planes = pc->planes;
for ( i = 0 ; i < pc->numPlanes ; i++, planes++ ) {
offset = DotProduct( tw->offsets[ planes->signbits ], planes->plane );
d1 = DotProduct( tw->start, planes->plane ) - planes->plane[3] + offset;
d2 = DotProduct( tw->end, planes->plane ) - planes->plane[3] + offset;
pcPlanes = pc->planes;
for ( i = 0 ; i < pc->numPlanes ; i++, pcPlanes++ ) {
offset = DotProduct( tw->offsets[ pcPlanes->signbits ], pcPlanes->plane );
d1 = DotProduct( tw->start, pcPlanes->plane ) - pcPlanes->plane[3] + offset;
d2 = DotProduct( tw->end, pcPlanes->plane ) - pcPlanes->plane[3] + offset;
if ( d1 <= 0 ) {
frontFacing[i] = qfalse;
} else {
@@ -1333,20 +1333,20 @@ void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patchCollid
debugFacet = facet;
}
#endif //BSPC
planes = &pc->planes[facet->surfacePlane];
pcPlanes = &pc->planes[facet->surfacePlane];
// calculate intersection with a slight pushoff
offset = DotProduct( tw->offsets[ planes->signbits ], planes->plane );
d1 = DotProduct( tw->start, planes->plane ) - planes->plane[3] + offset;
d2 = DotProduct( tw->end, planes->plane ) - planes->plane[3] + offset;
offset = DotProduct( tw->offsets[ pcPlanes->signbits ], pcPlanes->plane );
d1 = DotProduct( tw->start, pcPlanes->plane ) - pcPlanes->plane[3] + offset;
d2 = DotProduct( tw->end, pcPlanes->plane ) - pcPlanes->plane[3] + offset;
tw->trace.fraction = ( d1 - SURFACE_CLIP_EPSILON ) / ( d1 - d2 );
if ( tw->trace.fraction < 0 ) {
tw->trace.fraction = 0;
}
VectorCopy( planes->plane, tw->trace.plane.normal );
tw->trace.plane.dist = planes->plane[3];
VectorCopy( pcPlanes->plane, tw->trace.plane.normal );
tw->trace.plane.dist = pcPlanes->plane[3];
}
}
}
@@ -1405,7 +1405,7 @@ CM_TraceThroughPatchCollide
void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *pc ) {
int i, j, hit, hitnum;
float offset, enterFrac, leaveFrac, t;
patchPlane_t *planes;
patchPlane_t *pcPlanes;
facet_t *facet;
float plane[4] = {0, 0, 0, 0}, bestplane[4] = {0, 0, 0, 0};
vec3_t startp, endp;
@@ -1429,9 +1429,9 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
leaveFrac = 1.0;
hitnum = -1;
//
planes = &pc->planes[ facet->surfacePlane ];
VectorCopy(planes->plane, plane);
plane[3] = planes->plane[3];
pcPlanes = &pc->planes[ facet->surfacePlane ];
VectorCopy(pcPlanes->plane, plane);
plane[3] = pcPlanes->plane[3];
if ( tw->sphere.use ) {
// adjust the plane distance appropriately for radius
plane[3] += tw->sphere.radius;
@@ -1448,7 +1448,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
}
}
else {
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
offset = DotProduct( tw->offsets[ pcPlanes->signbits ], plane);
plane[3] -= offset;
VectorCopy( tw->start, startp );
VectorCopy( tw->end, endp );
@@ -1462,14 +1462,14 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
}
for ( j = 0; j < facet->numBorders; j++ ) {
planes = &pc->planes[ facet->borderPlanes[j] ];
pcPlanes = &pc->planes[ facet->borderPlanes[j] ];
if (facet->borderInward[j]) {
VectorNegate(planes->plane, plane);
plane[3] = -planes->plane[3];
VectorNegate(pcPlanes->plane, plane);
plane[3] = -pcPlanes->plane[3];
}
else {
VectorCopy(planes->plane, plane);
plane[3] = planes->plane[3];
VectorCopy(pcPlanes->plane, plane);
plane[3] = pcPlanes->plane[3];
}
if ( tw->sphere.use ) {
// adjust the plane distance appropriately for radius
@@ -1488,7 +1488,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
}
else {
// NOTE: this works even though the plane might be flipped because the bbox is centered
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
offset = DotProduct( tw->offsets[ pcPlanes->signbits ], plane);
plane[3] += fabs(offset);
VectorCopy( tw->start, startp );
VectorCopy( tw->end, endp );
@@ -1546,7 +1546,7 @@ CM_PositionTestInPatchCollide
qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchCollide_s *pc ) {
int i, j;
float offset, t;
patchPlane_t *planes;
patchPlane_t *pcPlanes;
facet_t *facet;
float plane[4];
vec3_t startp;
@@ -1557,9 +1557,9 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
//
facet = pc->facets;
for ( i = 0 ; i < pc->numFacets ; i++, facet++ ) {
planes = &pc->planes[ facet->surfacePlane ];
VectorCopy(planes->plane, plane);
plane[3] = planes->plane[3];
pcPlanes = &pc->planes[ facet->surfacePlane ];
VectorCopy(pcPlanes->plane, plane);
plane[3] = pcPlanes->plane[3];
if ( tw->sphere.use ) {
// adjust the plane distance appropriately for radius
plane[3] += tw->sphere.radius;
@@ -1574,7 +1574,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
}
}
else {
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
offset = DotProduct( tw->offsets[ pcPlanes->signbits ], plane);
plane[3] -= offset;
VectorCopy( tw->start, startp );
}
@@ -1584,14 +1584,14 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
}
for ( j = 0; j < facet->numBorders; j++ ) {
planes = &pc->planes[ facet->borderPlanes[j] ];
pcPlanes = &pc->planes[ facet->borderPlanes[j] ];
if (facet->borderInward[j]) {
VectorNegate(planes->plane, plane);
plane[3] = -planes->plane[3];
VectorNegate(pcPlanes->plane, plane);
plane[3] = -pcPlanes->plane[3];
}
else {
VectorCopy(planes->plane, plane);
plane[3] = planes->plane[3];
VectorCopy(pcPlanes->plane, plane);
plane[3] = pcPlanes->plane[3];
}
if ( tw->sphere.use ) {
// adjust the plane distance appropriately for radius
@@ -1608,7 +1608,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
}
else {
// NOTE: this works even though the plane might be flipped because the bbox is centered
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
offset = DotProduct( tw->offsets[ pcPlanes->signbits ], plane);
plane[3] += fabs(offset);
VectorCopy( tw->start, startp );
}
+5 -1
View File
@@ -1410,6 +1410,8 @@ void Com_TouchMemory( void ) {
end = Sys_Milliseconds();
(void)sum; // Suppress warning
Com_Printf( "Com_TouchMemory: %i msec\n", end - start );
}
@@ -1523,6 +1525,8 @@ void Hunk_SmallLog( void) {
#ifdef HUNK_DEBUG
Com_sprintf(buf, sizeof(buf), "size = %8d: %s, line: %d (%s)\r\n", locsize, block->file, block->line, block->label);
FS_Write(buf, strlen(buf), logfile);
#else
(void)locsize; // Suppress warning
#endif
size += block->size;
numBlocks++;
@@ -2574,7 +2578,7 @@ static void Com_DetectAltivec(void)
static qboolean altivec = qfalse;
static qboolean detected = qfalse;
if (!detected) {
altivec = ( Sys_GetProcessorFeatures( ) & CF_ALTIVEC );
altivec = !!( Sys_GetProcessorFeatures( ) & CF_ALTIVEC );
detected = qtrue;
}
+12 -12
View File
@@ -217,12 +217,12 @@ typedef struct fileInPack_s {
} fileInPack_t;
typedef struct {
char pakPathname[MAX_OSPATH]; // c:\quake3\baseq3
char pakPathname[MAX_OSPATH]; // c:\quake3\baseq3
char pakFilename[MAX_OSPATH]; // c:\quake3\baseq3\pak0.pk3
char pakBasename[MAX_OSPATH]; // pak0
char pakGamename[MAX_OSPATH]; // baseq3
unzFile handle; // handle to zip file
int checksum; // regular checksum
unsigned int checksum; // regular checksum
int pure_checksum; // checksum for pure
int numfiles; // number of files in pk3
int referenced; // referenced file flags
@@ -262,7 +262,7 @@ static int fs_loadCount; // total files read
static int fs_loadStack; // total files in memory
static int fs_packFiles = 0; // total number of files in packs
static const cvar_t *fs_pathVars[16];
static cvar_t *fs_pathVars[16];
static int fs_checksumFeed;
@@ -293,15 +293,15 @@ static fileHandleData_t fsh[MAX_FILE_HANDLES];
static qboolean fs_reordered;
// never load anything from pk3 files that are not present at the server when pure
static int fs_numServerPaks = 0;
static int fs_serverPaks[MAX_SEARCH_PATHS]; // checksums
static char *fs_serverPakNames[MAX_SEARCH_PATHS]; // pk3 names
static int fs_numServerPaks = 0;
static unsigned int fs_serverPaks[MAX_SEARCH_PATHS]; // checksums
static char *fs_serverPakNames[MAX_SEARCH_PATHS]; // pk3 names
// only used for autodownload, to make sure the client has at least
// all the pk3 files that are referenced at the server side
static int fs_numServerReferencedPaks;
static int fs_serverReferencedPaks[MAX_SEARCH_PATHS]; // checksums
static char *fs_serverReferencedPakNames[MAX_SEARCH_PATHS]; // pk3 names
static int fs_numServerReferencedPaks;
static unsigned int fs_serverReferencedPaks[MAX_SEARCH_PATHS]; // checksums
static char *fs_serverReferencedPakNames[MAX_SEARCH_PATHS]; // pk3 names
// last valid game folder used
char lastValidBase[MAX_OSPATH];
@@ -1569,8 +1569,6 @@ FS_Seek
=================
*/
int FS_Seek( fileHandle_t f, long offset, int origin ) {
int _origin;
if ( !fs_searchpaths ) {
Com_Error( ERR_FATAL, "Filesystem call made without initialization" );
return -1;
@@ -1638,6 +1636,7 @@ int FS_Seek( fileHandle_t f, long offset, int origin ) {
} else {
FILE *file;
file = FS_FileForHandle(f);
int _origin = SEEK_SET;
switch( origin ) {
case FS_SEEK_CUR:
_origin = SEEK_CUR;
@@ -2064,7 +2063,8 @@ Compares whether the given pak file matches a referenced checksum
qboolean FS_CompareZipChecksum(const char *zipfile)
{
pack_t *thepak;
int index, checksum;
int index;
unsigned int checksum;
thepak = FS_LoadZipFile(zipfile, "");
+4 -4
View File
@@ -56,7 +56,7 @@ to the new value before sending out any replies.
cvar_t *showpackets;
cvar_t *showdrop;
cvar_t *qport;
cvar_t *net_qport;
static char *netsrcString[2] = {
"client",
@@ -73,7 +73,7 @@ void Netchan_Init( int port ) {
port &= 0xffff;
showpackets = Cvar_Get ("showpackets", "0", CVAR_TEMP );
showdrop = Cvar_Get ("showdrop", "0", CVAR_TEMP );
qport = Cvar_Get ("net_qport", va("%i", port), CVAR_INIT );
net_qport = Cvar_Get ("net_qport", va("%i", port), CVAR_INIT );
}
/*
@@ -120,7 +120,7 @@ void Netchan_TransmitNextFragment( netchan_t *chan ) {
// send the qport if we are a client
if ( chan->sock == NS_CLIENT ) {
MSG_WriteShort( &send, qport->integer );
MSG_WriteShort( &send, net_qport->integer );
}
#ifdef LEGACY_PROTOCOL
@@ -202,7 +202,7 @@ void Netchan_Transmit( netchan_t *chan, int length, const byte *data ) {
// send the qport if we are a client
if(chan->sock == NS_CLIENT)
MSG_WriteShort(&send, qport->integer);
MSG_WriteShort(&send, net_qport->integer);
#ifdef LEGACY_PROTOCOL
if(!chan->compat)
+1 -1
View File
@@ -1053,7 +1053,7 @@ void NET_JoinMulticast6(void)
}
}
void NET_LeaveMulticast6()
void NET_LeaveMulticast6(void)
{
if(multicast6_socket != INVALID_SOCKET)
{
+1 -15
View File
@@ -162,21 +162,7 @@ typedef int intptr_t;
#include <time.h>
#include <ctype.h>
#include <limits.h>
#ifdef _MSC_VER
#include <io.h>
typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int8 uint8_t;
#else
#include <stdint.h>
#endif
#include <stdint.h>
#ifdef _WIN32
// vsnprintf is ISO/IEC 9899:1999
+1 -1
View File
@@ -576,7 +576,7 @@ it will attempt to load as a system dll
vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
vmInterpret_t interpret ) {
vm_t *vm;
vmHeader_t *header;
vmHeader_t *header = NULL;
int i, remaining, retval;
char filename[MAX_OSPATH];
void *startSearch = NULL;