[ioquake3] 09/136: Remove FS_Read2().
Simon McVittie
smcv at debian.org
Thu Jun 15 09:08:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository ioquake3.
commit d4e1a01f33cde5566b636f461de06b1df9657e25
Author: SmileTheory <SmileTheory at gmail.com>
Date: Fri Mar 17 04:21:11 2017 -0700
Remove FS_Read2().
Functionally the same as FS_Read().
Streaming functionality was removed in https://github.com/ioquake/ioq3/commit/672cfbf16f83fb67f6ce9bb1d3571dc32a5b3083 but flag remained.
---
code/client/cl_cgame.c | 2 +-
code/client/cl_ui.c | 2 +-
code/qcommon/files.c | 33 ---------------------------------
code/qcommon/md5.c | 2 +-
code/qcommon/qcommon.h | 1 -
code/server/sv_bot.c | 2 +-
code/server/sv_game.c | 2 +-
7 files changed, 5 insertions(+), 39 deletions(-)
diff --git a/code/client/cl_cgame.c b/code/client/cl_cgame.c
index d69ae75..157c7bd 100644
--- a/code/client/cl_cgame.c
+++ b/code/client/cl_cgame.c
@@ -440,7 +440,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case CG_FS_READ:
- FS_Read2( VMA(1), args[2], args[3] );
+ FS_Read( VMA(1), args[2], args[3] );
return 0;
case CG_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
diff --git a/code/client/cl_ui.c b/code/client/cl_ui.c
index 67ec918..f3fca92 100644
--- a/code/client/cl_ui.c
+++ b/code/client/cl_ui.c
@@ -780,7 +780,7 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case UI_FS_READ:
- FS_Read2( VMA(1), args[2], args[3] );
+ FS_Read( VMA(1), args[2], args[3] );
return 0;
case UI_FS_WRITE:
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index 27f5713..e4d22d3 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -280,7 +280,6 @@ typedef struct {
int zipFilePos;
int zipFileLen;
qboolean zipFile;
- qboolean streamed;
char name[MAX_ZPATH];
} fileHandleData_t;
@@ -1510,25 +1509,6 @@ FS_Read
Properly handles partial reads
=================
*/
-int FS_Read2( void *buffer, int len, fileHandle_t f ) {
- if ( !fs_searchpaths ) {
- Com_Error( ERR_FATAL, "Filesystem call made without initialization" );
- }
-
- if ( !f ) {
- return 0;
- }
- if (fsh[f].streamed) {
- int r;
- fsh[f].streamed = qfalse;
- r = FS_Read( buffer, len, f );
- fsh[f].streamed = qtrue;
- return r;
- } else {
- return FS_Read( buffer, len, f);
- }
-}
-
int FS_Read( void *buffer, int len, fileHandle_t f ) {
int block, remaining;
int read;
@@ -1655,14 +1635,6 @@ int FS_Seek( fileHandle_t f, long offset, int origin ) {
return -1;
}
- if (fsh[f].streamed) {
- int r;
- fsh[f].streamed = qfalse;
- r = FS_Seek( f, offset, origin );
- fsh[f].streamed = qtrue;
- return r;
- }
-
if (fsh[f].zipFile == qtrue) {
//FIXME: this is really, really crappy
//(but better than what was here before)
@@ -4119,11 +4091,6 @@ int FS_FOpenFileByMode( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
if ( *f ) {
fsh[*f].fileSize = r;
- fsh[*f].streamed = qfalse;
-
- if (mode == FS_READ) {
- fsh[*f].streamed = qtrue;
- }
}
fsh[*f].handleSync = sync;
diff --git a/code/qcommon/md5.c b/code/qcommon/md5.c
index d47560e..cee93a3 100644
--- a/code/qcommon/md5.c
+++ b/code/qcommon/md5.c
@@ -290,7 +290,7 @@ char *Com_MD5File( const char *fn, int length, const char *prefix, int prefix_le
MD5Update(&md5 , (unsigned char *)prefix, prefix_len);
for(;;) {
- r = FS_Read2(buffer, sizeof(buffer), f);
+ r = FS_Read(buffer, sizeof(buffer), f);
if(r < 1)
break;
if(r + total > length)
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index f8cd035..feeca18 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -659,7 +659,6 @@ int FS_FileIsInPAK(const char *filename, int *pChecksum );
int FS_Write( const void *buffer, int len, fileHandle_t f );
-int FS_Read2( void *buffer, int len, fileHandle_t f );
int FS_Read( void *buffer, int len, fileHandle_t f );
// properly handles partial reads and reads from other dlls
diff --git a/code/server/sv_bot.c b/code/server/sv_bot.c
index d92dfca..5850354 100644
--- a/code/server/sv_bot.c
+++ b/code/server/sv_bot.c
@@ -543,7 +543,7 @@ void SV_BotInitBotLib(void) {
// file system access
botlib_import.FS_FOpenFile = FS_FOpenFileByMode;
- botlib_import.FS_Read = FS_Read2;
+ botlib_import.FS_Read = FS_Read;
botlib_import.FS_Write = FS_Write;
botlib_import.FS_FCloseFile = FS_FCloseFile;
botlib_import.FS_Seek = FS_Seek;
diff --git a/code/server/sv_game.c b/code/server/sv_game.c
index ebfa726..81f4793 100644
--- a/code/server/sv_game.c
+++ b/code/server/sv_game.c
@@ -325,7 +325,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
case G_FS_FOPEN_FILE:
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case G_FS_READ:
- FS_Read2( VMA(1), args[2], args[3] );
+ FS_Read( VMA(1), args[2], args[3] );
return 0;
case G_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list