aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/files.c21
-rw-r--r--code/qcommon/msg.c2
-rw-r--r--code/qcommon/qcommon.h1
-rw-r--r--code/qcommon/unzip.c3
-rw-r--r--code/qcommon/vm_interpreted.c14
5 files changed, 19 insertions, 22 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index 821de07..88df191 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -298,6 +298,11 @@ char lastValidGame[MAX_OSPATH];
FILE* missingFiles = NULL;
#endif
+/* C99 defines __func__ */
+#ifndef __func__
+#define __func__ "(unknown)"
+#endif
+
/*
==============
FS_Initialized
@@ -526,7 +531,7 @@ static void FS_CopyFile( char *fromOSPath, char *toOSPath ) {
Com_Printf( "copy %s to %s\n", fromOSPath, toOSPath );
- FS_FilenameIsExecutable( toOSPath, __FUNCTION__ );
+ FS_FilenameIsExecutable( toOSPath, __func__ );
if (strstr(fromOSPath, "journal.dat") || strstr(fromOSPath, "journaldata.dat")) {
Com_Printf( "Ignoring journal files\n");
@@ -569,7 +574,7 @@ FS_Remove
===========
*/
void FS_Remove( const char *osPath ) {
- FS_FilenameIsExecutable( osPath, __FUNCTION__ );
+ FS_FilenameIsExecutable( osPath, __func__ );
remove( osPath );
}
@@ -581,7 +586,7 @@ FS_HomeRemove
===========
*/
void FS_HomeRemove( const char *homePath ) {
- FS_FilenameIsExecutable( homePath, __FUNCTION__ );
+ FS_FilenameIsExecutable( homePath, __func__ );
remove( FS_BuildOSPath( fs_homepath->string,
fs_gamedir, homePath ) );
@@ -660,7 +665,7 @@ fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) {
Com_Printf( "FS_SV_FOpenFileWrite: %s\n", ospath );
}
- FS_FilenameIsExecutable( ospath, __FUNCTION__ );
+ FS_FilenameIsExecutable( ospath, __func__ );
if( FS_CreatePath( ospath ) ) {
return 0;
@@ -771,7 +776,7 @@ void FS_SV_Rename( const char *from, const char *to ) {
Com_Printf( "FS_SV_Rename: %s --> %s\n", from_ospath, to_ospath );
}
- FS_FilenameIsExecutable( to_ospath, __FUNCTION__ );
+ FS_FilenameIsExecutable( to_ospath, __func__ );
if (rename( from_ospath, to_ospath )) {
// Failed, try copying it and deleting the original
@@ -805,7 +810,7 @@ void FS_Rename( const char *from, const char *to ) {
Com_Printf( "FS_Rename: %s --> %s\n", from_ospath, to_ospath );
}
- FS_FilenameIsExecutable( to_ospath, __FUNCTION__ );
+ FS_FilenameIsExecutable( to_ospath, __func__ );
if (rename( from_ospath, to_ospath )) {
// Failed, try copying it and deleting the original
@@ -868,7 +873,7 @@ fileHandle_t FS_FOpenFileWrite( const char *filename ) {
Com_Printf( "FS_FOpenFileWrite: %s\n", ospath );
}
- FS_FilenameIsExecutable( ospath, __FUNCTION__ );
+ FS_FilenameIsExecutable( ospath, __func__ );
if( FS_CreatePath( ospath ) ) {
return 0;
@@ -916,7 +921,7 @@ fileHandle_t FS_FOpenFileAppend( const char *filename ) {
Com_Printf( "FS_FOpenFileAppend: %s\n", ospath );
}
- FS_FilenameIsExecutable( ospath, __FUNCTION__ );
+ FS_FilenameIsExecutable( ospath, __func__ );
if( FS_CreatePath( ospath ) ) {
return 0;
diff --git a/code/qcommon/msg.c b/code/qcommon/msg.c
index 3840a8c..1fc03eb 100644
--- a/code/qcommon/msg.c
+++ b/code/qcommon/msg.c
@@ -992,8 +992,6 @@ If the delta removes the entity, entityState_t->number will be set to MAX_GENTIT
Can go from either a baseline or a previous packet_entity
==================
*/
-extern cvar_t *cl_shownet;
-
void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
int number) {
int i, lc;
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index 34a9780..72ea617 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -597,7 +597,6 @@ fileHandle_t FS_FOpenFileWrite( const char *qpath );
fileHandle_t FS_FOpenFileAppend( const char *filename );
// will properly create any needed paths and deal with seperater character issues
-int FS_filelength( fileHandle_t f );
fileHandle_t FS_SV_FOpenFileWrite( const char *filename );
int FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp );
void FS_SV_Rename( const char *from, const char *to );
diff --git a/code/qcommon/unzip.c b/code/qcommon/unzip.c
index 7daf271..90f5354 100644
--- a/code/qcommon/unzip.c
+++ b/code/qcommon/unzip.c
@@ -7,7 +7,8 @@
*
*****************************************************************************/
-#include "../client/client.h"
+#include "../qcommon/q_shared.h"
+#include "../qcommon/qcommon.h"
#include "unzip.h"
/* unzip.h -- IO for uncompress .zip files using zlib
diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c
index 897da68..7183e24 100644
--- a/code/qcommon/vm_interpreted.c
+++ b/code/qcommon/vm_interpreted.c
@@ -489,16 +489,10 @@ nextInstruction2:
count = ((srci + count) & dataMask) - srci;
count = ((desti + count) & dataMask) - desti;
- src = (int *)&image[ r0&dataMask ];
- dest = (int *)&image[ r1&dataMask ];
- if ( ( (intptr_t)src | (intptr_t)dest | count ) & 3 ) {
- // happens in westernq3
- Com_Printf( S_COLOR_YELLOW "Warning: OP_BLOCK_COPY not dword aligned\n");
- }
- count >>= 2;
- for ( i = count-1 ; i>= 0 ; i-- ) {
- dest[i] = src[i];
- }
+ src = (int *)&image[ srci ];
+ dest = (int *)&image[ desti ];
+
+ memcpy(dest, src, count);
programCounter += 4;
opStack -= 2;
}