From 2fe13e7a079eb5df30f23b0e4da33d8d8067a9b1 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 5 Jul 2018 10:14:19 +0200 Subject: make GUI compile on MSVC --- 3rdparty/python-console/ParseHelper.h | 4 ++-- 3rdparty/python-console/modified/pyconsole.cc | 2 +- 3rdparty/python-console/modified/pyinterpreter.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to '3rdparty') diff --git a/3rdparty/python-console/ParseHelper.h b/3rdparty/python-console/ParseHelper.h index d01e2627..e0fe9550 100644 --- a/3rdparty/python-console/ParseHelper.h +++ b/3rdparty/python-console/ParseHelper.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include "ParseMessage.h" -class ParseListener; +struct ParseListener; /** Helps chunk lines of Python code into compilable statements. @@ -94,7 +94,7 @@ public: // return if there was an error bool initializeIndent(const std::string& str); }; - friend class BlockParseState; + friend struct BlockParseState; struct BracketParseState : public ParseState { diff --git a/3rdparty/python-console/modified/pyconsole.cc b/3rdparty/python-console/modified/pyconsole.cc index 186d74d2..d724553b 100644 --- a/3rdparty/python-console/modified/pyconsole.cc +++ b/3rdparty/python-console/modified/pyconsole.cc @@ -95,7 +95,7 @@ void PythonConsole::parseEvent( const ParseMessage& message ) } // interpret valid user input - int errorCode; + int errorCode = 0; std::string res; if ( message.message.size() ) res = pyinterpreter_execute( message.message, &errorCode ); diff --git a/3rdparty/python-console/modified/pyinterpreter.cc b/3rdparty/python-console/modified/pyinterpreter.cc index ee8c4aa8..f53207ad 100644 --- a/3rdparty/python-console/modified/pyinterpreter.cc +++ b/3rdparty/python-console/modified/pyinterpreter.cc @@ -38,9 +38,9 @@ static std::list m_suggestions; template std::string string_format(const std::string &format, Args... args) { - size_t size = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0' + size_t size = snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0' std::unique_ptr buf(new char[size]); - std::snprintf(buf.get(), size, format.c_str(), args...); + snprintf(buf.get(), size, format.c_str(), args...); return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside } -- cgit v1.2.3