# some fixes to reduce the size of the binary. Total savings are ~3%. Thanks to Krishty for his efforts in that regard.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@939 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2011-04-03 15:12:05 +00:00
parent 45d6647ffe
commit 85cd9be46d
7 changed files with 62 additions and 31 deletions

View File

@@ -94,22 +94,26 @@ public:
// ----------------------------------------------------------------------
/** @brief Writes a debug message
* @param message Debug message*/
void debug(const std::string &message);
void debug(const char* message);
inline void debug(const std::string &message);
// ----------------------------------------------------------------------
/** @brief Writes a info message
* @param message Info message*/
void info(const std::string &message);
void info(const char* message);
inline void info(const std::string &message);
// ----------------------------------------------------------------------
/** @brief Writes a warning message
* @param message Warn message*/
void warn(const std::string &message);
void warn(const char* message);
inline void warn(const std::string &message);
// ----------------------------------------------------------------------
/** @brief Writes an error message
* @param message Error message*/
void error(const std::string &message);
void error(const char* message);
inline void error(const std::string &message);
// ----------------------------------------------------------------------
/** @brief Set a new log severity.
@@ -227,6 +231,30 @@ inline Logger::LogSeverity Logger::getLogSeverity() const {
return m_Severity;
}
// ----------------------------------------------------------------------------------
inline void Logger::debug(const std::string &message)
{
return debug(message.c_str());
}
// ----------------------------------------------------------------------------------
inline void Logger::error(const std::string &message)
{
return error(message.c_str());
}
// ----------------------------------------------------------------------------------
inline void Logger::warn(const std::string &message)
{
return warn(message.c_str());
}
// ----------------------------------------------------------------------------------
inline void Logger::info(const std::string &message)
{
return info(message.c_str());
}
// ----------------------------------------------------------------------------------
} // Namespace Assimp

View File

@@ -219,7 +219,7 @@ struct aiColor3D
*
* The character set of an aiString is explicitly defined to be UTF-8. This Unicode
* transformation was chosen in the belief that most strings in 3d files are limited
* to the ASCII characters, thus the character set needed to be ASCII compatible.
* to ASCII, thus the character set needed to be strictly ASCII compatible.
*
* Most text file loaders provide proper Unicode input file handling, special unicode
* characters are correctly transcoded to UTF8 and are kept throughout the libraries'
@@ -275,7 +275,7 @@ struct aiString
return;
}
length = pString.length();
::memcpy( data, pString.c_str(), length);
memcpy( data, pString.c_str(), length);
data[length] = 0;
}
@@ -286,7 +286,7 @@ struct aiString
return;
}
length = len;
::memcpy( data, sz, len);
memcpy( data, sz, len);
data[len] = 0;
}
@@ -304,17 +304,17 @@ struct aiString
/** Comparison operator */
bool operator==(const aiString& other) const {
return (length == other.length && 0 == strcmp(this->data,other.data));
return (length == other.length && 0 == memcmp(data,other.data,length));
}
/** Inverse comparison operator */
bool operator!=(const aiString& other) const {
return (length != other.length || 0 != ::strcmp(this->data,other.data));
return (length != other.length || 0 != memcmp(data,other.data,length));
}
/** Append a string to the string */
void Append (const char* app) {
const size_t len = ::strlen(app);
const size_t len = strlen(app);
if (!len) {
return;
}