Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct escape sequence for unsigned. #2670

Merged
merged 3 commits into from Sep 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/MD2/MD2Loader.cpp
Expand Up @@ -344,7 +344,7 @@ void MD2Importer::InternReadFile( const std::string& pFile,
if (pcSkins->name[0])
{
aiString szString;
const size_t iLen = ::strlen(pcSkins->name);
const ai_uint32 iLen = (ai_uint32) ::strlen(pcSkins->name);
::memcpy(szString.data,pcSkins->name,iLen);
szString.data[iLen] = '\0';
szString.length = iLen;
Expand Down
2 changes: 1 addition & 1 deletion code/MD5/MD5Parser.cpp
Expand Up @@ -235,7 +235,7 @@ bool MD5Parser::ParseSection(Section& out)
const char* szStart = ++sz; \
while('\"'!=*sz)++sz; \
const char* szEnd = (sz++); \
out.length = (size_t)(szEnd - szStart); \
out.length = (ai_uint32) (szEnd - szStart); \
::memcpy(out.data,szStart,out.length); \
out.data[out.length] = '\0';
// ------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion code/PostProcessing/ValidateDataStructure.cpp
Expand Up @@ -958,7 +958,7 @@ void ValidateDSProcess::Validate( const aiString* pString)
{
if (pString->length > MAXLEN)
{
ReportError("aiString::length is too large (%lu, maximum is %lu)",
ReportError("aiString::length is too large (%u, maximum is %lu)",
pString->length,MAXLEN);
}
const char* sz = pString->data;
Expand Down
14 changes: 7 additions & 7 deletions include/assimp/types.h
Expand Up @@ -274,8 +274,8 @@ struct aiString
}

/** Copy constructor */
aiString(const aiString& rOther) :
length(rOther.length)
aiString(const aiString& rOther)
: length(rOther.length)
{
// Crop the string to the maximum length
length = length>=MAXLEN?MAXLEN-1:length;
Expand All @@ -285,7 +285,7 @@ struct aiString

/** Constructor from std::string */
explicit aiString(const std::string& pString) :
length(pString.length())
length( (ai_uint32) pString.length())
{
length = length>=MAXLEN?MAXLEN-1:length;
memcpy( data, pString.c_str(), length);
Expand All @@ -297,15 +297,15 @@ struct aiString
if( pString.length() > MAXLEN - 1) {
return;
}
length = pString.length();
length = (ai_uint32)pString.length();
memcpy( data, pString.c_str(), length);
data[length] = 0;
}

/** Copy a const char* to the aiString */
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;
}
length = len;
Expand Down Expand Up @@ -351,7 +351,7 @@ struct aiString

/** Append a string to the string */
void Append (const char* app) {
const size_t len = ::strlen(app);
const ai_uint32 len = (ai_uint32) ::strlen(app);
if (!len) {
return;
}
Expand Down