pull/474/head
ulf 2015-03-05 20:18:00 +01:00
commit 03a7f36858
50 changed files with 201 additions and 191 deletions

View File

@ -396,7 +396,7 @@ void Discreet3DSImporter::ConvertMeshes(aiScene* pcOut)
} }
for (unsigned int q = 0, base = 0; q < aiSplit[p].size();++q) for (unsigned int q = 0, base = 0; q < aiSplit[p].size();++q)
{ {
register unsigned int index = aiSplit[p][q]; unsigned int index = aiSplit[p][q];
aiFace& face = meshOut->mFaces[q]; aiFace& face = meshOut->mFaces[q];
face.mIndices = new unsigned int[3]; face.mIndices = new unsigned int[3];

View File

@ -294,7 +294,7 @@ void Discreet3DSExporter::WriteMaterials()
WriteColor(color); WriteColor(color);
} }
aiShadingMode shading_mode; aiShadingMode shading_mode = aiShadingMode_Flat;
if (mat.Get(AI_MATKEY_SHADING_MODEL, shading_mode) == AI_SUCCESS) { if (mat.Get(AI_MATKEY_SHADING_MODEL, shading_mode) == AI_SUCCESS) {
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_SHADING); ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_SHADING);

View File

@ -489,7 +489,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
for (it = object.surfaces.begin(); it != end; ++it) for (it = object.surfaces.begin(); it != end; ++it)
{ {
register unsigned int idx = (*it).mat; unsigned int idx = (*it).mat;
if (idx >= needMat.size()) if (idx >= needMat.size())
{ {
DefaultLogger::get()->error("AC3D: material index is out of range"); DefaultLogger::get()->error("AC3D: material index is out of range");
@ -617,7 +617,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
it2 = (*it).entries.begin(); it2 = (*it).entries.begin();
// either a closed or an unclosed line // either a closed or an unclosed line
register unsigned int tmp = (unsigned int)(*it).entries.size(); unsigned int tmp = (unsigned int)(*it).entries.size();
if (0x2 == type)--tmp; if (0x2 == type)--tmp;
for (unsigned int m = 0; m < tmp;++m) for (unsigned int m = 0; m < tmp;++m)
{ {

View File

@ -168,7 +168,7 @@ void Parser::LogInfo(const char* szWarn)
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void Parser::LogError(const char* szWarn) AI_WONT_RETURN void Parser::LogError(const char* szWarn)
{ {
ai_assert(NULL != szWarn); ai_assert(NULL != szWarn);

View File

@ -602,7 +602,7 @@ private:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
//! Output an error to the logger //! Output an error to the logger
//! \param szWarn Error message //! \param szWarn Error message
void LogError(const char* szWarn); AI_WONT_RETURN void LogError(const char* szWarn) AI_WONT_RETURN_SUFFIX;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
//! Parse a string, enclosed in double quotation marks //! Parse a string, enclosed in double quotation marks

View File

@ -273,13 +273,13 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
if (buffer) delete[] buffer; if (buffer) delete[] buffer;
} }
void * GetBufferPointer() { return buffer; }; void * GetBufferPointer() { return buffer; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
virtual size_t Read(void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) { return 0; }; virtual size_t Read(void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) { return 0; }
virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) { return aiReturn_FAILURE; }; virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) { return aiReturn_FAILURE; }
virtual size_t Tell() const { return cursor; }; virtual size_t Tell() const { return cursor; }
virtual void Flush() { }; virtual void Flush() { }
virtual size_t FileSize() const virtual size_t FileSize() const
{ {

View File

@ -127,12 +127,12 @@ void B3DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void B3DImporter::Oops(){ AI_WONT_RETURN void B3DImporter::Oops(){
throw DeadlyImportError( "B3D Importer - INTERNAL ERROR" ); throw DeadlyImportError( "B3D Importer - INTERNAL ERROR" );
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void B3DImporter::Fail( string str ){ AI_WONT_RETURN void B3DImporter::Fail( string str ){
#ifdef DEBUG_B3D #ifdef DEBUG_B3D
cout<<"Error in B3D file data: "<<str<<endl; cout<<"Error in B3D file data: "<<str<<endl;
#endif #endif

View File

@ -87,8 +87,8 @@ private:
float weights[4]; float weights[4];
}; };
void Oops(); AI_WONT_RETURN void Oops() AI_WONT_RETURN_SUFFIX;
void Fail( std::string str ); AI_WONT_RETURN void Fail( std::string str ) AI_WONT_RETURN_SUFFIX;
void ReadTEXS(); void ReadTEXS();
void ReadBRUS(); void ReadBRUS();

View File

@ -413,7 +413,7 @@ float BVHLoader::GetNextTokenAsFloat()
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Aborts the file reading with an exception // Aborts the file reading with an exception
void BVHLoader::ThrowException( const std::string& pError) AI_WONT_RETURN void BVHLoader::ThrowException( const std::string& pError)
{ {
throw DeadlyImportError( boost::str( boost::format( "%s:%d - %s") % mFileName % mLine % pError)); throw DeadlyImportError( boost::str( boost::format( "%s:%d - %s") % mFileName % mLine % pError));
} }

View File

@ -134,7 +134,7 @@ protected:
float GetNextTokenAsFloat(); float GetNextTokenAsFloat();
/** Aborts the file reading with an exception */ /** Aborts the file reading with an exception */
void ThrowException( const std::string& pError); AI_WONT_RETURN void ThrowException( const std::string& pError) AI_WONT_RETURN_SUFFIX;
/** Constructs an animation for the motion data and stores it in the given scene */ /** Constructs an animation for the motion data and stores it in the given scene */
void CreateAnimation( aiScene* pScene); void CreateAnimation( aiScene* pScene);

View File

@ -127,7 +127,7 @@ void COBImporter::SetupProperties(const Importer* /*pImp*/)
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
/*static*/ void COBImporter::ThrowException(const std::string& msg) /*static*/ AI_WONT_RETURN void COBImporter::ThrowException(const std::string& msg)
{ {
throw DeadlyImportError("COB: "+msg); throw DeadlyImportError("COB: "+msg);
} }

View File

@ -95,7 +95,7 @@ private:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Prepend 'COB: ' and throw msg.*/ /** Prepend 'COB: ' and throw msg.*/
static void ThrowException(const std::string& msg); AI_WONT_RETURN static void ThrowException(const std::string& msg) AI_WONT_RETURN_SUFFIX;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** @brief Read from an ascii scene/object file /** @brief Read from an ascii scene/object file

View File

@ -167,7 +167,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
// their tangent vectors are set to qnan. // their tangent vectors are set to qnan.
for (unsigned int i = 0; i < face.mNumIndices;++i) for (unsigned int i = 0; i < face.mNumIndices;++i)
{ {
register unsigned int idx = face.mIndices[i]; unsigned int idx = face.mIndices[i];
vertexDone [idx] = true; vertexDone [idx] = true;
meshTang [idx] = aiVector3D(qnan); meshTang [idx] = aiVector3D(qnan);
meshBitang [idx] = aiVector3D(qnan); meshBitang [idx] = aiVector3D(qnan);

View File

@ -452,7 +452,7 @@ void ColladaExporter::WriteMaterials()
} }
} }
aiShadingMode shading; aiShadingMode shading = aiShadingMode_Flat;
materials[a].shading_model = "phong"; materials[a].shading_model = "phong";
if(mat->Get( AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) { if(mat->Get( AI_MATKEY_SHADING_MODEL, shading) == aiReturn_SUCCESS) {
if(shading == aiShadingMode_Phong) { if(shading == aiShadingMode_Phong) {

View File

@ -2659,7 +2659,7 @@ void ColladaParser::ReadScene()
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Aborts the file reading with an exception // Aborts the file reading with an exception
void ColladaParser::ThrowException( const std::string& pError) const AI_WONT_RETURN void ColladaParser::ThrowException( const std::string& pError) const
{ {
throw DeadlyImportError( boost::str( boost::format( "Collada: %s - %s") % mFileName % pError)); throw DeadlyImportError( boost::str( boost::format( "Collada: %s - %s") % mFileName % pError));
} }

View File

@ -212,7 +212,7 @@ protected:
protected: protected:
/** Aborts the file reading with an exception */ /** Aborts the file reading with an exception */
void ThrowException( const std::string& pError) const; AI_WONT_RETURN void ThrowException( const std::string& pError) const AI_WONT_RETURN_SUFFIX;
/** Skips all data until the end node of the current element */ /** Skips all data until the end node of the current element */
void SkipElement(); void SkipElement();

View File

@ -454,7 +454,7 @@ void ComputeUVMappingProcess::Execute( aiScene* pScene)
for (unsigned int m = 0; m < pScene->mNumMeshes;++m) for (unsigned int m = 0; m < pScene->mNumMeshes;++m)
{ {
aiMesh* mesh = pScene->mMeshes[m]; aiMesh* mesh = pScene->mMeshes[m];
unsigned int outIdx; unsigned int outIdx = 0;
if ( mesh->mMaterialIndex != i || ( outIdx = FindEmptyUVChannel(mesh) ) == UINT_MAX || if ( mesh->mMaterialIndex != i || ( outIdx = FindEmptyUVChannel(mesh) ) == UINT_MAX ||
!mesh->mNumVertices) !mesh->mNumVertices)
{ {

View File

@ -78,7 +78,8 @@ namespace {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// signal tokenization error, this is always unrecoverable. Throws DeadlyImportError. // signal tokenization error, this is always unrecoverable. Throws DeadlyImportError.
void TokenizeError(const std::string& message, unsigned int offset) AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int offset) AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int offset)
{ {
throw DeadlyImportError(Util::AddOffset("FBX-Tokenize",message,offset)); throw DeadlyImportError(Util::AddOffset("FBX-Tokenize",message,offset));
} }

View File

@ -1256,8 +1256,11 @@ private:
// taking notes so we don't need to do it twice. // taking notes so we don't need to do it twice.
BOOST_FOREACH(WeightIndexArray::value_type index, indices) { BOOST_FOREACH(WeightIndexArray::value_type index, indices) {
unsigned int count; unsigned int count = 0;
const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count); const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count);
// ToOutputVertexIndex only returns NULL if index is out of bounds
// which should never happen
ai_assert(out_idx != NULL);
index_out_indices.push_back(no_index_sentinel); index_out_indices.push_back(no_index_sentinel);
count_out_indices.push_back(0); count_out_indices.push_back(0);

View File

@ -242,20 +242,20 @@ public:
public: public:
fbx_simple_property(Position, aiVector3D, aiVector3D(0,0,0)); fbx_simple_property(Position, aiVector3D, aiVector3D(0,0,0))
fbx_simple_property(UpVector, aiVector3D, aiVector3D(0,1,0)); fbx_simple_property(UpVector, aiVector3D, aiVector3D(0,1,0))
fbx_simple_property(InterestPosition, aiVector3D, aiVector3D(0,0,0)); fbx_simple_property(InterestPosition, aiVector3D, aiVector3D(0,0,0))
fbx_simple_property(AspectWidth, float, 1.0f); fbx_simple_property(AspectWidth, float, 1.0f)
fbx_simple_property(AspectHeight, float, 1.0f); fbx_simple_property(AspectHeight, float, 1.0f)
fbx_simple_property(FilmWidth, float, 1.0f); fbx_simple_property(FilmWidth, float, 1.0f)
fbx_simple_property(FilmHeight, float, 1.0f); fbx_simple_property(FilmHeight, float, 1.0f)
fbx_simple_property(FilmAspectRatio, float, 1.0f); fbx_simple_property(FilmAspectRatio, float, 1.0f)
fbx_simple_property(ApertureMode, int, 0); fbx_simple_property(ApertureMode, int, 0)
fbx_simple_property(FieldOfView, float, 1.0f); fbx_simple_property(FieldOfView, float, 1.0f)
fbx_simple_property(FocalLength, float, 1.0f); fbx_simple_property(FocalLength, float, 1.0f)
private: private:
}; };
@ -314,37 +314,37 @@ public:
public: public:
fbx_simple_property(Color, aiVector3D, aiVector3D(1,1,1)); fbx_simple_property(Color, aiVector3D, aiVector3D(1,1,1))
fbx_simple_enum_property(LightType, Type, 0); fbx_simple_enum_property(LightType, Type, 0)
fbx_simple_property(CastLightOnObject, bool, false); fbx_simple_property(CastLightOnObject, bool, false)
fbx_simple_property(DrawVolumetricLight, bool, true); fbx_simple_property(DrawVolumetricLight, bool, true)
fbx_simple_property(DrawGroundProjection, bool, true); fbx_simple_property(DrawGroundProjection, bool, true)
fbx_simple_property(DrawFrontFacingVolumetricLight, bool, false); fbx_simple_property(DrawFrontFacingVolumetricLight, bool, false)
fbx_simple_property(Intensity, float, 1.0f); fbx_simple_property(Intensity, float, 1.0f)
fbx_simple_property(InnerAngle, float, 0.0f); fbx_simple_property(InnerAngle, float, 0.0f)
fbx_simple_property(OuterAngle, float, 45.0f); fbx_simple_property(OuterAngle, float, 45.0f)
fbx_simple_property(Fog, int, 50); fbx_simple_property(Fog, int, 50)
fbx_simple_enum_property(DecayType, Decay, 0); fbx_simple_enum_property(DecayType, Decay, 0)
fbx_simple_property(DecayStart, int, 0); fbx_simple_property(DecayStart, int, 0)
fbx_simple_property(FileName, std::string, ""); fbx_simple_property(FileName, std::string, "")
fbx_simple_property(EnableNearAttenuation, bool, false); fbx_simple_property(EnableNearAttenuation, bool, false)
fbx_simple_property(NearAttenuationStart, float, 0.0f); fbx_simple_property(NearAttenuationStart, float, 0.0f)
fbx_simple_property(NearAttenuationEnd, float, 0.0f); fbx_simple_property(NearAttenuationEnd, float, 0.0f)
fbx_simple_property(EnableFarAttenuation, bool, false); fbx_simple_property(EnableFarAttenuation, bool, false)
fbx_simple_property(FarAttenuationStart, float, 0.0f); fbx_simple_property(FarAttenuationStart, float, 0.0f)
fbx_simple_property(FarAttenuationEnd, float, 0.0f); fbx_simple_property(FarAttenuationEnd, float, 0.0f)
fbx_simple_property(CastShadows, bool, true); fbx_simple_property(CastShadows, bool, true)
fbx_simple_property(ShadowColor, aiVector3D, aiVector3D(0,0,0)); fbx_simple_property(ShadowColor, aiVector3D, aiVector3D(0,0,0))
fbx_simple_property(AreaLightShape, int, 0); fbx_simple_property(AreaLightShape, int, 0)
fbx_simple_property(LeftBarnDoor, float, 20.0f); fbx_simple_property(LeftBarnDoor, float, 20.0f)
fbx_simple_property(RightBarnDoor, float, 20.0f); fbx_simple_property(RightBarnDoor, float, 20.0f)
fbx_simple_property(TopBarnDoor, float, 20.0f); fbx_simple_property(TopBarnDoor, float, 20.0f)
fbx_simple_property(BottomBarnDoor, float, 20.0f); fbx_simple_property(BottomBarnDoor, float, 20.0f)
fbx_simple_property(EnableBarnDoor, bool, true); fbx_simple_property(EnableBarnDoor, bool, true)
private: private:
@ -387,81 +387,81 @@ public:
public: public:
fbx_simple_property(QuaternionInterpolate, int, 0); fbx_simple_property(QuaternionInterpolate, int, 0)
fbx_simple_property(RotationOffset, aiVector3D, aiVector3D()); fbx_simple_property(RotationOffset, aiVector3D, aiVector3D())
fbx_simple_property(RotationPivot, aiVector3D, aiVector3D()); fbx_simple_property(RotationPivot, aiVector3D, aiVector3D())
fbx_simple_property(ScalingOffset, aiVector3D, aiVector3D()); fbx_simple_property(ScalingOffset, aiVector3D, aiVector3D())
fbx_simple_property(ScalingPivot, aiVector3D, aiVector3D()); fbx_simple_property(ScalingPivot, aiVector3D, aiVector3D())
fbx_simple_property(TranslationActive, bool, false); fbx_simple_property(TranslationActive, bool, false)
fbx_simple_property(TranslationMin, aiVector3D, aiVector3D()); fbx_simple_property(TranslationMin, aiVector3D, aiVector3D())
fbx_simple_property(TranslationMax, aiVector3D, aiVector3D()); fbx_simple_property(TranslationMax, aiVector3D, aiVector3D())
fbx_simple_property(TranslationMinX, bool, false); fbx_simple_property(TranslationMinX, bool, false)
fbx_simple_property(TranslationMaxX, bool, false); fbx_simple_property(TranslationMaxX, bool, false)
fbx_simple_property(TranslationMinY, bool, false); fbx_simple_property(TranslationMinY, bool, false)
fbx_simple_property(TranslationMaxY, bool, false); fbx_simple_property(TranslationMaxY, bool, false)
fbx_simple_property(TranslationMinZ, bool, false); fbx_simple_property(TranslationMinZ, bool, false)
fbx_simple_property(TranslationMaxZ, bool, false); fbx_simple_property(TranslationMaxZ, bool, false)
fbx_simple_enum_property(RotationOrder, RotOrder, 0); fbx_simple_enum_property(RotationOrder, RotOrder, 0)
fbx_simple_property(RotationSpaceForLimitOnly, bool, false); fbx_simple_property(RotationSpaceForLimitOnly, bool, false)
fbx_simple_property(RotationStiffnessX, float, 0.0f); fbx_simple_property(RotationStiffnessX, float, 0.0f)
fbx_simple_property(RotationStiffnessY, float, 0.0f); fbx_simple_property(RotationStiffnessY, float, 0.0f)
fbx_simple_property(RotationStiffnessZ, float, 0.0f); fbx_simple_property(RotationStiffnessZ, float, 0.0f)
fbx_simple_property(AxisLen, float, 0.0f); fbx_simple_property(AxisLen, float, 0.0f)
fbx_simple_property(PreRotation, aiVector3D, aiVector3D()); fbx_simple_property(PreRotation, aiVector3D, aiVector3D())
fbx_simple_property(PostRotation, aiVector3D, aiVector3D()); fbx_simple_property(PostRotation, aiVector3D, aiVector3D())
fbx_simple_property(RotationActive, bool, false); fbx_simple_property(RotationActive, bool, false)
fbx_simple_property(RotationMin, aiVector3D, aiVector3D()); fbx_simple_property(RotationMin, aiVector3D, aiVector3D())
fbx_simple_property(RotationMax, aiVector3D, aiVector3D()); fbx_simple_property(RotationMax, aiVector3D, aiVector3D())
fbx_simple_property(RotationMinX, bool, false); fbx_simple_property(RotationMinX, bool, false)
fbx_simple_property(RotationMaxX, bool, false); fbx_simple_property(RotationMaxX, bool, false)
fbx_simple_property(RotationMinY, bool, false); fbx_simple_property(RotationMinY, bool, false)
fbx_simple_property(RotationMaxY, bool, false); fbx_simple_property(RotationMaxY, bool, false)
fbx_simple_property(RotationMinZ, bool, false); fbx_simple_property(RotationMinZ, bool, false)
fbx_simple_property(RotationMaxZ, bool, false); fbx_simple_property(RotationMaxZ, bool, false)
fbx_simple_enum_property(InheritType, TransformInheritance, 0); fbx_simple_enum_property(InheritType, TransformInheritance, 0)
fbx_simple_property(ScalingActive, bool, false); fbx_simple_property(ScalingActive, bool, false)
fbx_simple_property(ScalingMin, aiVector3D, aiVector3D()); fbx_simple_property(ScalingMin, aiVector3D, aiVector3D())
fbx_simple_property(ScalingMax, aiVector3D, aiVector3D(1.f,1.f,1.f)); fbx_simple_property(ScalingMax, aiVector3D, aiVector3D(1.f,1.f,1.f))
fbx_simple_property(ScalingMinX, bool, false); fbx_simple_property(ScalingMinX, bool, false)
fbx_simple_property(ScalingMaxX, bool, false); fbx_simple_property(ScalingMaxX, bool, false)
fbx_simple_property(ScalingMinY, bool, false); fbx_simple_property(ScalingMinY, bool, false)
fbx_simple_property(ScalingMaxY, bool, false); fbx_simple_property(ScalingMaxY, bool, false)
fbx_simple_property(ScalingMinZ, bool, false); fbx_simple_property(ScalingMinZ, bool, false)
fbx_simple_property(ScalingMaxZ, bool, false); fbx_simple_property(ScalingMaxZ, bool, false)
fbx_simple_property(GeometricTranslation, aiVector3D, aiVector3D()); fbx_simple_property(GeometricTranslation, aiVector3D, aiVector3D())
fbx_simple_property(GeometricRotation, aiVector3D, aiVector3D()); fbx_simple_property(GeometricRotation, aiVector3D, aiVector3D())
fbx_simple_property(GeometricScaling, aiVector3D, aiVector3D(1.f, 1.f, 1.f)); fbx_simple_property(GeometricScaling, aiVector3D, aiVector3D(1.f, 1.f, 1.f))
fbx_simple_property(MinDampRangeX, float, 0.0f); fbx_simple_property(MinDampRangeX, float, 0.0f)
fbx_simple_property(MinDampRangeY, float, 0.0f); fbx_simple_property(MinDampRangeY, float, 0.0f)
fbx_simple_property(MinDampRangeZ, float, 0.0f); fbx_simple_property(MinDampRangeZ, float, 0.0f)
fbx_simple_property(MaxDampRangeX, float, 0.0f); fbx_simple_property(MaxDampRangeX, float, 0.0f)
fbx_simple_property(MaxDampRangeY, float, 0.0f); fbx_simple_property(MaxDampRangeY, float, 0.0f)
fbx_simple_property(MaxDampRangeZ, float, 0.0f); fbx_simple_property(MaxDampRangeZ, float, 0.0f)
fbx_simple_property(MinDampStrengthX, float, 0.0f); fbx_simple_property(MinDampStrengthX, float, 0.0f)
fbx_simple_property(MinDampStrengthY, float, 0.0f); fbx_simple_property(MinDampStrengthY, float, 0.0f)
fbx_simple_property(MinDampStrengthZ, float, 0.0f); fbx_simple_property(MinDampStrengthZ, float, 0.0f)
fbx_simple_property(MaxDampStrengthX, float, 0.0f); fbx_simple_property(MaxDampStrengthX, float, 0.0f)
fbx_simple_property(MaxDampStrengthY, float, 0.0f); fbx_simple_property(MaxDampStrengthY, float, 0.0f)
fbx_simple_property(MaxDampStrengthZ, float, 0.0f); fbx_simple_property(MaxDampStrengthZ, float, 0.0f)
fbx_simple_property(PreferredAngleX, float, 0.0f); fbx_simple_property(PreferredAngleX, float, 0.0f)
fbx_simple_property(PreferredAngleY, float, 0.0f); fbx_simple_property(PreferredAngleY, float, 0.0f)
fbx_simple_property(PreferredAngleZ, float, 0.0f); fbx_simple_property(PreferredAngleZ, float, 0.0f)
fbx_simple_property(Show, bool, true); fbx_simple_property(Show, bool, true)
fbx_simple_property(LODBox, bool, false); fbx_simple_property(LODBox, bool, false)
fbx_simple_property(Freeze, bool, false); fbx_simple_property(Freeze, bool, false)
public: public:
@ -1015,10 +1015,10 @@ public:
public: public:
fbx_simple_property(LocalStart, uint64_t, 0L); fbx_simple_property(LocalStart, uint64_t, 0L)
fbx_simple_property(LocalStop, uint64_t, 0L); fbx_simple_property(LocalStop, uint64_t, 0L)
fbx_simple_property(ReferenceStart, uint64_t, 0L); fbx_simple_property(ReferenceStart, uint64_t, 0L)
fbx_simple_property(ReferenceStop, uint64_t, 0L); fbx_simple_property(ReferenceStop, uint64_t, 0L)
@ -1227,18 +1227,18 @@ public:
} }
fbx_simple_property(UpAxis, int, 1); fbx_simple_property(UpAxis, int, 1)
fbx_simple_property(UpAxisSign, int, 1); fbx_simple_property(UpAxisSign, int, 1)
fbx_simple_property(FrontAxis, int, 2); fbx_simple_property(FrontAxis, int, 2)
fbx_simple_property(FrontAxisSign, int, 1); fbx_simple_property(FrontAxisSign, int, 1)
fbx_simple_property(CoordAxis, int, 0); fbx_simple_property(CoordAxis, int, 0)
fbx_simple_property(CoordAxisSign, int, 1); fbx_simple_property(CoordAxisSign, int, 1)
fbx_simple_property(OriginalUpAxis, int, 0); fbx_simple_property(OriginalUpAxis, int, 0)
fbx_simple_property(OriginalUpAxisSign, int, 1); fbx_simple_property(OriginalUpAxisSign, int, 1)
fbx_simple_property(UnitScaleFactor, double, 1); fbx_simple_property(UnitScaleFactor, double, 1)
fbx_simple_property(OriginalUnitScaleFactor, double, 1); fbx_simple_property(OriginalUnitScaleFactor, double, 1)
fbx_simple_property(AmbientColor, aiVector3D, aiVector3D(0,0,0)); fbx_simple_property(AmbientColor, aiVector3D, aiVector3D(0,0,0))
fbx_simple_property(DefaultCamera, std::string, ""); fbx_simple_property(DefaultCamera, std::string, "")
enum FrameRate { enum FrameRate {
@ -1261,10 +1261,10 @@ public:
FrameRate_MAX// end-of-enum sentinel FrameRate_MAX// end-of-enum sentinel
}; };
fbx_simple_enum_property(TimeMode, FrameRate, FrameRate_DEFAULT); fbx_simple_enum_property(TimeMode, FrameRate, FrameRate_DEFAULT)
fbx_simple_property(TimeSpanStart, uint64_t, 0L); fbx_simple_property(TimeSpanStart, uint64_t, 0L)
fbx_simple_property(TimeSpanStop, uint64_t, 0L); fbx_simple_property(TimeSpanStop, uint64_t, 0L)
fbx_simple_property(CustomFrameRate, float, -1.0f); fbx_simple_property(CustomFrameRate, float, -1.0f)
private: private:

View File

@ -68,13 +68,15 @@ namespace {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// signal parse error, this is always unrecoverable. Throws DeadlyImportError. // signal parse error, this is always unrecoverable. Throws DeadlyImportError.
void ParseError(const std::string& message, const Token& token) AI_WONT_RETURN void ParseError(const std::string& message, const Token& token) AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void ParseError(const std::string& message, const Token& token)
{ {
throw DeadlyImportError(Util::AddTokenText("FBX-Parser",message,&token)); throw DeadlyImportError(Util::AddTokenText("FBX-Parser",message,&token));
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void ParseError(const std::string& message, const Element* element = NULL) AI_WONT_RETURN void ParseError(const std::string& message, const Element* element = NULL) AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void ParseError(const std::string& message, const Element* element)
{ {
if(element) { if(element) {
ParseError(message,element->KeyToken()); ParseError(message,element->KeyToken());

View File

@ -86,7 +86,8 @@ namespace {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// signal tokenization error, this is always unrecoverable. Throws DeadlyImportError. // signal tokenization error, this is always unrecoverable. Throws DeadlyImportError.
void TokenizeError(const std::string& message, unsigned int line, unsigned int column) AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int line, unsigned int column) AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int line, unsigned int column)
{ {
throw DeadlyImportError(Util::AddLineAndColumn("FBX-Tokenize",message,line,column)); throw DeadlyImportError(Util::AddLineAndColumn("FBX-Tokenize",message,line,column));
} }

View File

@ -107,7 +107,7 @@ void FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh)
bool first = true; bool first = true;
// check whether the face contains degenerated entries // check whether the face contains degenerated entries
for (register unsigned int i = 0; i < face.mNumIndices; ++i) for (unsigned int i = 0; i < face.mNumIndices; ++i)
{ {
// Polygons with more than 4 points are allowed to have double points, that is // Polygons with more than 4 points are allowed to have double points, that is
// simulating polygons with holes just with concave polygons. However, // simulating polygons with holes just with concave polygons. However,
@ -116,7 +116,7 @@ void FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh)
if (face.mNumIndices > 4) if (face.mNumIndices > 4)
limit = std::min(limit,i+2); limit = std::min(limit,i+2);
for (register unsigned int t = i+1; t < limit; ++t) for (unsigned int t = i+1; t < limit; ++t)
{ {
if (mesh->mVertices[face.mIndices[i]] == mesh->mVertices[face.mIndices[t]]) if (mesh->mVertices[face.mIndices[i]] == mesh->mVertices[face.mIndices[t]])
{ {

View File

@ -89,7 +89,7 @@ void UpdateMeshReferences(aiNode* node, const std::vector<unsigned int>& meshMap
unsigned int out = 0; unsigned int out = 0;
for (unsigned int a = 0; a < node->mNumMeshes;++a) { for (unsigned int a = 0; a < node->mNumMeshes;++a) {
register unsigned int ref = node->mMeshes[a]; unsigned int ref = node->mMeshes[a];
if (UINT_MAX != (ref = meshMapping[ref])) { if (UINT_MAX != (ref = meshMapping[ref])) {
node->mMeshes[out++] = ref; node->mMeshes[out++] = ref;
} }

View File

@ -195,7 +195,7 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int
// Write the smoothed normal back to all affected normals // Write the smoothed normal back to all affected normals
for (unsigned int a = 0; a < verticesFound.size(); ++a) for (unsigned int a = 0; a < verticesFound.size(); ++a)
{ {
register unsigned int vidx = verticesFound[a]; unsigned int vidx = verticesFound[a];
pcNew[vidx] = pcNor; pcNew[vidx] = pcNor;
abHad[vidx] = true; abHad[vidx] = true;
} }

View File

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

View File

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

View File

@ -303,7 +303,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh
ivdx = -1; ivdx = -1;
int max_priority = -1; int max_priority = -1;
for (unsigned int* piCur = piCandidates;piCur != piCurCandidate;++piCur) { for (unsigned int* piCur = piCandidates;piCur != piCurCandidate;++piCur) {
register const unsigned int dp = *piCur; const unsigned int dp = *piCur;
// must have live triangles // must have live triangles
if (piNumTriPtr[dp] > 0) { if (piNumTriPtr[dp] > 0) {

View File

@ -346,7 +346,7 @@ struct VColorChannel : public VMapEntry
if (!rawData.empty()) if (!rawData.empty())
return; // return if already allocated return; // return if already allocated
register unsigned int m = num*dims; unsigned int m = num*dims;
rawData.reserve(m + (m>>2u)); // 25% as extra storage for VMADs rawData.reserve(m + (m>>2u)); // 25% as extra storage for VMADs
rawData.resize(m); rawData.resize(m);

View File

@ -344,7 +344,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
// copy all vertices // copy all vertices
for (unsigned int q = 0; q < face.mNumIndices;++q,++vert) { for (unsigned int q = 0; q < face.mNumIndices;++q,++vert) {
register unsigned int idx = face.mIndices[q]; unsigned int idx = face.mIndices[q];
*pv++ = layer.mTempPoints[idx] /*- layer.mPivot*/; *pv++ = layer.mTempPoints[idx] /*- layer.mPivot*/;
// process UV coordinates // process UV coordinates
@ -491,7 +491,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
aiFace& face = *begin; aiFace& face = *begin;
for (unsigned int i = 0; i < face.mNumIndices;++i) for (unsigned int i = 0; i < face.mNumIndices;++i)
{ {
register unsigned int tt = face.mIndices[i]; unsigned int tt = face.mIndices[i];
sSort.Add(mesh->mVertices[tt],tt,*it); sSort.Add(mesh->mVertices[tt],tt,*it);
} }
} }
@ -510,7 +510,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices; unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
for (; beginIdx != endIdx; ++beginIdx) for (; beginIdx != endIdx; ++beginIdx)
{ {
register unsigned int idx = *beginIdx; unsigned int idx = *beginIdx;
sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true); sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
std::vector<unsigned int>::const_iterator a, end = poResult.end(); std::vector<unsigned int>::const_iterator a, end = poResult.end();
@ -533,7 +533,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices; unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
for (; beginIdx != endIdx; ++beginIdx) for (; beginIdx != endIdx; ++beginIdx)
{ {
register unsigned int idx = *beginIdx; unsigned int idx = *beginIdx;
if (vertexDone[idx]) if (vertexDone[idx])
continue; continue;
sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true); sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
@ -735,7 +735,7 @@ void LWOImporter::LoadLWOPoints(unsigned int length)
{ {
throw DeadlyImportError( "LWO2: Points chunk length is not multiple of vertexLen (12)"); throw DeadlyImportError( "LWO2: Points chunk length is not multiple of vertexLen (12)");
} }
register unsigned int regularSize = (unsigned int)mCurLayer->mTempPoints.size() + length / 12; unsigned int regularSize = (unsigned int)mCurLayer->mTempPoints.size() + length / 12;
if (mIsLWO2) if (mIsLWO2)
{ {
mCurLayer->mTempPoints.reserve ( regularSize + (regularSize>>2u) ); mCurLayer->mTempPoints.reserve ( regularSize + (regularSize>>2u) );

View File

@ -377,7 +377,7 @@ void MD2Importer::InternReadFile( const std::string& pFile,
for (unsigned int c = 0; c < 3;++c,++iCurrent) { for (unsigned int c = 0; c < 3;++c,++iCurrent) {
// validate vertex indices // validate vertex indices
register unsigned int iIndex = (unsigned int)pcTriangles[i].vertexIndices[c]; unsigned int iIndex = (unsigned int)pcTriangles[i].vertexIndices[c];
if (iIndex >= m_pcHeader->numVertices) { if (iIndex >= m_pcHeader->numVertices) {
DefaultLogger::get()->error("MD2: Vertex index is outside the allowed range"); DefaultLogger::get()->error("MD2: Vertex index is outside the allowed range");
iIndex = m_pcHeader->numVertices-1; iIndex = m_pcHeader->numVertices-1;

View File

@ -88,7 +88,7 @@ MD5Parser::MD5Parser(char* _buffer, unsigned int _fileSize )
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Report error to the log stream // Report error to the log stream
/*static*/ void MD5Parser::ReportError (const char* error, unsigned int line) /*static*/ AI_WONT_RETURN void MD5Parser::ReportError (const char* error, unsigned int line)
{ {
char szBuffer[1024]; char szBuffer[1024];
::sprintf(szBuffer,"[MD5] Line %i: %s",line,error); ::sprintf(szBuffer,"[MD5] Line %i: %s",line,error);

View File

@ -367,7 +367,7 @@ public:
* @param error Error message to be reported * @param error Error message to be reported
* @param line Index of the line where the error occured * @param line Index of the line where the error occured
*/ */
static void ReportError (const char* error, unsigned int line); AI_WONT_RETURN static void ReportError (const char* error, unsigned int line) AI_WONT_RETURN_SUFFIX;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Report a specific warning /** Report a specific warning

View File

@ -400,7 +400,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
if (TokenMatch(sz,"0x",2)) if (TokenMatch(sz,"0x",2))
{ {
hasColor = true; hasColor = true;
register unsigned int numIdx = ::strtoul16(sz,&sz); unsigned int numIdx = ::strtoul16(sz,&sz);
aiColor4D clr; aiColor4D clr;
clr.a = 1.f; clr.a = 1.f;

View File

@ -54,7 +54,8 @@ namespace Assimp
namespace Ogre namespace Ogre
{ {
void ThrowAttibuteError(const XmlReader* reader, const std::string &name, const std::string &error = "") AI_WONT_RETURN void ThrowAttibuteError(const XmlReader* reader, const std::string &name, const std::string &error = "") AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void ThrowAttibuteError(const XmlReader* reader, const std::string &name, const std::string &error)
{ {
if (!error.empty()) if (!error.empty())
{ {

View File

@ -170,7 +170,7 @@ void OptimizeMeshesProcess::ProcessNode( aiNode* pNode)
// Find meshes to merge with us // Find meshes to merge with us
for (unsigned int a = i+1; a < pNode->mNumMeshes;++a) { for (unsigned int a = i+1; a < pNode->mNumMeshes;++a) {
register unsigned int am = pNode->mMeshes[a]; unsigned int am = pNode->mMeshes[a];
if (meshes[am].instance_cnt == 1 && CanJoin(im,am,verts,faces)) { if (meshes[am].instance_cnt == 1 && CanJoin(im,am,verts,faces)) {
merge_list.push_back(mScene->mMeshes[am]); merge_list.push_back(mScene->mMeshes[am]);

View File

@ -794,7 +794,7 @@ bool PLY::PropertyInstance::ParseValue(
{ {
ai_assert(NULL != pCur && NULL != pCurOut && NULL != out); ai_assert(NULL != pCur && NULL != pCurOut && NULL != out);
register bool ret = true; bool ret = true;
*pCurOut = pCur; *pCurOut = pCur;
switch (eType) switch (eType)
{ {
@ -841,7 +841,7 @@ bool PLY::PropertyInstance::ParseValueBinary(
{ {
ai_assert(NULL != pCur && NULL != pCurOut && NULL != out); ai_assert(NULL != pCur && NULL != pCurOut && NULL != out);
register bool ret = true; bool ret = true;
switch (eType) switch (eType)
{ {
case EDT_UInt: case EDT_UInt:

View File

@ -314,7 +314,7 @@ void Q3DImporter::InternReadFile( const std::string& pFile,
if (!tex->mWidth || !tex->mHeight) if (!tex->mWidth || !tex->mHeight)
throw DeadlyImportError("Quick3D: Invalid texture. Width or height is zero"); throw DeadlyImportError("Quick3D: Invalid texture. Width or height is zero");
register unsigned int mul = tex->mWidth * tex->mHeight; unsigned int mul = tex->mWidth * tex->mHeight;
aiTexel* begin = tex->pcData = new aiTexel[mul]; aiTexel* begin = tex->pcData = new aiTexel[mul];
aiTexel* const end = & begin [mul]; aiTexel* const end = & begin [mul];

View File

@ -84,7 +84,7 @@ inline void ArrayDelete(T**& in, unsigned int& num)
// "don't remove" flag not set. Nodes with meshes are never deleted. // "don't remove" flag not set. Nodes with meshes are never deleted.
bool UpdateNodeGraph(aiNode* node,std::list<aiNode*>& childsOfParent,bool root) bool UpdateNodeGraph(aiNode* node,std::list<aiNode*>& childsOfParent,bool root)
{ {
register bool b = false; bool b = false;
std::list<aiNode*> mine; std::list<aiNode*> mine;
for (unsigned int i = 0; i < node->mNumChildren;++i) for (unsigned int i = 0; i < node->mNumChildren;++i)
@ -271,7 +271,7 @@ bool RemoveVCProcess::ProcessMesh(aiMesh* pMesh)
} }
// handle texture coordinates // handle texture coordinates
register bool b = (0 != (configDeleteFlags & aiComponent_TEXCOORDS)); bool b = (0 != (configDeleteFlags & aiComponent_TEXCOORDS));
for (unsigned int i = 0, real = 0; real < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++real) for (unsigned int i = 0, real = 0; real < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++real)
{ {
if (!pMesh->mTextureCoords[i])break; if (!pMesh->mTextureCoords[i])break;

View File

@ -289,7 +289,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene)
for (unsigned int q = 0; q < in.mNumIndices; ++q) for (unsigned int q = 0; q < in.mNumIndices; ++q)
{ {
register unsigned int idx = in.mIndices[q]; unsigned int idx = in.mIndices[q];
// process all bones of this index // process all bones of this index
if (avw) if (avw)

View File

@ -137,7 +137,7 @@ inline int ASSIMP_stricmp(const char *s1, const char *s2)
return ::strcasecmp(s1,s2); return ::strcasecmp(s1,s2);
#else #else
register char c1, c2; char c1, c2;
do { do {
c1 = tolower(*s1++); c1 = tolower(*s1++);
c2 = tolower(*s2++); c2 = tolower(*s2++);
@ -156,7 +156,7 @@ inline int ASSIMP_stricmp(const char *s1, const char *s2)
*/ */
inline int ASSIMP_stricmp(const std::string& a, const std::string& b) inline int ASSIMP_stricmp(const std::string& a, const std::string& b)
{ {
register int i = (int)b.length()-(int)a.length(); int i = (int)b.length()-(int)a.length();
return (i ? i : ASSIMP_stricmp(a.c_str(),b.c_str())); return (i ? i : ASSIMP_stricmp(a.c_str(),b.c_str()));
} }
@ -186,7 +186,7 @@ inline int ASSIMP_strincmp(const char *s1, const char *s2, unsigned int n)
return ::strncasecmp(s1,s2, n); return ::strncasecmp(s1,s2, n);
#else #else
register char c1, c2; char c1, c2;
unsigned int p = 0; unsigned int p = 0;
do do
{ {

View File

@ -225,7 +225,7 @@ void TerragenImporter::InternReadFile( const std::string& pFile,
// make verts // make verts
const float fy = (float)yy, fx = (float)xx; const float fy = (float)yy, fx = (float)xx;
register unsigned tmp,tmp2; unsigned tmp,tmp2;
*pv++ = aiVector3D(fx,fy, (float)data[(tmp2=x*yy) + xx] * hscale + bheight); *pv++ = aiVector3D(fx,fy, (float)data[(tmp2=x*yy) + xx] * hscale + bheight);
*pv++ = aiVector3D(fx,fy+1, (float)data[(tmp=x*(yy+1)) + xx] * hscale + bheight); *pv++ = aiVector3D(fx,fy+1, (float)data[(tmp=x*(yy+1)) + xx] * hscale + bheight);
*pv++ = aiVector3D(fx+1,fy+1,(float)data[tmp + xx+1] * hscale + bheight); *pv++ = aiVector3D(fx+1,fy+1,(float)data[tmp + xx+1] * hscale + bheight);

View File

@ -120,7 +120,7 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
* offset 2 and 3) * offset 2 and 3)
*/ */
if ((rounded = (int)info.mTranslation.x)) { if ((rounded = (int)info.mTranslation.x)) {
float out; float out = 0.0f;
szTemp[0] = 0; szTemp[0] = 0;
if (aiTextureMapMode_Wrap == info.mapU) { if (aiTextureMapMode_Wrap == info.mapU) {
// Wrap - simple take the fraction of the field // Wrap - simple take the fraction of the field
@ -153,7 +153,7 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
* offset 2 and 3) * offset 2 and 3)
*/ */
if ((rounded = (int)info.mTranslation.y)) { if ((rounded = (int)info.mTranslation.y)) {
float out; float out = 0.0f;
szTemp[0] = 0; szTemp[0] = 0;
if (aiTextureMapMode_Wrap == info.mapV) { if (aiTextureMapMode_Wrap == info.mapV) {
// Wrap - simple take the fraction of the field // Wrap - simple take the fraction of the field

View File

@ -1432,7 +1432,7 @@ aiColor3D XFileParser::ReadRGB()
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Throws an exception with a line number and the given text. // Throws an exception with a line number and the given text.
void XFileParser::ThrowException( const std::string& pText) AI_WONT_RETURN void XFileParser::ThrowException( const std::string& pText)
{ {
if( mIsBinaryFormat) if( mIsBinaryFormat)
throw DeadlyImportError( pText); throw DeadlyImportError( pText);

View File

@ -134,7 +134,7 @@ protected:
aiColor4D ReadRGBA(); aiColor4D ReadRGBA();
/** Throws an exception with a line number and the given text. */ /** Throws an exception with a line number and the given text. */
void ThrowException( const std::string& pText); AI_WONT_RETURN void ThrowException( const std::string& pText) AI_WONT_RETURN_SUFFIX;
/** Filters the imported hierarchy for some degenerated cases that some exporters produce. /** Filters the imported hierarchy for some degenerated cases that some exporters produce.
* @param pData The sub-hierarchy to filter * @param pData The sub-hierarchy to filter

View File

@ -102,7 +102,7 @@ public:
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
//! Virtual destructor //! Virtual destructor
virtual ~CIrrXML_IOStreamReader() {}; virtual ~CIrrXML_IOStreamReader() {}
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
//! Reads an amount of bytes from the file. //! Reads an amount of bytes from the file.

View File

@ -624,8 +624,8 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Private, do not use. */ /** Private, do not use. */
ImporterPimpl* Pimpl() { return pimpl; }; ImporterPimpl* Pimpl() { return pimpl; }
const ImporterPimpl* Pimpl() const { return pimpl; }; const ImporterPimpl* Pimpl() const { return pimpl; }
protected: protected:

View File

@ -99,7 +99,7 @@ public:
virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
Update( f * 0.5f ); Update( f * 0.5f );
}; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** @brief Progress callback for post-processing steps /** @brief Progress callback for post-processing steps
@ -113,7 +113,7 @@ public:
virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
Update( f * 0.5f + 0.5f ); Update( f * 0.5f + 0.5f );
}; }
}; // !class ProgressHandler }; // !class ProgressHandler
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------

View File

@ -162,8 +162,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# define AI_FORCE_INLINE inline # define AI_FORCE_INLINE inline
#endif // (defined _MSC_VER) #endif // (defined _MSC_VER)
#ifdef __clang__ #ifdef __GNUC__
# define AI_WONT_RETURN_SUFFIX __attribute__((analyzer_noreturn)) # define AI_WONT_RETURN_SUFFIX __attribute__((noreturn))
#else #else
# define AI_WONT_RETURN_SUFFIX # define AI_WONT_RETURN_SUFFIX
#endif // (defined __clang__) #endif // (defined __clang__)

View File

@ -221,7 +221,7 @@ public:
private: private:
/* Report failure */ /* Report failure */
void failure(const std::string& err, const std::string& name) { AI_WONT_RETURN void failure(const std::string& err, const std::string& name) AI_WONT_RETURN_SUFFIX {
std::stringstream ss; std::stringstream ss;
throw compare_fails_exception((ss throw compare_fails_exception((ss
<< "Files are different at " << "Files are different at "