From d18aec9b8bda58817cdfa672b03b613a50f0d239 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Fri, 5 May 2017 12:50:47 +0300 Subject: Added OpenGL ES3 support --- base/newtype.hpp | 2 +- base/src_point.cpp | 9 ++---- base/src_point.hpp | 81 ++++++++++++++++++++---------------------------------- 3 files changed, 34 insertions(+), 58 deletions(-) (limited to 'base') diff --git a/base/newtype.hpp b/base/newtype.hpp index f9306c3ae7..f17194e779 100644 --- a/base/newtype.hpp +++ b/base/newtype.hpp @@ -146,7 +146,7 @@ namespace newtype_default_output template string SimpleDebugPrint(NewType const & nt) { - return DebugPrint(nt.Get()); + return ::DebugPrint(nt.Get()); } } // namespace newtype_default_output } // namespace my diff --git a/base/src_point.cpp b/base/src_point.cpp index 663054f229..4230eed080 100644 --- a/base/src_point.cpp +++ b/base/src_point.cpp @@ -3,14 +3,12 @@ #include #include - namespace my { - void SrcPoint::TruncateFileName() { size_t const maxLen = 10000; - char const * p[] = { m_fileName, m_fileName }; + char const * p[] = {m_fileName, m_fileName}; for (size_t i = 0; i < maxLen && m_fileName[i]; ++i) { if (m_fileName[i] == '\\' || m_fileName[i] == '/') @@ -22,9 +20,7 @@ void SrcPoint::TruncateFileName() m_fileName = p[1]; } -} // namespace my - -std::string DebugPrint(my::SrcPoint const & srcPoint) +std::string DebugPrint(SrcPoint const & srcPoint) { std::ostringstream out; if (srcPoint.Line() > 0) @@ -32,3 +28,4 @@ std::string DebugPrint(my::SrcPoint const & srcPoint) << srcPoint.Postfix() << " "; return out.str(); } +} // namespace my diff --git a/base/src_point.hpp b/base/src_point.hpp index 2d46d0af56..4e990cfd73 100644 --- a/base/src_point.hpp +++ b/base/src_point.hpp @@ -2,65 +2,44 @@ #include - #ifndef SRC_LOGGING - #define SRC_LOGGING 1 +#define SRC_LOGGING 1 #endif #if SRC_LOGGING - #ifndef __OBJC__ - #define SRC() my::SrcPoint(__FILE__, __LINE__, __FUNCTION__, "()") - #else - #define SRC() my::SrcPoint(__FILE__, __LINE__, __FUNCTION__) - #endif +#ifndef __OBJC__ +#define SRC() my::SrcPoint(__FILE__, __LINE__, __FUNCTION__, "()") +#else +#define SRC() my::SrcPoint(__FILE__, __LINE__, __FUNCTION__) +#endif #else - #define SRC() my::SrcPoint() +#define SRC() my::SrcPoint() #endif namespace my { - class SrcPoint +class SrcPoint +{ +public: + SrcPoint() : m_fileName(""), m_line(-1), m_function(""), m_postfix("") { TruncateFileName(); } + SrcPoint(char const * fileName, int line, char const * function, char const * postfix = "") + : m_fileName(fileName), m_line(line), m_function(function), m_postfix(postfix) { - public: - SrcPoint() : m_fileName(""), m_line(-1), m_function(""), m_postfix("") - { - TruncateFileName(); - } - - SrcPoint(char const * fileName, int line, char const * function, char const * postfix = "") - : m_fileName(fileName), m_line(line), m_function(function), m_postfix(postfix) - { - TruncateFileName(); - } - - inline char const * FileName() const - { - return m_fileName; - } - - inline int Line() const - { - return m_line; - } - - inline char const * Function() const - { - return m_function; - } - - inline char const * Postfix() const - { - return m_postfix; - } - - private: - void TruncateFileName(); - - char const * m_fileName; - int m_line; - char const * m_function; - char const * m_postfix; - }; + TruncateFileName(); + } + + inline char const * FileName() const { return m_fileName; } + inline int Line() const { return m_line; } + inline char const * Function() const { return m_function; } + inline char const * Postfix() const { return m_postfix; } +private: + void TruncateFileName(); + + char const * m_fileName; + int m_line; + char const * m_function; + char const * m_postfix; +}; + +std::string DebugPrint(SrcPoint const & srcPoint); } - -std::string DebugPrint(my::SrcPoint const & srcPoint); -- cgit v1.2.3