Merge branch 'master' into unique_ptr

pull/1635/head
Kim Kulling 2017-12-17 02:16:48 +01:00 committed by GitHub
commit 0bcf5c22db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 46 additions and 11 deletions

View File

@ -33,9 +33,10 @@ env:
matrix: matrix:
include: include:
- os: linux # disabled until clang 5.0 analyzer issues are fixed
compiler: clang # - os: linux
env: ANALYZE=ON # compiler: clang
# env: ANALYZE=ON
- os: linux - os: linux
compiler: clang compiler: clang
env: ASAN=ON env: ASAN=ON

View File

@ -434,6 +434,14 @@ void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int le
TokenizeError("file is too short",0); TokenizeError("file is too short",0);
} }
//uint32_t offset = 0x15;
/* const char* cursor = input + 0x15;
const uint32_t flags = ReadWord(input, cursor, input + length);
const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused
const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused*/
if (strncmp(input,"Kaydara FBX Binary",18)) { if (strncmp(input,"Kaydara FBX Binary",18)) {
TokenizeError("magic bytes not found",0); TokenizeError("magic bytes not found",0);
} }

View File

@ -145,7 +145,7 @@ protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Load the contents of a specific file into memory and /** Load the contents of a specific file into memory and
* alocates a buffer to keep it. * allocates a buffer to keep it.
* *
* mBuffer is modified to point to this buffer. * mBuffer is modified to point to this buffer.
* @param pFile File stream to be read * @param pFile File stream to be read

View File

@ -415,8 +415,14 @@ void MDLImporter::InternReadFile_Quake1( )
else else
{ {
// get the first frame in the group // get the first frame in the group
#if 1
// FIXME: the cast is wrong and causea a warning on clang 5.0
// disable thi code for now, fix it later
ai_assert(false && "Bad pointer cast");
#else
BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*)pcFrames; BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*)pcFrames;
pcFirstFrame = (BE_NCONST MDL::SimpleFrame*)(&pcFrames2->time + pcFrames->type); pcFirstFrame = (BE_NCONST MDL::SimpleFrame*)(&pcFrames2->time + pcFrames->type);
#endif
} }
BE_NCONST MDL::Vertex* pcVertices = (BE_NCONST MDL::Vertex*) ((pcFirstFrame->name) + sizeof(pcFirstFrame->name)); BE_NCONST MDL::Vertex* pcVertices = (BE_NCONST MDL::Vertex*) ((pcFirstFrame->name) + sizeof(pcFirstFrame->name));
VALIDATE_FILE_SIZE((const unsigned char*)(pcVertices + pcHeader->num_verts)); VALIDATE_FILE_SIZE((const unsigned char*)(pcVertices + pcHeader->num_verts));

View File

@ -192,7 +192,7 @@ public:
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
/** Increase the file pointer (relative seeking) */ /** Increase the file pointer (relative seeking) */
void IncPtr(size_t plus) { void IncPtr(intptr_t plus) {
current += plus; current += plus;
if (current > limit) { if (current > limit) {
throw DeadlyImportError("End of file or read limit was reached"); throw DeadlyImportError("End of file or read limit was reached");

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_GLTFEXPORTER_H_INC #ifndef AI_GLTFEXPORTER_H_INC
#define AI_GLTFEXPORTER_H_INC #define AI_GLTFEXPORTER_H_INC
#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER #ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER
#include <assimp/types.h> #include <assimp/types.h>
#include <assimp/material.h> #include <assimp/material.h>
@ -113,6 +113,6 @@ namespace Assimp
} }
#endif // ASSIMP_BUILD_NO_GLTF_IMPORTER #endif // ASSIMP_BUILD_NO_GLTF_EXPORTER
#endif // AI_GLTFEXPORTER_H_INC #endif // AI_GLTFEXPORTER_H_INC

View File

@ -41,6 +41,10 @@ woven in by Terry Thorsen 1/2003.
#include "zlib.h" #include "zlib.h"
#include "unzip.h" #include "unzip.h"
#if ZLIB_VERNUM < 0x1270
typedef unsigned long z_crc_t;
#endif
#ifdef STDC #ifdef STDC
# include <stddef.h> # include <stddef.h>
# include <string.h> # include <string.h>

View File

@ -491,7 +491,7 @@ struct aiUVTransform
} }
#endif #endif
} PACK_STRUCT; };
#include "./Compiler/poppack1.h" #include "./Compiler/poppack1.h"

View File

@ -99,7 +99,7 @@ public:
operator aiVector2t<TOther> () const; operator aiVector2t<TOther> () const;
TReal x, y; TReal x, y;
} PACK_STRUCT; };
typedef aiVector2t<ai_real> aiVector2D; typedef aiVector2t<ai_real> aiVector2D;

View File

@ -114,13 +114,29 @@ const aiVector2t<TReal>& aiVector2t<TReal>::operator /= (TReal f) {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
TReal aiVector2t<TReal>::operator[](unsigned int i) const { TReal aiVector2t<TReal>::operator[](unsigned int i) const {
return *(&x + i); switch (i) {
case 0:
return x;
case 1:
return y;
default:
break;
}
return x;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
TReal& aiVector2t<TReal>::operator[](unsigned int i) { TReal& aiVector2t<TReal>::operator[](unsigned int i) {
return *(&x + i); switch (i) {
case 0:
return x;
case 1:
return y;
default:
break;
}
return x;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------