From 87bcb465c6c2238137dbf99890e9032930a5f6cd Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 27 May 2015 18:20:06 +0200 Subject: [PATCH] common: fix gcc 5.0 issue Don't use const for variable object Close issue #560 --- common/include/Utilities/Console.h | 8 ++++---- common/src/Utilities/Console.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/include/Utilities/Console.h b/common/include/Utilities/Console.h index a4fb75f686..3cec1595c0 100644 --- a/common/include/Utilities/Console.h +++ b/common/include/Utilities/Console.h @@ -236,7 +236,7 @@ public: virtual ~ConsoleAttrScope() throw(); }; -extern const IConsoleWriter Console; +extern IConsoleWriter Console; extern void Console_SetActiveHandler( const IConsoleWriter& writer, FILE* flushfp=NULL ); extern const wxString& ConsoleBuffer_Get(); @@ -249,9 +249,9 @@ extern const IConsoleWriter ConsoleWriter_Assert; extern const IConsoleWriter ConsoleWriter_Buffered; extern const IConsoleWriter ConsoleWriter_wxError; -extern const NullConsoleWriter NullCon; +extern NullConsoleWriter NullCon; -extern const IConsoleWriter DevConWriter; +extern IConsoleWriter DevConWriter; extern bool DevConWriterEnabled; #ifdef PCSX2_DEVBUILD @@ -261,7 +261,7 @@ extern bool DevConWriterEnabled; #endif #ifdef PCSX2_DEBUG -extern const IConsoleWriter DbgConWriter; +extern IConsoleWriter DbgConWriter; # define DbgCon DbgConWriter #else # define DbgCon 0&&NullCon diff --git a/common/src/Utilities/Console.cpp b/common/src/Utilities/Console.cpp index 956a295ae0..3ff0469ca0 100644 --- a/common/src/Utilities/Console.cpp +++ b/common/src/Utilities/Console.cpp @@ -55,11 +55,11 @@ void Console_SetActiveHandler( const IConsoleWriter& writer, FILE* flushfp ) writer.DoWriteLn( ConsoleBuffer_Get() ); } - const_cast(Console) = writer; - const_cast(DevConWriter) = writer; + Console = writer; + DevConWriter = writer; #ifdef PCSX2_DEBUG - const_cast(DbgCon) = writer; + DbgCon = writer; #endif } @@ -597,15 +597,15 @@ ConsoleAttrScope::~ConsoleAttrScope() throw() // #define _DefaultWriter_ ConsoleWriter_Stdout -const IConsoleWriter Console = _DefaultWriter_; -const IConsoleWriter DevConWriter = _DefaultWriter_; +IConsoleWriter Console = _DefaultWriter_; +IConsoleWriter DevConWriter = _DefaultWriter_; bool DevConWriterEnabled = false; #ifdef PCSX2_DEBUG -const IConsoleWriter DbgConWriter = _DefaultWriter_; +IConsoleWriter DbgConWriter = _DefaultWriter_; #endif -const NullConsoleWriter NullCon = {}; +NullConsoleWriter NullCon = {}; // -------------------------------------------------------------------------------------- // ConsoleLogSource (implementations)