Merge pull request #1475 from jaredmulconry/master

Fixed warning on clang 3.9 caused by static data member in class template
pull/1476/head
Kim Kulling 2017-10-06 15:37:33 +02:00 committed by GitHub
commit c9b9dab1ff
7 changed files with 41 additions and 15 deletions

View File

@ -52,7 +52,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp namespace Assimp
{ {
template< > const std::string LogFunctions< BlenderBMeshConverter >::log_prefix = "BLEND_BMESH: "; template< > const char* LogFunctions< BlenderBMeshConverter >::Prefix()
{
static auto prefix = "BLEND_BMESH: ";
return prefix;
}
} }
using namespace Assimp; using namespace Assimp;

View File

@ -74,7 +74,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif #endif
namespace Assimp { namespace Assimp {
template<> const std::string LogFunctions<BlenderImporter>::log_prefix = "BLEND: "; template<> const char* LogFunctions<BlenderImporter>::Prefix()
{
static auto prefix = "BLEND: ";
return prefix;
}
} }
using namespace Assimp; using namespace Assimp;

View File

@ -59,7 +59,11 @@ static const unsigned int BLEND_TESS_MAGIC = 0x83ed9ac3;
namspace Assimp namspace Assimp
{ {
template< > const std::string LogFunctions< BlenderTessellatorGL >::log_prefix = "BLEND_TESS_GL: "; template< > const char* LogFunctions< BlenderTessellatorGL >::Prefix()
{
static auto prefix = "BLEND_TESS_GL: ";
return prefix;
}
} }
using namespace Assimp; using namespace Assimp;
@ -252,7 +256,11 @@ void BlenderTessellatorGL::TessellateError( GLenum errorCode, void* )
namespace Assimp namespace Assimp
{ {
template< > const std::string LogFunctions< BlenderTessellatorP2T >::log_prefix = "BLEND_TESS_P2T: "; template< > const char* LogFunctions< BlenderTessellatorP2T >::Prefix()
{
static auto prefix = "BLEND_TESS_P2T: ";
return prefix;
}
} }
using namespace Assimp; using namespace Assimp;

View File

@ -59,7 +59,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/importerdesc.h> #include <assimp/importerdesc.h>
namespace Assimp { namespace Assimp {
template<> const std::string LogFunctions<FBXImporter>::log_prefix = "FBX: "; template<> const char* LogFunctions<FBXImporter>::Prefix()
{
static auto prefix = "FBX: ";
return prefix;
}
} }
using namespace Assimp; using namespace Assimp;

View File

@ -66,7 +66,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp { namespace Assimp {
template<> const std::string LogFunctions<IFCImporter>::log_prefix = "IFC: "; template<> const char* LogFunctions<IFCImporter>::Prefix()
{
static auto prefix = "IFC: ";
return prefix;
}
} }
using namespace Assimp; using namespace Assimp;

View File

@ -60,34 +60,34 @@ public:
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static void ThrowException(const std::string& msg) static void ThrowException(const std::string& msg)
{ {
throw DeadlyImportError(log_prefix+msg); throw DeadlyImportError(Prefix()+msg);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static void LogWarn(const Formatter::format& message) { static void LogWarn(const Formatter::format& message) {
if (!DefaultLogger::isNullLogger()) { if (!DefaultLogger::isNullLogger()) {
DefaultLogger::get()->warn(log_prefix+(std::string)message); DefaultLogger::get()->warn(Prefix() +(std::string)message);
} }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static void LogError(const Formatter::format& message) { static void LogError(const Formatter::format& message) {
if (!DefaultLogger::isNullLogger()) { if (!DefaultLogger::isNullLogger()) {
DefaultLogger::get()->error(log_prefix+(std::string)message); DefaultLogger::get()->error(Prefix() +(std::string)message);
} }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static void LogInfo(const Formatter::format& message) { static void LogInfo(const Formatter::format& message) {
if (!DefaultLogger::isNullLogger()) { if (!DefaultLogger::isNullLogger()) {
DefaultLogger::get()->info(log_prefix+(std::string)message); DefaultLogger::get()->info(Prefix() +(std::string)message);
} }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static void LogDebug(const Formatter::format& message) { static void LogDebug(const Formatter::format& message) {
if (!DefaultLogger::isNullLogger()) { if (!DefaultLogger::isNullLogger()) {
DefaultLogger::get()->debug(log_prefix+(std::string)message); DefaultLogger::get()->debug(Prefix() +(std::string)message);
} }
} }
@ -125,8 +125,7 @@ public:
#endif #endif
private: private:
static const char* Prefix();
static const std::string log_prefix;
}; };

View File

@ -83,8 +83,11 @@ struct free_it
}; };
namespace Assimp { // this has to be in here because LogFunctions is in ::Assimp namespace Assimp { // this has to be in here because LogFunctions is in ::Assimp
template<> const std::string LogFunctions<XGLImporter>::log_prefix = "XGL: "; template<> const char* LogFunctions<XGLImporter>::Prefix()
{
static auto prefix = "XGL: ";
return prefix;
}
} }
static const aiImporterDesc desc = { static const aiImporterDesc desc = {