From f75bf6d99c587e4ab06b190d2718e46ca60b7b77 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Fri, 21 Sep 2018 16:25:27 +0200 Subject: [PATCH] MAke noexcept compiler-specific. --- code/3DSHelper.h | 8 ++++---- code/AMFImporter.hpp | 2 +- code/ASEParser.h | 14 +++++++------- code/BaseImporter.cpp | 2 +- code/BaseProcess.cpp | 2 +- code/BaseProcess.h | 2 +- code/Importer.h | 4 ++-- code/LWOAnimation.h | 4 ++-- code/LWOFileData.h | 2 +- code/LimitBoneWeightsProcess.h | 2 +- code/MD3Loader.h | 4 ++-- code/MD5Parser.h | 2 +- code/MDCFileData.h | 2 +- code/MDLFileData.h | 12 ++++++------ code/OptimizeMeshes.h | 2 +- code/PlyParser.h | 12 ++++++------ code/SMDLoader.h | 8 ++++---- code/ScenePrivate.h | 4 ++-- code/TextureTransform.h | 4 ++-- code/XFileHelper.h | 10 +++++----- contrib/irrXML/irrArray.h | 2 +- include/assimp/BaseImporter.h | 2 +- include/assimp/ByteSwapper.h | 2 +- include/assimp/DefaultIOStream.h | 4 ++-- include/assimp/IOStream.hpp | 4 ++-- include/assimp/IOSystem.hpp | 4 ++-- include/assimp/LogStream.hpp | 4 ++-- include/assimp/Logger.hpp | 4 ++-- include/assimp/ProgressHandler.hpp | 2 +- include/assimp/SGSpatialSort.h | 2 +- include/assimp/SmoothingGroups.h | 2 +- include/assimp/SpatialSort.h | 2 +- include/assimp/anim.h | 16 ++++++++-------- include/assimp/camera.h | 2 +- include/assimp/color4.h | 2 +- include/assimp/defs.h | 10 ++++++++++ include/assimp/light.h | 2 +- include/assimp/material.h | 4 ++-- include/assimp/matrix3x3.h | 2 +- include/assimp/matrix4x4.h | 2 +- include/assimp/matrix4x4.inl | 2 +- include/assimp/mesh.h | 10 +++++----- include/assimp/metadata.h | 2 +- include/assimp/quaternion.h | 2 +- include/assimp/texture.h | 2 +- include/assimp/types.h | 10 +++++----- include/assimp/vector3.h | 2 +- test/unit/utSceneCombiner.cpp | 2 +- 48 files changed, 109 insertions(+), 99 deletions(-) diff --git a/code/3DSHelper.h b/code/3DSHelper.h index aee4aac8c..a904abb20 100644 --- a/code/3DSHelper.h +++ b/code/3DSHelper.h @@ -66,7 +66,7 @@ namespace D3DS { */ class Discreet3DS { private: - Discreet3DS() noexcept { + Discreet3DS() AI_NO_EXCEPT { // empty } @@ -330,7 +330,7 @@ struct Face : public FaceWithSmoothingGroup /** Helper structure representing a texture */ struct Texture { //! Default constructor - Texture() noexcept + Texture() AI_NO_EXCEPT : mOffsetU (0.0) , mOffsetV (0.0) , mScaleU (1.0) @@ -392,7 +392,7 @@ struct Material //! Move constructor. This is explicitly written because MSVC doesn't support defaulting it - Material(Material &&other) noexcept + Material(Material &&other) AI_NO_EXCEPT : mName(std::move(other.mName)) , mDiffuse(std::move(other.mDiffuse)) , mSpecularExponent(std::move(other.mSpecularExponent)) @@ -416,7 +416,7 @@ struct Material } - Material &operator=(Material &&other) noexcept { + Material &operator=(Material &&other) AI_NO_EXCEPT { if (this == &other) { return *this; } diff --git a/code/AMFImporter.hpp b/code/AMFImporter.hpp index 3b2bcd23b..b7e58362c 100644 --- a/code/AMFImporter.hpp +++ b/code/AMFImporter.hpp @@ -392,7 +392,7 @@ private: public: /// Default constructor. - AMFImporter() noexcept + AMFImporter() AI_NO_EXCEPT : mNodeElement_Cur(nullptr) , mReader(nullptr) { // empty diff --git a/code/ASEParser.h b/code/ASEParser.h index ad0e42e74..1b5f34d6b 100644 --- a/code/ASEParser.h +++ b/code/ASEParser.h @@ -85,7 +85,7 @@ struct Material : public D3DS::Material //! Move constructor. This is explicitly written because MSVC doesn't support defaulting it - Material(Material &&other) noexcept + Material(Material &&other) AI_NO_EXCEPT : D3DS::Material(std::move(other)) , avSubMaterials(std::move(other.avSubMaterials)) , pcInstance(std::move(other.pcInstance)) @@ -95,7 +95,7 @@ struct Material : public D3DS::Material } - Material &operator=(Material &&other) noexcept { + Material &operator=(Material &&other) AI_NO_EXCEPT { if (this == &other) { return *this; } @@ -129,7 +129,7 @@ struct Material : public D3DS::Material /** Helper structure to represent an ASE file face */ struct Face : public FaceWithSmoothingGroup { //! Default constructor. Initializes everything with 0 - Face() noexcept + Face() AI_NO_EXCEPT : amUVIndices{0} , mColorIndices{0} , iMaterial(DEFAULT_MATINDEX) @@ -197,7 +197,7 @@ struct Animation TCB = 0x2 } mRotationType, mScalingType, mPositionType; - Animation() noexcept + Animation() AI_NO_EXCEPT : mRotationType (TRACK) , mScalingType (TRACK) , mPositionType (TRACK) @@ -218,7 +218,7 @@ struct Animation /** Helper structure to represent the inheritance information of an ASE node */ struct InheritanceInfo { //! Default constructor - InheritanceInfo() noexcept + InheritanceInfo() AI_NO_EXCEPT : abInheritPosition{true} , abInheritRotation{true} , abInheritScaling{true} { @@ -389,7 +389,7 @@ struct Camera : public BaseNode /** Helper structure to represent an ASE helper object (dummy) */ struct Dummy : public BaseNode { //! Constructor - Dummy() noexcept + Dummy() AI_NO_EXCEPT : BaseNode (BaseNode::Dummy, "DUMMY") { // empty } @@ -408,7 +408,7 @@ struct Dummy : public BaseNode { */ class Parser { private: - Parser() noexcept { + Parser() AI_NO_EXCEPT { // empty } diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index 950fd4d02..f03db189f 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -65,7 +65,7 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer -BaseImporter::BaseImporter() noexcept +BaseImporter::BaseImporter() AI_NO_EXCEPT : m_progress() { // nothing to do here } diff --git a/code/BaseProcess.cpp b/code/BaseProcess.cpp index e7ddce2b0..154b586d2 100644 --- a/code/BaseProcess.cpp +++ b/code/BaseProcess.cpp @@ -53,7 +53,7 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer -BaseProcess::BaseProcess() noexcept +BaseProcess::BaseProcess() AI_NO_EXCEPT : shared() , progress() { diff --git a/code/BaseProcess.h b/code/BaseProcess.h index 0fb348fa5..b09fc732e 100644 --- a/code/BaseProcess.h +++ b/code/BaseProcess.h @@ -216,7 +216,7 @@ class ASSIMP_API_WINONLY BaseProcess { public: /** Constructor to be privately used by Importer */ - BaseProcess() noexcept; + BaseProcess() AI_NO_EXCEPT; /** Destructor, private as well */ virtual ~BaseProcess(); diff --git a/code/Importer.h b/code/Importer.h index c85913f2e..c6628c428 100644 --- a/code/Importer.h +++ b/code/Importer.h @@ -120,11 +120,11 @@ public: SharedPostProcessInfo* mPPShared; /// The default class constructor. - ImporterPimpl() noexcept; + ImporterPimpl() AI_NO_EXCEPT; }; inline -ImporterPimpl::ImporterPimpl() noexcept +ImporterPimpl::ImporterPimpl() AI_NO_EXCEPT : mIOHandler( nullptr ) , mIsDefaultHandler( false ) , mProgressHandler( nullptr ) diff --git a/code/LWOAnimation.h b/code/LWOAnimation.h index 7edda5cc6..f7b0f177b 100644 --- a/code/LWOAnimation.h +++ b/code/LWOAnimation.h @@ -114,7 +114,7 @@ enum PrePostBehaviour /** \brief Data structure for a LWO animation keyframe */ struct Key { - Key() noexcept + Key() AI_NO_EXCEPT : time() , value() , inter(IT_LINE) @@ -145,7 +145,7 @@ struct Key { /** \brief Data structure for a LWO animation envelope */ struct Envelope { - Envelope() noexcept + Envelope() AI_NO_EXCEPT : index() , type(EnvelopeType_Unknown) , pre(PrePostBehaviour_Constant) diff --git a/code/LWOFileData.h b/code/LWOFileData.h index ec16f4b2d..b3a963199 100644 --- a/code/LWOFileData.h +++ b/code/LWOFileData.h @@ -263,7 +263,7 @@ namespace LWO { */ struct Face : public aiFace { //! Default construction - Face() noexcept + Face() AI_NO_EXCEPT : surfaceIndex( 0 ) , smoothGroup( 0 ) , type( AI_LWO_FACE ) { diff --git a/code/LimitBoneWeightsProcess.h b/code/LimitBoneWeightsProcess.h index 6d31b1688..2161b89a8 100644 --- a/code/LimitBoneWeightsProcess.h +++ b/code/LimitBoneWeightsProcess.h @@ -120,7 +120,7 @@ public: { unsigned int mBone; ///< Index of the bone float mWeight; ///< Weight of that bone on this vertex - Weight() noexcept + Weight() AI_NO_EXCEPT : mBone(0) , mWeight(0.0f) { } diff --git a/code/MD3Loader.h b/code/MD3Loader.h index d1ea4bef0..8ac3cdc68 100644 --- a/code/MD3Loader.h +++ b/code/MD3Loader.h @@ -125,7 +125,7 @@ enum AlphaTestFunc */ struct ShaderMapBlock { - ShaderMapBlock() noexcept + ShaderMapBlock() AI_NO_EXCEPT : blend_src (BLEND_NONE) , blend_dest (BLEND_NONE) , alpha_test (AT_NONE) @@ -150,7 +150,7 @@ struct ShaderMapBlock */ struct ShaderDataBlock { - ShaderDataBlock() noexcept + ShaderDataBlock() AI_NO_EXCEPT : cull (CULL_CW) {} diff --git a/code/MD5Parser.h b/code/MD5Parser.h index 60f3326df..853268424 100644 --- a/code/MD5Parser.h +++ b/code/MD5Parser.h @@ -193,7 +193,7 @@ typedef std::vector< FrameDesc > FrameList; /** Represents a vertex descriptor in a MD5 file */ struct VertexDesc { - VertexDesc() noexcept + VertexDesc() AI_NO_EXCEPT : mFirstWeight(0) , mNumWeights(0) { // empty diff --git a/code/MDCFileData.h b/code/MDCFileData.h index 3d93390f0..8e9bdfe6c 100644 --- a/code/MDCFileData.h +++ b/code/MDCFileData.h @@ -118,7 +118,7 @@ struct Surface uint32_t ulOffsetFrameBaseFrames ; uint32_t ulOffsetFrameCompFrames ; uint32_t ulOffsetEnd; - Surface() noexcept + Surface() AI_NO_EXCEPT : ulIdent() , ucName{ 0 } , ulFlags() diff --git a/code/MDLFileData.h b/code/MDLFileData.h index 0446685cc..831986f60 100644 --- a/code/MDLFileData.h +++ b/code/MDLFileData.h @@ -717,7 +717,7 @@ struct GroupFrame */ struct IntFace_MDL7 { // provide a constructor for our own convenience - IntFace_MDL7() noexcept + IntFace_MDL7() AI_NO_EXCEPT : mIndices { 0 } , iMatIndex{ 0 } { // empty @@ -738,7 +738,7 @@ struct IntFace_MDL7 { */ struct IntMaterial_MDL7 { // provide a constructor for our own convenience - IntMaterial_MDL7() noexcept + IntMaterial_MDL7() AI_NO_EXCEPT : pcMat( nullptr ) , iOldMatIndices{ 0 } { // empty @@ -759,7 +759,7 @@ struct IntMaterial_MDL7 { struct IntBone_MDL7 : aiBone { //! Default constructor - IntBone_MDL7() noexcept : iParent (0xffff) + IntBone_MDL7() AI_NO_EXCEPT : iParent (0xffff) { pkeyPositions.reserve(30); pkeyScalings.reserve(30); @@ -804,7 +804,7 @@ struct IntFrameInfo_MDL7 struct IntGroupInfo_MDL7 { //! Default constructor - IntGroupInfo_MDL7() noexcept + IntGroupInfo_MDL7() AI_NO_EXCEPT : iIndex(0) , pcGroup(nullptr) , pcGroupUVs(nullptr) @@ -841,7 +841,7 @@ struct IntGroupInfo_MDL7 //! Holds the data that belongs to a MDL7 mesh group struct IntGroupData_MDL7 { - IntGroupData_MDL7() noexcept + IntGroupData_MDL7() AI_NO_EXCEPT : bNeed2UV(false) {} @@ -872,7 +872,7 @@ struct IntGroupData_MDL7 //! Holds data from an MDL7 file that is shared by all mesh groups struct IntSharedData_MDL7 { //! Default constructor - IntSharedData_MDL7() noexcept + IntSharedData_MDL7() AI_NO_EXCEPT : apcOutBones(), iNum() { diff --git a/code/OptimizeMeshes.h b/code/OptimizeMeshes.h index bb36c03f4..3ebe60cd8 100644 --- a/code/OptimizeMeshes.h +++ b/code/OptimizeMeshes.h @@ -77,7 +77,7 @@ public: /** @brief Internal utility to store additional mesh info */ struct MeshInfo { - MeshInfo() noexcept + MeshInfo() AI_NO_EXCEPT : instance_cnt(0) , vertex_format(0) , output_id(0xffffffff) { diff --git a/code/PlyParser.h b/code/PlyParser.h index 265fe81b3..b544c3b04 100644 --- a/code/PlyParser.h +++ b/code/PlyParser.h @@ -209,7 +209,7 @@ enum EElementSemantic { class Property { public: //! Default constructor - Property() noexcept + Property() AI_NO_EXCEPT : eType (EDT_Int) , Semantic() , bIsList(false) @@ -257,7 +257,7 @@ public: class Element { public: //! Default constructor - Element() noexcept + Element() AI_NO_EXCEPT : eSemantic (EEST_INVALID) , NumOccur(0) { // empty @@ -297,7 +297,7 @@ class PropertyInstance public: //! Default constructor - PropertyInstance() noexcept { + PropertyInstance() AI_NO_EXCEPT { // empty } @@ -360,7 +360,7 @@ public: class ElementInstance { public: //! Default constructor - ElementInstance() noexcept + ElementInstance() AI_NO_EXCEPT : alProperties() { // empty } @@ -387,7 +387,7 @@ class ElementInstanceList public: //! Default constructor - ElementInstanceList() noexcept + ElementInstanceList() AI_NO_EXCEPT : alInstances() { // empty } @@ -414,7 +414,7 @@ class DOM public: //! Default constructor - DOM() noexcept + DOM() AI_NO_EXCEPT : alElements() , alElementData() { diff --git a/code/SMDLoader.h b/code/SMDLoader.h index 09cfef77f..40c08385f 100644 --- a/code/SMDLoader.h +++ b/code/SMDLoader.h @@ -69,7 +69,7 @@ namespace SMD { /** Data structure for a vertex in a SMD file */ struct Vertex { - Vertex() noexcept + Vertex() AI_NO_EXCEPT : iParentNode(UINT_MAX) { // empty } @@ -91,7 +91,7 @@ struct Vertex { /** Data structure for a face in a SMD file */ struct Face { - Face() noexcept + Face() AI_NO_EXCEPT : iTexture(0x0) , avVertices{} { // empty @@ -109,7 +109,7 @@ struct Face { */ struct Bone { //! Default constructor - Bone() noexcept + Bone() AI_NO_EXCEPT : iParent(UINT_MAX) , bIsUsed(false) { // empty @@ -129,7 +129,7 @@ struct Bone { //! Animation of the bone struct Animation { //! Public default constructor - Animation() noexcept + Animation() AI_NO_EXCEPT : iFirstTimeKey() { asKeys.reserve(20); } diff --git a/code/ScenePrivate.h b/code/ScenePrivate.h index dc6e07d70..775b9cb52 100644 --- a/code/ScenePrivate.h +++ b/code/ScenePrivate.h @@ -56,7 +56,7 @@ class Importer; struct ScenePrivateData { // The struct constructor. - ScenePrivateData() noexcept; + ScenePrivateData() AI_NO_EXCEPT; // Importer that originally loaded the scene though the C-API // If set, this object is owned by this private data instance. @@ -74,7 +74,7 @@ struct ScenePrivateData { }; inline -ScenePrivateData::ScenePrivateData() noexcept +ScenePrivateData::ScenePrivateData() AI_NO_EXCEPT : mOrigImporter( nullptr ) , mPPStepsApplied( 0 ) , mIsCopy( false ) { diff --git a/code/TextureTransform.h b/code/TextureTransform.h index 241c52030..99d5acf1e 100644 --- a/code/TextureTransform.h +++ b/code/TextureTransform.h @@ -66,7 +66,7 @@ namespace Assimp { * to be able to update some values quickly. */ struct TTUpdateInfo { - TTUpdateInfo() noexcept + TTUpdateInfo() AI_NO_EXCEPT : directShortcut(nullptr) , mat(nullptr) , semantic(0) @@ -89,7 +89,7 @@ struct TTUpdateInfo { /** Helper class representing texture coordinate transformations */ struct STransformVecInfo : public aiUVTransform { - STransformVecInfo() noexcept + STransformVecInfo() AI_NO_EXCEPT : uvIndex(0) , mapU(aiTextureMapMode_Wrap) , mapV(aiTextureMapMode_Wrap) diff --git a/code/XFileHelper.h b/code/XFileHelper.h index 0435c91df..c51e2eba9 100644 --- a/code/XFileHelper.h +++ b/code/XFileHelper.h @@ -68,7 +68,7 @@ struct TexEntry { std::string mName; bool mIsNormalMap; // true if the texname was specified in a NormalmapFilename tag - TexEntry() noexcept + TexEntry() AI_NO_EXCEPT : mName() , mIsNormalMap(false) { // empty @@ -91,7 +91,7 @@ struct Material { std::vector mTextures; size_t sceneIndex; ///< the index under which it was stored in the scene's material list - Material() noexcept + Material() AI_NO_EXCEPT : mIsReference(false) , mSpecularExponent() , sceneIndex(SIZE_MAX) { @@ -130,7 +130,7 @@ struct Mesh { std::vector mBones; - explicit Mesh(const std::string &pName = "") noexcept + explicit Mesh(const std::string &pName = "") AI_NO_EXCEPT : mName( pName ) , mPositions() , mPosFaces() @@ -155,7 +155,7 @@ struct Node { std::vector mChildren; std::vector mMeshes; - Node() noexcept + Node() AI_NO_EXCEPT : mName() , mTrafoMatrix() , mParent(nullptr) @@ -220,7 +220,7 @@ struct Scene std::vector mAnims; unsigned int mAnimTicksPerSecond; - Scene() noexcept + Scene() AI_NO_EXCEPT : mRootNode(nullptr) , mGlobalMeshes() , mGlobalMaterials() diff --git a/contrib/irrXML/irrArray.h b/contrib/irrXML/irrArray.h index ec1021d17..51302680e 100644 --- a/contrib/irrXML/irrArray.h +++ b/contrib/irrXML/irrArray.h @@ -21,7 +21,7 @@ class array { public: - array() noexcept + array() : data(0), allocated(0), used(0), free_when_destroyed(true), is_sorted(true) { diff --git a/include/assimp/BaseImporter.h b/include/assimp/BaseImporter.h index e4e0412cf..b218d06ff 100644 --- a/include/assimp/BaseImporter.h +++ b/include/assimp/BaseImporter.h @@ -83,7 +83,7 @@ class ASSIMP_API BaseImporter { public: /** Constructor to be privately used by #Importer */ - BaseImporter() noexcept; + BaseImporter() AI_NO_EXCEPT; /** Destructor, private as well */ virtual ~BaseImporter(); diff --git a/include/assimp/ByteSwapper.h b/include/assimp/ByteSwapper.h index 9db172426..322a242de 100644 --- a/include/assimp/ByteSwapper.h +++ b/include/assimp/ByteSwapper.h @@ -61,7 +61,7 @@ namespace Assimp { * and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */ // -------------------------------------------------------------------------------------- class ByteSwap { - ByteSwap() noexcept {} + ByteSwap() AI_NO_EXCEPT {} public: diff --git a/include/assimp/DefaultIOStream.h b/include/assimp/DefaultIOStream.h index 9633ed002..e0e010ecb 100644 --- a/include/assimp/DefaultIOStream.h +++ b/include/assimp/DefaultIOStream.h @@ -69,7 +69,7 @@ class ASSIMP_API DefaultIOStream : public IOStream #endif // __ANDROID__ protected: - DefaultIOStream() noexcept; + DefaultIOStream() AI_NO_EXCEPT; DefaultIOStream(FILE* pFile, const std::string &strFilename); public: @@ -117,7 +117,7 @@ private: // ---------------------------------------------------------------------------------- inline -DefaultIOStream::DefaultIOStream() noexcept +DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT : mFile(nullptr) , mFilename("") , mCachedSize(SIZE_MAX) { diff --git a/include/assimp/IOStream.hpp b/include/assimp/IOStream.hpp index 30132cdbb..52b80cc15 100644 --- a/include/assimp/IOStream.hpp +++ b/include/assimp/IOStream.hpp @@ -71,7 +71,7 @@ class ASSIMP_API IOStream { protected: /** Constructor protected, use IOSystem::Open() to create an instance. */ - IOStream() noexcept; + IOStream() AI_NO_EXCEPT; public: // ------------------------------------------------------------------- @@ -126,7 +126,7 @@ public: // ---------------------------------------------------------------------------------- inline -IOStream::IOStream() noexcept { +IOStream::IOStream() AI_NO_EXCEPT { // empty } diff --git a/include/assimp/IOSystem.hpp b/include/assimp/IOSystem.hpp index 5434fd36a..a36e22508 100644 --- a/include/assimp/IOSystem.hpp +++ b/include/assimp/IOSystem.hpp @@ -95,7 +95,7 @@ public: * Create an instance of your derived class and assign it to an * #Assimp::Importer instance by calling Importer::SetIOHandler(). */ - IOSystem() noexcept; + IOSystem() AI_NO_EXCEPT; // ------------------------------------------------------------------- /** @brief Virtual destructor. @@ -230,7 +230,7 @@ private: // ---------------------------------------------------------------------------- AI_FORCE_INLINE -IOSystem::IOSystem() noexcept +IOSystem::IOSystem() AI_NO_EXCEPT : m_pathStack() { // empty } diff --git a/include/assimp/LogStream.hpp b/include/assimp/LogStream.hpp index 84bffdaa5..e0eb8d505 100644 --- a/include/assimp/LogStream.hpp +++ b/include/assimp/LogStream.hpp @@ -65,7 +65,7 @@ class ASSIMP_API LogStream { protected: /** @brief Default constructor */ - LogStream() noexcept; + LogStream() AI_NO_EXCEPT; public: /** @brief Virtual destructor */ @@ -96,7 +96,7 @@ public: }; // !class LogStream inline -LogStream::LogStream() noexcept { +LogStream::LogStream() AI_NO_EXCEPT { // empty } diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index b59817e47..6a9928735 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -161,7 +161,7 @@ protected: /** * Default constructor */ - Logger() noexcept; + Logger() AI_NO_EXCEPT; /** * Construction with a given log severity @@ -215,7 +215,7 @@ protected: // ---------------------------------------------------------------------------------- // Default constructor inline -Logger::Logger() noexcept +Logger::Logger() AI_NO_EXCEPT : m_Severity(NORMAL) { // empty } diff --git a/include/assimp/ProgressHandler.hpp b/include/assimp/ProgressHandler.hpp index 020d190fa..0fa1501d4 100644 --- a/include/assimp/ProgressHandler.hpp +++ b/include/assimp/ProgressHandler.hpp @@ -63,7 +63,7 @@ class ASSIMP_API ProgressHandler { protected: /** @brief Default constructor */ - ProgressHandler () noexcept { + ProgressHandler () AI_NO_EXCEPT { } public: /** @brief Virtual destructor */ diff --git a/include/assimp/SGSpatialSort.h b/include/assimp/SGSpatialSort.h index a03701932..3c95d0b51 100644 --- a/include/assimp/SGSpatialSort.h +++ b/include/assimp/SGSpatialSort.h @@ -120,7 +120,7 @@ protected: uint32_t mSmoothGroups; float mDistance; ///< Distance of this vertex to the sorting plane - Entry() noexcept + Entry() AI_NO_EXCEPT : mIndex(0) , mPosition() , mSmoothGroups(0) diff --git a/include/assimp/SmoothingGroups.h b/include/assimp/SmoothingGroups.h index 2ca81d756..88345c66a 100644 --- a/include/assimp/SmoothingGroups.h +++ b/include/assimp/SmoothingGroups.h @@ -53,7 +53,7 @@ http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */ // --------------------------------------------------------------------------- /** Helper structure representing a face with smoothing groups assigned */ struct FaceWithSmoothingGroup { - FaceWithSmoothingGroup() noexcept + FaceWithSmoothingGroup() AI_NO_EXCEPT : mIndices() , iSmoothGroup(0) { // in debug builds set all indices to a common magic value diff --git a/include/assimp/SpatialSort.h b/include/assimp/SpatialSort.h index 16022b5dd..8fb450841 100644 --- a/include/assimp/SpatialSort.h +++ b/include/assimp/SpatialSort.h @@ -153,7 +153,7 @@ protected: aiVector3D mPosition; ///< Position ai_real mDistance; ///< Distance of this vertex to the sorting plane - Entry() noexcept + Entry() AI_NO_EXCEPT : mIndex( 999999999 ), mPosition(), mDistance( 99999. ) { // empty } diff --git a/include/assimp/anim.h b/include/assimp/anim.h index 4b4c4370c..8a0984192 100644 --- a/include/assimp/anim.h +++ b/include/assimp/anim.h @@ -70,7 +70,7 @@ struct aiVectorKey #ifdef __cplusplus /// @brief The default constructor. - aiVectorKey() noexcept + aiVectorKey() AI_NO_EXCEPT : mTime( 0.0 ) , mValue() { // empty @@ -116,7 +116,7 @@ struct aiQuatKey C_STRUCT aiQuaternion mValue; #ifdef __cplusplus - aiQuatKey() noexcept + aiQuatKey() AI_NO_EXCEPT : mTime( 0.0 ) , mValue() { // empty @@ -163,7 +163,7 @@ struct aiMeshKey #ifdef __cplusplus - aiMeshKey() noexcept + aiMeshKey() AI_NO_EXCEPT : mTime(0.0) , mValue(0) { @@ -210,7 +210,7 @@ struct aiMeshMorphKey /** The number of values and weights */ unsigned int mNumValuesAndWeights; #ifdef __cplusplus - aiMeshMorphKey() noexcept + aiMeshMorphKey() AI_NO_EXCEPT : mTime(0.0) , mValues(nullptr) , mWeights(nullptr) @@ -324,7 +324,7 @@ struct aiNodeAnim { C_ENUM aiAnimBehaviour mPostState; #ifdef __cplusplus - aiNodeAnim() noexcept + aiNodeAnim() AI_NO_EXCEPT : mNumPositionKeys( 0 ) , mPositionKeys( nullptr ) , mNumRotationKeys( 0 ) @@ -366,7 +366,7 @@ struct aiMeshAnim #ifdef __cplusplus - aiMeshAnim() noexcept + aiMeshAnim() AI_NO_EXCEPT : mNumKeys() , mKeys() {} @@ -397,7 +397,7 @@ struct aiMeshMorphAnim #ifdef __cplusplus - aiMeshMorphAnim() noexcept + aiMeshMorphAnim() AI_NO_EXCEPT : mNumKeys() , mKeys() {} @@ -451,7 +451,7 @@ struct aiAnimation { C_STRUCT aiMeshMorphAnim **mMorphMeshChannels; #ifdef __cplusplus - aiAnimation() noexcept + aiAnimation() AI_NO_EXCEPT : mDuration(-1.) , mTicksPerSecond(0.) , mNumChannels(0) diff --git a/include/assimp/camera.h b/include/assimp/camera.h index 6cd244c41..6fea5a7d7 100644 --- a/include/assimp/camera.h +++ b/include/assimp/camera.h @@ -174,7 +174,7 @@ struct aiCamera #ifdef __cplusplus - aiCamera() noexcept + aiCamera() AI_NO_EXCEPT : mUp (0.f,1.f,0.f) , mLookAt (0.f,0.f,1.f) , mHorizontalFOV (0.25f * (float)AI_MATH_PI) diff --git a/include/assimp/color4.h b/include/assimp/color4.h index bc934731b..570b8f44c 100644 --- a/include/assimp/color4.h +++ b/include/assimp/color4.h @@ -59,7 +59,7 @@ template class aiColor4t { public: - aiColor4t() noexcept : r(), g(), b(), a() {} + aiColor4t() AI_NO_EXCEPT : r(), g(), b(), a() {} aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a) : r(_r), g(_g), b(_b), a(_a) {} explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {} diff --git a/include/assimp/defs.h b/include/assimp/defs.h index b587396bf..e2ce6953d 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -289,4 +289,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type)) +#ifndef _MSC_VER +# define AI_NO_EXCEPT noexcept +#else +# if (_MSC_VER == 1915 ) +# define AI_NO_EXCEPT noexcept +# else +# define AI_NO_EXCEPT +# endif +#endif + #endif // !! AI_DEFINES_H_INC diff --git a/include/assimp/light.h b/include/assimp/light.h index 457b55950..dc0b8a4b6 100644 --- a/include/assimp/light.h +++ b/include/assimp/light.h @@ -237,7 +237,7 @@ struct aiLight #ifdef __cplusplus - aiLight() noexcept + aiLight() AI_NO_EXCEPT : mType (aiLightSource_UNDEFINED) , mAttenuationConstant (0.f) , mAttenuationLinear (1.f) diff --git a/include/assimp/material.h b/include/assimp/material.h index d88d11b65..45b4844a3 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -483,7 +483,7 @@ struct aiUVTransform #ifdef __cplusplus - aiUVTransform() noexcept + aiUVTransform() AI_NO_EXCEPT : mTranslation (0.0,0.0) , mScaling (1.0,1.0) , mRotation (0.0) @@ -607,7 +607,7 @@ struct aiMaterialProperty #ifdef __cplusplus - aiMaterialProperty() noexcept + aiMaterialProperty() AI_NO_EXCEPT : mSemantic( 0 ) , mIndex( 0 ) , mDataLength( 0 ) diff --git a/include/assimp/matrix3x3.h b/include/assimp/matrix3x3.h index bbb6cb104..4bb55ad21 100644 --- a/include/assimp/matrix3x3.h +++ b/include/assimp/matrix3x3.h @@ -69,7 +69,7 @@ class aiMatrix3x3t { public: - aiMatrix3x3t() noexcept : + aiMatrix3x3t() AI_NO_EXCEPT : a1(static_cast(1.0f)), a2(), a3(), b1(), b2(static_cast(1.0f)), b3(), c1(), c2(), c3(static_cast(1.0f)) {} diff --git a/include/assimp/matrix4x4.h b/include/assimp/matrix4x4.h index b545b73f8..bfa9d3865 100644 --- a/include/assimp/matrix4x4.h +++ b/include/assimp/matrix4x4.h @@ -71,7 +71,7 @@ class aiMatrix4x4t public: /** set to identity */ - aiMatrix4x4t() noexcept; + aiMatrix4x4t() AI_NO_EXCEPT; /** construction from single values */ aiMatrix4x4t ( TReal _a1, TReal _a2, TReal _a3, TReal _a4, diff --git a/include/assimp/matrix4x4.inl b/include/assimp/matrix4x4.inl index a5a41ec25..9920f0059 100644 --- a/include/assimp/matrix4x4.inl +++ b/include/assimp/matrix4x4.inl @@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ---------------------------------------------------------------------------------------- template -aiMatrix4x4t::aiMatrix4x4t() noexcept : +aiMatrix4x4t::aiMatrix4x4t() AI_NO_EXCEPT : a1(1.0f), a2(), a3(), a4(), b1(), b2(1.0f), b3(), b4(), c1(), c2(), c3(1.0f), c4(), diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index 5b4f30a23..f47d5fd00 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -136,7 +136,7 @@ struct aiFace #ifdef __cplusplus //! Default constructor - aiFace() noexcept + aiFace() AI_NO_EXCEPT : mNumIndices( 0 ) , mIndices( nullptr ) { // empty @@ -220,7 +220,7 @@ struct aiVertexWeight { #ifdef __cplusplus //! Default constructor - aiVertexWeight() noexcept + aiVertexWeight() AI_NO_EXCEPT : mVertexId(0) , mWeight(0.0f) { // empty @@ -282,7 +282,7 @@ struct aiBone { #ifdef __cplusplus //! Default constructor - aiBone() noexcept + aiBone() AI_NO_EXCEPT : mName() , mNumWeights( 0 ) , mWeights( nullptr ) @@ -454,7 +454,7 @@ struct aiAnimMesh #ifdef __cplusplus - aiAnimMesh() noexcept + aiAnimMesh() AI_NO_EXCEPT : mVertices( nullptr ) , mNormals(nullptr) , mTangents(nullptr) @@ -715,7 +715,7 @@ struct aiMesh #ifdef __cplusplus //! Default constructor. Initializes all members to 0 - aiMesh() noexcept + aiMesh() AI_NO_EXCEPT : mPrimitiveTypes( 0 ) , mNumVertices( 0 ) , mNumFaces( 0 ) diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index cee03fcec..498e2f6d1 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -129,7 +129,7 @@ struct aiMetadata { /** * @brief The default constructor, set all members to zero by default. */ - aiMetadata() noexcept + aiMetadata() AI_NO_EXCEPT : mNumProperties(0) , mKeys(nullptr) , mValues(nullptr) { diff --git a/include/assimp/quaternion.h b/include/assimp/quaternion.h index 355167efc..e2479f2ed 100644 --- a/include/assimp/quaternion.h +++ b/include/assimp/quaternion.h @@ -60,7 +60,7 @@ template class aiQuaterniont { public: - aiQuaterniont() noexcept : w(1.0), x(), y(), z() {} + aiQuaterniont() AI_NO_EXCEPT : w(1.0), x(), y(), z() {} aiQuaterniont(TReal pw, TReal px, TReal py, TReal pz) : w(pw), x(px), y(py), z(pz) {} diff --git a/include/assimp/texture.h b/include/assimp/texture.h index 5c0670792..49289f28d 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -201,7 +201,7 @@ struct aiTexture { } // Construction - aiTexture() noexcept + aiTexture() AI_NO_EXCEPT : mWidth(0) , mHeight(0) , achFormatHint{ 0 } diff --git a/include/assimp/types.h b/include/assimp/types.h index 593ba8e46..e115a28dc 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -122,7 +122,7 @@ extern "C" { struct aiPlane { #ifdef __cplusplus - aiPlane () noexcept : a(0.f), b(0.f), c(0.f), d(0.f) { + aiPlane () AI_NO_EXCEPT : a(0.f), b(0.f), c(0.f), d(0.f) { } aiPlane (ai_real _a, ai_real _b, ai_real _c, ai_real _d) : a(_a), b(_b), c(_c), d(_d) {} @@ -141,7 +141,7 @@ struct aiPlane struct aiRay { #ifdef __cplusplus - aiRay () noexcept {} + aiRay () AI_NO_EXCEPT {} aiRay (const aiVector3D& _pos, const aiVector3D& _dir) : pos(_pos), dir(_dir) {} @@ -159,7 +159,7 @@ struct aiRay struct aiColor3D { #ifdef __cplusplus - aiColor3D () noexcept : r(0.0f), g(0.0f), b(0.0f) {} + aiColor3D () AI_NO_EXCEPT : r(0.0f), g(0.0f), b(0.0f) {} aiColor3D (ai_real _r, ai_real _g, ai_real _b) : r(_r), g(_g), b(_b) {} explicit aiColor3D (ai_real _r) : r(_r), g(_r), b(_r) {} aiColor3D (const aiColor3D& o) : r(o.r), g(o.g), b(o.b) {} @@ -254,7 +254,7 @@ struct aiString { #ifdef __cplusplus /** Default constructor, the string is set to have zero length */ - aiString() noexcept + aiString() AI_NO_EXCEPT : length( 0 ) , data {0} { data[0] = '\0'; @@ -480,7 +480,7 @@ struct aiMemoryInfo #ifdef __cplusplus /** Default constructor */ - aiMemoryInfo() noexcept + aiMemoryInfo() AI_NO_EXCEPT : textures (0) , materials (0) , meshes (0) diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index 2f59438d3..2c610b3a9 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -66,7 +66,7 @@ template class aiVector3t { public: - aiVector3t() noexcept : x(), y(), z() {} + aiVector3t() AI_NO_EXCEPT : x(), y(), z() {} aiVector3t(TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {} explicit aiVector3t (TReal _xyz ) : x(_xyz), y(_xyz), z(_xyz) {} aiVector3t( const aiVector3t& o ) : x(o.x), y(o.y), z(o.z) {} diff --git a/test/unit/utSceneCombiner.cpp b/test/unit/utSceneCombiner.cpp index 600d7ba9d..3e7ba0146 100644 --- a/test/unit/utSceneCombiner.cpp +++ b/test/unit/utSceneCombiner.cpp @@ -73,7 +73,7 @@ TEST_F( utSceneCombiner, MergeMeshes_ValidNames_Test ) { EXPECT_EQ( "mesh_1.mesh_2.mesh_3", outName ); } -TEST_F( utSceneCombiner, CopySceneWithNullptr_NoException ) { +TEST_F( utSceneCombiner, CopySceneWithNullptr_AI_NO_EXCEPTion ) { EXPECT_NO_THROW( SceneCombiner::CopyScene( nullptr, nullptr ) ); EXPECT_NO_THROW( SceneCombiner::CopySceneFlat( nullptr, nullptr ) ); }