Procházet zdrojové kódy

Mark some more functions with AI_WONT_RETURN

Turo Lamminen před 10 roky
rodič
revize
5a74e07f5f

+ 1 - 1
code/ASEParser.cpp

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

+ 1 - 1
code/ASEParser.h

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

+ 2 - 2
code/B3DImporter.cpp

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

+ 2 - 2
code/B3DImporter.h

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

+ 1 - 1
code/BVHLoader.cpp

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

+ 1 - 1
code/BVHLoader.h

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

+ 1 - 1
code/COBLoader.cpp

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

+ 1 - 1
code/COBLoader.h

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

+ 1 - 1
code/ColladaParser.cpp

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

+ 1 - 1
code/ColladaParser.h

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

+ 2 - 1
code/FBXBinaryTokenizer.cpp

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

+ 4 - 2
code/FBXParser.cpp

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

+ 2 - 1
code/FBXTokenizer.cpp

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

+ 1 - 1
code/MD5Parser.cpp

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

+ 1 - 1
code/MD5Parser.h

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

+ 2 - 1
code/OgreXmlSerializer.cpp

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

+ 1 - 1
code/XFileParser.cpp

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

+ 1 - 1
code/XFileParser.h

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

+ 1 - 1
tools/assimp_cmd/CompareDump.cpp

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