瀏覽代碼

travis changes according clang 5.0

CwTCwT 7 年之前
父節點
當前提交
19fade2164
共有 4 個文件被更改,包括 14 次插入9 次删除
  1. 10 5
      code/BlenderCustomData.cpp
  2. 2 2
      code/BlenderDNA.h
  3. 1 1
      code/BlenderDNA.inl
  4. 1 1
      code/BlenderScene.h

+ 10 - 5
code/BlenderCustomData.cpp

@@ -24,7 +24,7 @@ namespace Assimp {
         /**
         *   @brief  pointer to function read memory for cnt CustomData types
         */
-        typedef void *(*PAlloc)(const size_t cnt);
+        typedef uint8_t *(*PAlloc)(const size_t cnt);
 
         /**
         *   @brief  helper macro to define Structure specific read function
@@ -56,7 +56,7 @@ namespace Assimp {
         *               }
         */
 #define IMPL_STRUCT_ALLOC(ty)                                                   \
-        void *alloc##ty(const size_t cnt) {                                     \
+        uint8_t *alloc##ty(const size_t cnt) {                                  \
             return new uint8_t[cnt * sizeof(ty)];                               \
         }
 
@@ -84,6 +84,11 @@ namespace Assimp {
         struct CustomDataTypeDescription {
             PRead Read;                         ///< function to read one CustomData type element
             PAlloc Alloc;                       ///< function to allocate n type elements
+
+            CustomDataTypeDescription(PRead read, PAlloc alloc)
+                : Read(read)
+                , Alloc(alloc)
+            {}
         };
 
         /**
@@ -96,13 +101,13 @@ namespace Assimp {
         *   @note   IMPL_STRUCT_READ for same ty must be used earlier to implement the typespecific read function
         */
 #define DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(ty)           \
-        CustomDataTypeDescription{ &read##ty, &alloc##ty }
+        CustomDataTypeDescription(&read##ty, &alloc##ty)
 
         /**
         *   @brief  helper macro to define CustomDataTypeDescription for UNSUPPORTED type
         */
 #define DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION          \
-        CustomDataTypeDescription{ nullptr, nullptr }
+        CustomDataTypeDescription(nullptr, nullptr)
 
         /**
         *   @brief  descriptors for data pointed to from CustomDataLayer.data
@@ -164,7 +169,7 @@ namespace Assimp {
             return cdtype >= 0 && cdtype < CD_NUMTYPES;
         }
 
-        bool readCustomData(std::shared_ptr<void> &out, const int cdtype, const size_t cnt, const FileDatabase &db) {
+        bool readCustomData(std::shared_ptr<uint8_t> &out, const int cdtype, const size_t cnt, const FileDatabase &db) {
             if (!isValidCustomDataType(cdtype)) {
                 throw Error((Formatter::format(), "CustomData.type ", cdtype, " out of index"));
             }

+ 2 - 2
code/BlenderDNA.h

@@ -329,7 +329,7 @@ public:
     *   @return true when read was successful
     */
     template <int error_policy>
-    bool ReadCustomDataPtr(std::shared_ptr<void>&out, int cdtype, const char* name, const FileDatabase& db) const;
+    bool ReadCustomDataPtr(std::shared_ptr<uint8_t>&out, int cdtype, const char* name, const FileDatabase& db) const;
 
 private:
 
@@ -833,7 +833,7 @@ private:
 *   @param[in]  db to read elements from
 *   @return true when ok
 */
-bool readCustomData(std::shared_ptr<void> &out, int cdtype, size_t cnt, const FileDatabase &db);
+bool readCustomData(std::shared_ptr<uint8_t> &out, int cdtype, size_t cnt, const FileDatabase &db);
 
 
     } // end Blend

+ 1 - 1
code/BlenderDNA.inl

@@ -310,7 +310,7 @@ void Structure :: ReadField(T& out, const char* name, const FileDatabase& db) co
 //--------------------------------------------------------------------------------
 // field parsing for raw untyped data (like CustomDataLayer.data)
 template <int error_policy>
-bool Structure::ReadCustomDataPtr(std::shared_ptr<void>&out, int cdtype, const char* name, const FileDatabase& db) const {
+bool Structure::ReadCustomDataPtr(std::shared_ptr<uint8_t>&out, int cdtype, const char* name, const FileDatabase& db) const {
 
 	const StreamReaderAny::pos old = db.reader->GetCurrentPos();
 

+ 1 - 1
code/BlenderScene.h

@@ -399,7 +399,7 @@ struct CustomDataLayer : ElemBase {
     int active_mask;
     int uid;
     char name[64];
-    std::shared_ptr<void> data;  // must be converted to real type according type member
+    std::shared_ptr<uint8_t> data;  // must be converted to real type according type member, usage of uint8_t since 
 
     CustomDataLayer()
         : ElemBase()