common: fix gcc 5.0 issue

Don't use const for variable object

Close issue #560
This commit is contained in:
Gregory Hainaut 2015-05-27 18:20:06 +02:00
parent 93c0d5a268
commit 87bcb465c6
2 changed files with 11 additions and 11 deletions

View File

@ -236,7 +236,7 @@ public:
virtual ~ConsoleAttrScope() throw(); virtual ~ConsoleAttrScope() throw();
}; };
extern const IConsoleWriter Console; extern IConsoleWriter Console;
extern void Console_SetActiveHandler( const IConsoleWriter& writer, FILE* flushfp=NULL ); extern void Console_SetActiveHandler( const IConsoleWriter& writer, FILE* flushfp=NULL );
extern const wxString& ConsoleBuffer_Get(); extern const wxString& ConsoleBuffer_Get();
@ -249,9 +249,9 @@ extern const IConsoleWriter ConsoleWriter_Assert;
extern const IConsoleWriter ConsoleWriter_Buffered; extern const IConsoleWriter ConsoleWriter_Buffered;
extern const IConsoleWriter ConsoleWriter_wxError; extern const IConsoleWriter ConsoleWriter_wxError;
extern const NullConsoleWriter NullCon; extern NullConsoleWriter NullCon;
extern const IConsoleWriter DevConWriter; extern IConsoleWriter DevConWriter;
extern bool DevConWriterEnabled; extern bool DevConWriterEnabled;
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
@ -261,7 +261,7 @@ extern bool DevConWriterEnabled;
#endif #endif
#ifdef PCSX2_DEBUG #ifdef PCSX2_DEBUG
extern const IConsoleWriter DbgConWriter; extern IConsoleWriter DbgConWriter;
# define DbgCon DbgConWriter # define DbgCon DbgConWriter
#else #else
# define DbgCon 0&&NullCon # define DbgCon 0&&NullCon

View File

@ -55,11 +55,11 @@ void Console_SetActiveHandler( const IConsoleWriter& writer, FILE* flushfp )
writer.DoWriteLn( ConsoleBuffer_Get() ); writer.DoWriteLn( ConsoleBuffer_Get() );
} }
const_cast<IConsoleWriter&>(Console) = writer; Console = writer;
const_cast<IConsoleWriter&>(DevConWriter) = writer; DevConWriter = writer;
#ifdef PCSX2_DEBUG #ifdef PCSX2_DEBUG
const_cast<IConsoleWriter&>(DbgCon) = writer; DbgCon = writer;
#endif #endif
} }
@ -597,15 +597,15 @@ ConsoleAttrScope::~ConsoleAttrScope() throw()
// //
#define _DefaultWriter_ ConsoleWriter_Stdout #define _DefaultWriter_ ConsoleWriter_Stdout
const IConsoleWriter Console = _DefaultWriter_; IConsoleWriter Console = _DefaultWriter_;
const IConsoleWriter DevConWriter = _DefaultWriter_; IConsoleWriter DevConWriter = _DefaultWriter_;
bool DevConWriterEnabled = false; bool DevConWriterEnabled = false;
#ifdef PCSX2_DEBUG #ifdef PCSX2_DEBUG
const IConsoleWriter DbgConWriter = _DefaultWriter_; IConsoleWriter DbgConWriter = _DefaultWriter_;
#endif #endif
const NullConsoleWriter NullCon = {}; NullConsoleWriter NullCon = {};
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// ConsoleLogSource (implementations) // ConsoleLogSource (implementations)