Fix screwed up whitespace in files.c

Apologies to anyone merging this :(
This commit is contained in:
Tim Angus 2013-01-13 22:17:10 +00:00
parent 5fd456ff7c
commit 70b165ee33

View file

@ -450,9 +450,9 @@ long FS_filelength(fileHandle_t f)
h = FS_FileForHandle(f);
if(h == NULL)
return -1;
else
return FS_fplength(h);
return -1;
else
return FS_fplength(h);
}
/*
@ -1057,8 +1057,8 @@ qboolean FS_IsDemoExt(const char *filename, int namelen)
return qtrue;
#ifdef LEGACY_PROTOCOL
if(protocol == com_legacyprotocol->integer)
return qtrue;
if(protocol == com_legacyprotocol->integer)
return qtrue;
#endif
for(index = 0; demo_protocols[index]; index++)
@ -1103,8 +1103,8 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
// be prepended, so we don't need to worry about "c:" or "//limbo"
if(strstr(filename, ".." ) || strstr(filename, "::"))
{
if(file == NULL)
return qfalse;
if(file == NULL)
return qfalse;
*file = 0;
return -1;
@ -1114,8 +1114,8 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
// any other time the key should only be accessed in memory using the provided functions
if(com_fullyInitialized && strstr(filename, "q3key"))
{
if(file == NULL)
return qfalse;
if(file == NULL)
return qfalse;
*file = 0;
return -1;
@ -1130,8 +1130,8 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
{
hash = FS_HashFileName(filename, search->pack->hashSize);
if(search->pack->hashTable[hash])
{
if(search->pack->hashTable[hash])
{
// look through all the pak file elements
pak = search->pack;
pakFile = pak->hashTable[hash];
@ -1143,14 +1143,14 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
{
// found it!
if(pakFile->len)
return pakFile->len;
else
{
// It's not nice, but legacy code depends
// on positive value if file exists no matter
// what size
return 1;
}
return pakFile->len;
else
{
// It's not nice, but legacy code depends
// on positive value if file exists no matter
// what size
return 1;
}
}
pakFile = pakFile->next;
@ -1166,13 +1166,13 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
if(filep)
{
len = FS_fplength(filep);
len = FS_fplength(filep);
fclose(filep);
if(len)
return len;
else
return 1;
return len;
else
return 1;
}
}
@ -1258,7 +1258,7 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
if(fs_debug->integer)
{
Com_Printf("FS_FOpenFileRead: %s (found in '%s')\n",
filename, pak->pakFilename);
filename, pak->pakFilename);
}
return pakFile->len;
@ -1301,7 +1301,7 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
if (filep == NULL)
{
*file = 0;
return -1;
return -1;
}
Q_strncpyz(fsh[*file].name, filename, sizeof(fsh[*file].name));
@ -1310,7 +1310,7 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
if(fs_debug->integer)
{
Com_Printf("FS_FOpenFileRead: %s (found in '%s/%s')\n", filename,
dir->path, dir->gamedir);
dir->path, dir->gamedir);
}
fsh[*file].handleFiles.file.o = filep;
@ -1340,18 +1340,18 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF
for(search = fs_searchpaths; search; search = search->next)
{
len = FS_FOpenFileReadDir(filename, search, file, uniqueFILE, qfalse);
len = FS_FOpenFileReadDir(filename, search, file, uniqueFILE, qfalse);
if(file == NULL)
{
if(len > 0)
return len;
}
else
{
if(len >= 0 && *file)
return len;
}
if(file == NULL)
{
if(len > 0)
return len;
}
else
{
if(len >= 0 && *file)
return len;
}
}
@ -1441,17 +1441,17 @@ vmInterpret_t FS_FindVM(void **startSearch, char *found, int foundlen, const cha
{
pack = search->pack;
if(lastSearch && lastSearch->pack)
{
// make sure we only try loading one VM file per game dir
// i.e. if VM from pak7.pk3 fails we won't try one from pak6.pk3
if(lastSearch && lastSearch->pack)
{
// make sure we only try loading one VM file per game dir
// i.e. if VM from pak7.pk3 fails we won't try one from pak6.pk3
if(!FS_FilenameCompare(lastSearch->pack->pakPathname, pack->pakPathname))
{
search = search->next;
continue;
}
}
if(!FS_FilenameCompare(lastSearch->pack->pakPathname, pack->pakPathname))
{
search = search->next;
continue;
}
}
if(FS_FOpenFileReadDir(qvmName, search, NULL, qfalse, qfalse) > 0)
{
@ -1621,7 +1621,7 @@ int FS_Seek( fileHandle_t f, long offset, int origin ) {
if (fsh[f].streamed) {
fsh[f].streamed = qfalse;
FS_Seek( f, offset, origin );
FS_Seek( f, offset, origin );
fsh[f].streamed = qtrue;
}
@ -1827,7 +1827,7 @@ long FS_ReadFileDir(const char *qpath, void *searchPath, qboolean unpure, void *
{
// look for it in the filesystem or pack files
len = FS_FOpenFileRead(qpath, &h, qfalse);
}
}
else
{
// look for it in a specific search path only
@ -2253,7 +2253,7 @@ char **FS_ListFilteredFiles( const char *path, const char *extension, char *filt
temp = pathLength;
if (pathLength) {
temp++; // include the '/'
temp++; // include the '/'
}
nfiles = FS_AddFileToList( name + temp, list, nfiles );
}
@ -2266,8 +2266,8 @@ char **FS_ListFilteredFiles( const char *path, const char *extension, char *filt
// don't scan directories for files if we are pure or restricted
if ( fs_numServerPaks && !allowNonPureFilesOnDisk ) {
continue;
} else {
continue;
} else {
netpath = FS_BuildOSPath( search->dir->path, search->dir->gamedir, path );
sysFiles = Sys_ListFiles( netpath, extension, filter, &numSysFiles, qfalse );
for ( i = 0 ; i < numSysFiles ; i++ ) {
@ -2969,9 +2969,9 @@ qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
// never autodownload any of the id paks
if(FS_idPak(fs_serverReferencedPakNames[i], BASEGAME, NUM_ID_PAKS)
#ifndef STANDALONE
|| FS_idPak(fs_serverReferencedPakNames[i], BASETA, NUM_TA_PAKS)
|| FS_idPak(fs_serverReferencedPakNames[i], BASETA, NUM_TA_PAKS)
#endif
)
)
{
continue;
}
@ -3172,12 +3172,12 @@ static void FS_Startup( const char *gameName )
}
// fs_homepath is somewhat particular to *nix systems, only add if relevant
#ifdef MACOS_X
#ifdef MACOS_X
fs_apppath = Cvar_Get ("fs_apppath", Sys_DefaultAppPath(), CVAR_INIT|CVAR_PROTECTED );
// Make MacOSX also include the base path included with the .app bundle
if (fs_apppath->string[0])
FS_AddGameDirectory(fs_apppath->string, gameName);
#endif
#endif
// NOTE: same filtering below for mods and basegame
if (fs_homepath->string[0] && Q_stricmp(fs_homepath->string,fs_basepath->string)) {
@ -3274,54 +3274,54 @@ static void FS_CheckPak0( void )
curpack = path->pack;
if(!Q_stricmpn( curpack->pakGamename, "demoq3", MAX_OSPATH )
&& !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH ))
&& !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH ))
{
if(curpack->checksum == DEMO_PAK0_CHECKSUM)
founddemo = qtrue;
}
else if(!Q_stricmpn( curpack->pakGamename, BASEGAME, MAX_OSPATH )
&& strlen(pakBasename) == 4 && !Q_stricmpn( pakBasename, "pak", 3 )
&& pakBasename[3] >= '0' && pakBasename[3] <= '0' + NUM_ID_PAKS - 1)
&& strlen(pakBasename) == 4 && !Q_stricmpn( pakBasename, "pak", 3 )
&& pakBasename[3] >= '0' && pakBasename[3] <= '0' + NUM_ID_PAKS - 1)
{
if( curpack->checksum != pak_checksums[pakBasename[3]-'0'] )
{
if(pakBasename[3] == '0')
{
Com_Printf("\n\n"
"**************************************************\n"
"WARNING: " BASEGAME "/pak0.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-copy pak0.pk3 from your\n"
"legitimate Q3 CDROM.\n"
"**************************************************\n\n\n",
curpack->checksum );
"**************************************************\n"
"WARNING: " BASEGAME "/pak0.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-copy pak0.pk3 from your\n"
"legitimate Q3 CDROM.\n"
"**************************************************\n\n\n",
curpack->checksum );
}
else
{
Com_Printf("\n\n"
"**************************************************\n"
"WARNING: " BASEGAME "/pak%d.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-install the point release\n"
"**************************************************\n\n\n",
pakBasename[3]-'0', curpack->checksum );
"**************************************************\n"
"WARNING: " BASEGAME "/pak%d.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-install the point release\n"
"**************************************************\n\n\n",
pakBasename[3]-'0', curpack->checksum );
}
}
foundPak |= 1<<(pakBasename[3]-'0');
}
else if(!Q_stricmpn(curpack->pakGamename, BASETA, MAX_OSPATH)
&& strlen(pakBasename) == 4 && !Q_stricmpn(pakBasename, "pak", 3)
&& pakBasename[3] >= '0' && pakBasename[3] <= '0' + NUM_TA_PAKS - 1)
&& strlen(pakBasename) == 4 && !Q_stricmpn(pakBasename, "pak", 3)
&& pakBasename[3] >= '0' && pakBasename[3] <= '0' + NUM_TA_PAKS - 1)
{
if(curpack->checksum != missionpak_checksums[pakBasename[3]-'0'])
{
Com_Printf("\n\n"
"**************************************************\n"
"WARNING: " BASETA "/pak%d.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-install Team Arena\n"
"**************************************************\n\n\n",
pakBasename[3]-'0', curpack->checksum );
"**************************************************\n"
"WARNING: " BASETA "/pak%d.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-install Team Arena\n"
"**************************************************\n\n\n",
pakBasename[3]-'0', curpack->checksum );
}
foundTA |= 1 << (pakBasename[3]-'0');
@ -3338,12 +3338,12 @@ static void FS_CheckPak0( void )
if(curpack->checksum == pak_checksums[index])
{
Com_Printf("\n\n"
"**************************************************\n"
"WARNING: %s is renamed pak file %s%cpak%d.pk3\n"
"Running in standalone mode won't work\n"
"Please rename, or remove this file\n"
"**************************************************\n\n\n",
curpack->pakFilename, BASEGAME, PATH_SEP, index);
"**************************************************\n"
"WARNING: %s is renamed pak file %s%cpak%d.pk3\n"
"Running in standalone mode won't work\n"
"Please rename, or remove this file\n"
"**************************************************\n\n\n",
curpack->pakFilename, BASEGAME, PATH_SEP, index);
foundPak |= 0x80000000;
@ -3355,12 +3355,12 @@ static void FS_CheckPak0( void )
if(curpack->checksum == missionpak_checksums[index])
{
Com_Printf("\n\n"
"**************************************************\n"
"WARNING: %s is renamed pak file %s%cpak%d.pk3\n"
"Running in standalone mode won't work\n"
"Please rename, or remove this file\n"
"**************************************************\n\n\n",
curpack->pakFilename, BASETA, PATH_SEP, index);
"**************************************************\n"
"WARNING: %s is renamed pak file %s%cpak%d.pk3\n"
"Running in standalone mode won't work\n"
"Please rename, or remove this file\n"
"**************************************************\n\n\n",
curpack->pakFilename, BASETA, PATH_SEP, index);
foundTA |= 0x80000000;
}
@ -3401,21 +3401,21 @@ static void FS_CheckPak0( void )
if((foundPak & 0x01) != 0x01)
{
Q_strcat(errorText, sizeof(errorText),
"\"pak0.pk3\" is missing. Please copy it "
"from your legitimate Q3 CDROM. ");
"\"pak0.pk3\" is missing. Please copy it "
"from your legitimate Q3 CDROM. ");
}
if((foundPak & 0x1fe) != 0x1fe)
{
Q_strcat(errorText, sizeof(errorText),
"Point Release files are missing. Please "
"re-install the 1.32 point release. ");
"Point Release files are missing. Please "
"re-install the 1.32 point release. ");
}
Q_strcat(errorText, sizeof(errorText),
va("Also check that your ioq3 executable is in "
"the correct place and that every file "
"in the \"%s\" directory is present and readable", BASEGAME));
va("Also check that your ioq3 executable is in "
"the correct place and that every file "
"in the \"%s\" directory is present and readable", BASEGAME));
Com_Error(ERR_FATAL, "%s", errorText);
}
@ -3427,15 +3427,15 @@ static void FS_CheckPak0( void )
if((foundTA & 0x01) != 0x01)
{
Com_sprintf(errorText, sizeof(errorText),
"\"" BASETA "%cpak0.pk3\" is missing. Please copy it "
"from your legitimate Quake 3 Team Arena CDROM. ", PATH_SEP);
"\"" BASETA "%cpak0.pk3\" is missing. Please copy it "
"from your legitimate Quake 3 Team Arena CDROM. ", PATH_SEP);
}
if((foundTA & 0x0e) != 0x0e)
{
Q_strcat(errorText, sizeof(errorText),
"Team Arena Point Release files are missing. Please "
"re-install the latest Team Arena point release.");
"Team Arena Point Release files are missing. Please "
"re-install the latest Team Arena point release.");
}
Com_Error(ERR_FATAL, "%s", errorText);
@ -3870,8 +3870,8 @@ qboolean FS_ConditionalRestart(int checksumFeed, qboolean disconnect)
if(fs_gamedirvar->modified)
{
if(FS_FilenameCompare(lastValidGame, fs_gamedirvar->string) &&
(*lastValidGame || FS_FilenameCompare(fs_gamedirvar->string, com_basegame->string)) &&
(*fs_gamedirvar->string || FS_FilenameCompare(lastValidGame, com_basegame->string)))
(*lastValidGame || FS_FilenameCompare(fs_gamedirvar->string, com_basegame->string)) &&
(*fs_gamedirvar->string || FS_FilenameCompare(lastValidGame, com_basegame->string)))
{
Com_GameRestart(checksumFeed, disconnect);
return qtrue;
@ -3903,28 +3903,28 @@ int FS_FOpenFileByMode( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
sync = qfalse;
switch( mode ) {
case FS_READ:
r = FS_FOpenFileRead( qpath, f, qtrue );
break;
case FS_WRITE:
*f = FS_FOpenFileWrite( qpath );
r = 0;
if (*f == 0) {
r = -1;
}
break;
case FS_APPEND_SYNC:
sync = qtrue;
case FS_APPEND:
*f = FS_FOpenFileAppend( qpath );
r = 0;
if (*f == 0) {
r = -1;
}
break;
default:
Com_Error( ERR_FATAL, "FS_FOpenFileByMode: bad mode" );
return -1;
case FS_READ:
r = FS_FOpenFileRead( qpath, f, qtrue );
break;
case FS_WRITE:
*f = FS_FOpenFileWrite( qpath );
r = 0;
if (*f == 0) {
r = -1;
}
break;
case FS_APPEND_SYNC:
sync = qtrue;
case FS_APPEND:
*f = FS_FOpenFileAppend( qpath );
r = 0;
if (*f == 0) {
r = -1;
}
break;
default:
Com_Error( ERR_FATAL, "FS_FOpenFileByMode: bad mode" );
return -1;
}
if (!f) {