瀏覽代碼

Update IfcLoader to use numeric_limits<uint32_t> instead of UINT32_MAX, fixes gcc build and is more consistent with the rest of the codebase. Fixes #471.

Alexander Gessler 10 年之前
父節點
當前提交
f6f8462113
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 2 1
      code/IFCLoader.cpp
  2. 3 2
      code/IFCMaterial.cpp

+ 2 - 1
code/IFCLoader.cpp

@@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
 #ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
 
 
 #include <iterator>
 #include <iterator>
+#include <limits>
 #include <boost/tuple/tuple.hpp>
 #include <boost/tuple/tuple.hpp>
 
 
 #ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
 #ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
@@ -560,7 +561,7 @@ void ProcessProductRepresentation(const IfcProduct& el, aiNode* nd, std::vector<
 	}
 	}
 
 
 	// extract Color from metadata, if present
 	// extract Color from metadata, if present
-	unsigned int matid = ProcessMaterials( el.GetID(), UINT32_MAX, conv, false);
+	unsigned int matid = ProcessMaterials( el.GetID(), std::numeric_limits<uint32_t>::max(), conv, false);
 	std::vector<unsigned int> meshes;
 	std::vector<unsigned int> meshes;
 
 
 	// we want only one representation type, so bring them in a suitable order (i.e try those
 	// we want only one representation type, so bring them in a suitable order (i.e try those

+ 3 - 2
code/IFCMaterial.cpp

@@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 #ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
 #ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
 #include "IFCUtil.h"
 #include "IFCUtil.h"
+#include <limits>
 
 
 namespace Assimp {
 namespace Assimp {
 	namespace IFC {
 	namespace IFC {
@@ -167,12 +168,12 @@ unsigned int ProcessMaterials(uint64_t id, unsigned int prevMatId, ConversionDat
 	}
 	}
 
 
 	// no local material defined. If there's global one, use that instead
 	// no local material defined. If there's global one, use that instead
-	if( prevMatId != UINT32_MAX )
+	if( prevMatId != std::numeric_limits<uint32_t>::max() )
 		return prevMatId;
 		return prevMatId;
 
 
 	// we're still here - create an default material if required, or simply fail otherwise
 	// we're still here - create an default material if required, or simply fail otherwise
 	if( !forceDefaultMat )
 	if( !forceDefaultMat )
-		return UINT32_MAX;
+		return std::numeric_limits<uint32_t>::max();
 
 
 	aiString name;
 	aiString name;
 	name.Set("<IFCDefault>");
 	name.Set("<IFCDefault>");