diff --git a/code/Assjson/cencode.c b/code/Assjson/cencode.c index db99e7efa..bd302100b 100644 --- a/code/Assjson/cencode.c +++ b/code/Assjson/cencode.c @@ -42,7 +42,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, { state_in->result = result; state_in->step = step_A; - return codechar - code_out; + return (int)(codechar - code_out); } fragment = *plainchar++; result = (fragment & 0x0fc) >> 2; @@ -53,7 +53,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, { state_in->result = result; state_in->step = step_B; - return codechar - code_out; + return (int)(codechar - code_out); } fragment = *plainchar++; result |= (fragment & 0x0f0) >> 4; @@ -64,7 +64,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, { state_in->result = result; state_in->step = step_C; - return codechar - code_out; + return (int)(codechar - code_out); } fragment = *plainchar++; result |= (fragment & 0x0c0) >> 6; @@ -81,7 +81,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, } } /* control should not reach here */ - return codechar - code_out; + return (int)(codechar - code_out); } int base64_encode_blockend(char* code_out, base64_encodestate* state_in) @@ -104,6 +104,6 @@ int base64_encode_blockend(char* code_out, base64_encodestate* state_in) } *codechar++ = '\n'; - return codechar - code_out; + return (int)(codechar - code_out); } diff --git a/code/CSM/CSMLoader.cpp b/code/CSM/CSMLoader.cpp index 9dbb38467..7fea06727 100644 --- a/code/CSM/CSMLoader.cpp +++ b/code/CSM/CSMLoader.cpp @@ -178,7 +178,7 @@ void CSMImporter::InternReadFile( const std::string& pFile, *ot++ = *buffer++; *ot = '\0'; - nda->mNodeName.length = (size_t)(ot-nda->mNodeName.data); + nda->mNodeName.length = (ai_uint32)(ot-nda->mNodeName.data); } anim->mNumChannels = static_cast(anims_temp.size()); diff --git a/code/MDL/MDLLoader.cpp b/code/MDL/MDLLoader.cpp index 027c03cbd..57a6bda95 100644 --- a/code/MDL/MDLLoader.cpp +++ b/code/MDL/MDLLoader.cpp @@ -1575,7 +1575,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( ) const size_t maxSize(buffersize - (i*AI_MDL7_MAX_GROUPNAMESIZE)); pcNode->mName.length = ai_snprintf(szBuffer, maxSize, "Group_%u", p); } else { - pcNode->mName.length = ::strlen(szBuffer); + pcNode->mName.length = (ai_uint32)::strlen(szBuffer); } ::strncpy(pcNode->mName.data,szBuffer,MAXLEN-1); ++p; diff --git a/code/MDL/MDLMaterialLoader.cpp b/code/MDL/MDLMaterialLoader.cpp index 0a196761f..79b57128a 100644 --- a/code/MDL/MDLMaterialLoader.cpp +++ b/code/MDL/MDLMaterialLoader.cpp @@ -541,7 +541,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( size_t iLen2 = iLen+1; iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2; memcpy(szFile.data,(const char*)szCurrent,iLen2); - szFile.length = iLen; + szFile.length = (ai_uint32)iLen; szCurrent += iLen2; @@ -710,7 +710,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( aiString szFile; const size_t iLen = strlen((const char*)szCurrent); ::memcpy(szFile.data,(const char*)szCurrent,iLen+1); - szFile.length = iLen; + szFile.length = (ai_uint32)iLen; pcMatOut->AddProperty(&szFile,AI_MATKEY_TEXTURE_DIFFUSE(0)); @@ -831,7 +831,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( aiString szFile; ::memcpy(szFile.data,pcSkin->texture_name,sizeof(pcSkin->texture_name)); szFile.data[sizeof(pcSkin->texture_name)] = '\0'; - szFile.length = ::strlen(szFile.data); + szFile.length = (ai_uint32)::strlen(szFile.data); pcMatOut->AddProperty(&szFile,AI_MATKEY_NAME); } diff --git a/code/Material/MaterialSystem.cpp b/code/Material/MaterialSystem.cpp index aa3df9ac2..befdb43d2 100644 --- a/code/Material/MaterialSystem.cpp +++ b/code/Material/MaterialSystem.cpp @@ -504,7 +504,7 @@ aiReturn aiMaterial::AddBinaryProperty (const void* pInput, pcNew->mData = new char[pSizeInBytes]; memcpy (pcNew->mData,pInput,pSizeInBytes); - pcNew->mKey.length = ::strlen(pKey); + pcNew->mKey.length = (ai_uint32)::strlen(pKey); ai_assert ( MAXLEN > pcNew->mKey.length); strcpy( pcNew->mKey.data, pKey ); diff --git a/code/Q3BSP/Q3BSPFileImporter.cpp b/code/Q3BSP/Q3BSPFileImporter.cpp index 4add00a07..a492cc92a 100644 --- a/code/Q3BSP/Q3BSPFileImporter.cpp +++ b/code/Q3BSP/Q3BSPFileImporter.cpp @@ -616,7 +616,7 @@ bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *model // We'll leave it up to the user to figure out which extension the file has. aiString name; strncpy( name.data, pTexture->strName, sizeof name.data ); - name.length = strlen( name.data ); + name.length = (ai_uint32)strlen( name.data ); pMatHelper->AddProperty( &name, AI_MATKEY_TEXTURE_DIFFUSE( 0 ) ); } } diff --git a/code/SMD/SMDLoader.cpp b/code/SMD/SMDLoader.cpp index 7eb6b18d1..aa1f26cc8 100644 --- a/code/SMD/SMDLoader.cpp +++ b/code/SMD/SMDLoader.cpp @@ -616,7 +616,7 @@ void SMDImporter::CreateOutputMaterials() { if (aszTextures[iMat].length()) { ::strncpy(szName.data, aszTextures[iMat].c_str(),MAXLEN-1); - szName.length = aszTextures[iMat].length(); + szName.length = (ai_uint32)aszTextures[iMat].length(); pcMat->AddProperty(&szName,AI_MATKEY_TEXTURE_DIFFUSE(0)); } } diff --git a/code/Unreal/UnrealLoader.cpp b/code/Unreal/UnrealLoader.cpp index 0bd4650d0..00b6b812d 100644 --- a/code/Unreal/UnrealLoader.cpp +++ b/code/Unreal/UnrealLoader.cpp @@ -403,7 +403,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile, // set color and name mat->AddProperty(&color,1,AI_MATKEY_COLOR_DIFFUSE); - s.length = ::strlen(s.data); + s.length = (ai_uint32)::strlen(s.data); mat->AddProperty(&s,AI_MATKEY_NAME); // set texture, if any diff --git a/code/X/XFileImporter.cpp b/code/X/XFileImporter.cpp index be7256d5c..122033b08 100644 --- a/code/X/XFileImporter.cpp +++ b/code/X/XFileImporter.cpp @@ -211,7 +211,7 @@ aiNode* XFileImporter::CreateNodes( aiScene* pScene, aiNode* pParent, const XFil // create node aiNode* node = new aiNode; - node->mName.length = pNode->mName.length(); + node->mName.length = (ai_uint32)pNode->mName.length(); node->mParent = pParent; memcpy( node->mName.data, pNode->mName.c_str(), pNode->mName.length()); node->mName.data[node->mName.length] = 0;