don't use macros with variable number of arguments - no version of VC supports it
use existing WARN macro which falls back to printf if LOG isn't yet constructed
This commit is contained in:
@@ -12,8 +12,6 @@
|
||||
#include "RageUtil_FileDB.h"
|
||||
#include <cerrno>
|
||||
|
||||
#define WARN(...) if( LOG ) LOG->Warn( __VA_ARGS__ ); else fprintf( stderr, __VA_ARGS__ )
|
||||
|
||||
static struct FileDriverEntry_ZIP: public FileDriverEntry
|
||||
{
|
||||
FileDriverEntry_ZIP(): FileDriverEntry( "ZIP" ) { }
|
||||
@@ -50,7 +48,7 @@ bool RageFileDriverZip::Load( const RString &sPath )
|
||||
|
||||
if( !pFile->Open(sPath) )
|
||||
{
|
||||
WARN( "Couldn't open %s: %s", sPath.c_str(), pFile->GetError().c_str() );
|
||||
WARN( ssprintf("Couldn't open %s: %s", sPath.c_str(), pFile->GetError().c_str()) );
|
||||
delete pFile;
|
||||
return false;
|
||||
}
|
||||
@@ -87,7 +85,7 @@ bool RageFileDriverZip::ReadEndCentralRecord( int &iTotalEntries, int &iCentralD
|
||||
|
||||
if( sError != "" )
|
||||
{
|
||||
WARN( "%s: %s", m_sPath.c_str(), sError.c_str() );
|
||||
WARN( ssprintf("%s: %s", m_sPath.c_str(), sError.c_str()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,7 +110,7 @@ bool RageFileDriverZip::SeekToEndCentralRecord()
|
||||
int iGot = m_pZip->Read( buf, sizeof(buf) );
|
||||
if( iGot == -1 )
|
||||
{
|
||||
WARN( "%s: %s", m_sPath.c_str(), m_pZip->GetError().c_str() );
|
||||
WARN( ssprintf("%s: %s", m_sPath.c_str(), m_pZip->GetError().c_str()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -133,7 +131,7 @@ bool RageFileDriverZip::ParseZipfile()
|
||||
{
|
||||
if( !SeekToEndCentralRecord() )
|
||||
{
|
||||
WARN( "Couldn't open %s: couldn't find end of central directory record", m_sPath.c_str() );
|
||||
WARN( ssprintf("Couldn't open %s: couldn't find end of central directory record", m_sPath.c_str()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -162,7 +160,7 @@ bool RageFileDriverZip::ParseZipfile()
|
||||
}
|
||||
|
||||
if( m_pFiles.size() == 0 )
|
||||
WARN( "%s: no files found in central file header", m_sPath.c_str() );
|
||||
WARN( ssprintf("%s: no files found in central file header", m_sPath.c_str()) );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -173,7 +171,7 @@ int RageFileDriverZip::ProcessCdirFileHdr( FileInfo &info )
|
||||
RString sSig = FileReading::ReadString( *m_pZip, 4, sError );
|
||||
if( sSig != "\x50\x4B\x01\x02" )
|
||||
{
|
||||
WARN( "%s: central directory record signature not found", m_sPath.c_str() );
|
||||
WARN( ssprintf("%s: central directory record signature not found", m_sPath.c_str()) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -198,7 +196,7 @@ int RageFileDriverZip::ProcessCdirFileHdr( FileInfo &info )
|
||||
/* Check for errors before reading variable-length fields. */
|
||||
if( sError != "" )
|
||||
{
|
||||
WARN( "%s: %s", m_sPath.c_str(), sError.c_str() );
|
||||
WARN( ssprintf("%s: %s", m_sPath.c_str(), sError.c_str()) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -208,7 +206,7 @@ int RageFileDriverZip::ProcessCdirFileHdr( FileInfo &info )
|
||||
|
||||
if( sError != "" )
|
||||
{
|
||||
WARN( "%s: %s", m_sPath.c_str(), sError.c_str() );
|
||||
WARN( ssprintf("%s: %s", m_sPath.c_str(), sError.c_str()) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -216,7 +214,7 @@ int RageFileDriverZip::ProcessCdirFileHdr( FileInfo &info )
|
||||
* file pointer in the middle of a record. */
|
||||
if( iGeneralPurpose & 1 )
|
||||
{
|
||||
WARN( "Skipped encrypted \"%s\" in \"%s\"", info.m_sName.c_str(), m_sPath.c_str() );
|
||||
WARN( ssprintf("Skipped encrypted \"%s\" in \"%s\"", info.m_sName.c_str(), m_sPath.c_str()) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -235,8 +233,8 @@ int RageFileDriverZip::ProcessCdirFileHdr( FileInfo &info )
|
||||
|
||||
if( info.m_iCompressionMethod != STORED && info.m_iCompressionMethod != DEFLATED )
|
||||
{
|
||||
WARN( "File \"%s\" in \"%s\" uses unsupported compression method %i",
|
||||
info.m_sName.c_str(), m_sPath.c_str(), info.m_iCompressionMethod );
|
||||
WARN( ssprintf("File \"%s\" in \"%s\" uses unsupported compression method %i",
|
||||
info.m_sName.c_str(), m_sPath.c_str(), info.m_iCompressionMethod) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -254,13 +252,13 @@ bool RageFileDriverZip::ReadLocalFileHeader( FileInfo &info )
|
||||
|
||||
if( sError != "" )
|
||||
{
|
||||
WARN( "%s: error opening \"%s\": %s", m_sPath.c_str(), info.m_sName.c_str(), sError.c_str() );
|
||||
WARN( ssprintf("%s: error opening \"%s\": %s", m_sPath.c_str(), info.m_sName.c_str(), sError.c_str()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( sSig != "\x50\x4B\x03\x04" )
|
||||
{
|
||||
WARN( "%s: local file header not found for \"%s\"", m_sPath.c_str(), info.m_sName.c_str() );
|
||||
WARN( ssprintf("%s: local file header not found for \"%s\"", m_sPath.c_str(), info.m_sName.c_str()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -272,7 +270,7 @@ bool RageFileDriverZip::ReadLocalFileHeader( FileInfo &info )
|
||||
|
||||
if( sError != "" )
|
||||
{
|
||||
WARN( "%s: %s", m_sPath.c_str(), sError.c_str() );
|
||||
WARN( ssprintf("%s: %s", m_sPath.c_str(), sError.c_str()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user