travis changes according clang 5.0

pull/2005/head
CwTCwT 2018-06-09 20:57:32 +02:00
parent 09825d8d03
commit 19fade2164
4 changed files with 14 additions and 9 deletions

View File

@ -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"));
}

View File

@ -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

View File

@ -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();

View File

@ -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()