|
@@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
#include <stddef.h>
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <limits.h>
|
|
#include <limits.h>
|
|
|
|
+#include <stdint.h>
|
|
|
|
|
|
// Our compile configuration
|
|
// Our compile configuration
|
|
#include "defs.h"
|
|
#include "defs.h"
|
|
@@ -65,11 +66,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
#include "matrix4x4.h"
|
|
#include "matrix4x4.h"
|
|
#include "quaternion.h"
|
|
#include "quaternion.h"
|
|
|
|
|
|
|
|
+typedef int32_t ai_int32;
|
|
|
|
+typedef uint32_t ai_uint32 ;
|
|
|
|
+
|
|
#ifdef __cplusplus
|
|
#ifdef __cplusplus
|
|
#include <cstring>
|
|
#include <cstring>
|
|
#include <new> // for std::nothrow_t
|
|
#include <new> // for std::nothrow_t
|
|
#include <string> // for aiString::Set(const std::string&)
|
|
#include <string> // for aiString::Set(const std::string&)
|
|
|
|
|
|
|
|
+
|
|
namespace Assimp {
|
|
namespace Assimp {
|
|
//! @cond never
|
|
//! @cond never
|
|
namespace Intern {
|
|
namespace Intern {
|
|
@@ -269,8 +274,8 @@ struct aiString
|
|
}
|
|
}
|
|
|
|
|
|
/** Copy constructor */
|
|
/** Copy constructor */
|
|
- aiString(const aiString& rOther) :
|
|
|
|
- length(rOther.length)
|
|
|
|
|
|
+ aiString(const aiString& rOther)
|
|
|
|
+ : length(rOther.length)
|
|
{
|
|
{
|
|
// Crop the string to the maximum length
|
|
// Crop the string to the maximum length
|
|
length = length>=MAXLEN?MAXLEN-1:length;
|
|
length = length>=MAXLEN?MAXLEN-1:length;
|
|
@@ -280,7 +285,7 @@ struct aiString
|
|
|
|
|
|
/** Constructor from std::string */
|
|
/** Constructor from std::string */
|
|
explicit aiString(const std::string& pString) :
|
|
explicit aiString(const std::string& pString) :
|
|
- length(pString.length())
|
|
|
|
|
|
+ length( (ai_uint32) pString.length())
|
|
{
|
|
{
|
|
length = length>=MAXLEN?MAXLEN-1:length;
|
|
length = length>=MAXLEN?MAXLEN-1:length;
|
|
memcpy( data, pString.c_str(), length);
|
|
memcpy( data, pString.c_str(), length);
|
|
@@ -292,15 +297,15 @@ struct aiString
|
|
if( pString.length() > MAXLEN - 1) {
|
|
if( pString.length() > MAXLEN - 1) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- length = pString.length();
|
|
|
|
|
|
+ length = (ai_uint32)pString.length();
|
|
memcpy( data, pString.c_str(), length);
|
|
memcpy( data, pString.c_str(), length);
|
|
data[length] = 0;
|
|
data[length] = 0;
|
|
}
|
|
}
|
|
|
|
|
|
/** Copy a const char* to the aiString */
|
|
/** Copy a const char* to the aiString */
|
|
void Set( const char* sz) {
|
|
void Set( const char* sz) {
|
|
- const size_t len = ::strlen(sz);
|
|
|
|
- if( len > MAXLEN - 1) {
|
|
|
|
|
|
+ const ai_int32 len = (ai_uint32) ::strlen(sz);
|
|
|
|
+ if( len > (ai_int32)MAXLEN - 1) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
length = len;
|
|
length = len;
|
|
@@ -346,7 +351,7 @@ struct aiString
|
|
|
|
|
|
/** Append a string to the string */
|
|
/** Append a string to the string */
|
|
void Append (const char* app) {
|
|
void Append (const char* app) {
|
|
- const size_t len = ::strlen(app);
|
|
|
|
|
|
+ const ai_uint32 len = (ai_uint32) ::strlen(app);
|
|
if (!len) {
|
|
if (!len) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -379,7 +384,7 @@ struct aiString
|
|
/** Binary length of the string excluding the terminal 0. This is NOT the
|
|
/** Binary length of the string excluding the terminal 0. This is NOT the
|
|
* logical length of strings containing UTF-8 multi-byte sequences! It's
|
|
* logical length of strings containing UTF-8 multi-byte sequences! It's
|
|
* the number of bytes from the beginning of the string to its end.*/
|
|
* the number of bytes from the beginning of the string to its end.*/
|
|
- size_t length;
|
|
|
|
|
|
+ ai_uint32 length;
|
|
|
|
|
|
/** String buffer. Size limit is MAXLEN */
|
|
/** String buffer. Size limit is MAXLEN */
|
|
char data[MAXLEN];
|
|
char data[MAXLEN];
|