From 22f7f60ba0e690d571af5729ac1d1e497072b9db Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 27 Dec 2015 20:36:54 +0100 Subject: [PATCH] glTF: usage of (hopefully) correct data type for size types: closes https://github.com/assimp/assimp/issues/723 --- code/ObjFileMtlImporter.cpp | 5 ++--- contrib/rapidjson/include/rapidjson/document.h | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/code/ObjFileMtlImporter.cpp b/code/ObjFileMtlImporter.cpp index 8079dad28..a07cfed61 100644 --- a/code/ObjFileMtlImporter.cpp +++ b/code/ObjFileMtlImporter.cpp @@ -378,11 +378,10 @@ void ObjFileMtlImporter::getTexture() { * Because aiMaterial supports clamp option, so we also want to return it * ///////////////////////////////////////////////////////////////////////////// */ -void ObjFileMtlImporter::getTextureOption(bool &clamp, int &clampIndex, aiString *&out) -{ +void ObjFileMtlImporter::getTextureOption(bool &clamp, int &clampIndex, aiString *&out) { m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - //If there is any more texture option + // If there is any more texture option while (!isEndOfBuffer(m_DataIt, m_DataItEnd) && *m_DataIt == '-') { const char *pPtr( &(*m_DataIt) ); diff --git a/contrib/rapidjson/include/rapidjson/document.h b/contrib/rapidjson/include/rapidjson/document.h index e90d6a391..f92a2a70b 100644 --- a/contrib/rapidjson/include/rapidjson/document.h +++ b/contrib/rapidjson/include/rapidjson/document.h @@ -513,12 +513,19 @@ public: flags_ |= kUintFlag | kUint64Flag; } + //! Constructor for size_t value. + explicit GenericValue( size_t u ) RAPIDJSON_NOEXCEPT : data_(), flags_( kNumberUintFlag ) { + data_.n.u64 = u; + if ( !( u&0x80000000 ) ) + flags_ |= kIntFlag|kInt64Flag; + } + //! Constructor for unsigned value. - explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUintFlag) { +/* explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUintFlag) { data_.n.u64 = u; if (!(u & 0x80000000)) flags_ |= kIntFlag | kInt64Flag; - } + }*/ //! Constructor for int64_t value. explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberInt64Flag) {