Fix misused log macros + compiler warnings.

pull/1918/head
kimkulling 2018-04-26 16:38:42 +02:00
parent c299755721
commit 8626b185fb
5 changed files with 22 additions and 22 deletions

View File

@ -472,7 +472,7 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
if( !srcMesh) if( !srcMesh)
{ {
ASSIMP_LOG_WARN( "Collada: Unable to find geometry for ID \"", mid.mMeshOrController, "\". Skipping." ); ASSIMP_LOG_WARN_F( "Collada: Unable to find geometry for ID \"", mid.mMeshOrController, "\". Skipping." );
continue; continue;
} }
} else } else
@ -875,7 +875,7 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
if( bnode) if( bnode)
bone->mName.Set( FindNameForNode( bnode)); bone->mName.Set( FindNameForNode( bnode));
else else
ASSIMP_LOG_WARN( "ColladaLoader::CreateMesh(): could not find corresponding node for joint \"", bone->mName.data, "\"." ); ASSIMP_LOG_WARN_F( "ColladaLoader::CreateMesh(): could not find corresponding node for joint \"", bone->mName.data, "\"." );
// and insert bone // and insert bone
dstMesh->mBones[boneCount++] = bone; dstMesh->mBones[boneCount++] = bone;
@ -1176,9 +1176,8 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars
else if( subElement == "Z") else if( subElement == "Z")
entry.mSubElement = 2; entry.mSubElement = 2;
else else
ASSIMP_LOG_WARN( "Unknown anim subelement <", subElement, ">. Ignoring" ); ASSIMP_LOG_WARN_F( "Unknown anim subelement <", subElement, ">. Ignoring" );
} else } else {
{
// no subelement following, transformId is remaining string // no subelement following, transformId is remaining string
entry.mTransformId = srcChannel.mTarget.substr( slashPos+1); entry.mTransformId = srcChannel.mTarget.substr( slashPos+1);
} }
@ -1658,9 +1657,10 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
} }
// add textures, if given // add textures, if given
if( !effect.mTexAmbient.mName.empty()) if (!effect.mTexAmbient.mName.empty()) {
/* It is merely a lightmap */ // It is merely a light-map
AddTexture( mat, pParser, effect, effect.mTexAmbient, aiTextureType_LIGHTMAP); AddTexture(mat, pParser, effect, effect.mTexAmbient, aiTextureType_LIGHTMAP);
}
if( !effect.mTexEmissive.mName.empty()) if( !effect.mTexEmissive.mName.empty())
AddTexture( mat, pParser, effect, effect.mTexEmissive, aiTextureType_EMISSIVE); AddTexture( mat, pParser, effect, effect.mTexEmissive, aiTextureType_EMISSIVE);
@ -1688,8 +1688,8 @@ void ColladaLoader::BuildMaterials( ColladaParser& pParser, aiScene* /*pScene*/)
{ {
newMats.reserve(pParser.mMaterialLibrary.size()); newMats.reserve(pParser.mMaterialLibrary.size());
for( ColladaParser::MaterialLibrary::const_iterator matIt = pParser.mMaterialLibrary.begin(); matIt != pParser.mMaterialLibrary.end(); ++matIt) for( ColladaParser::MaterialLibrary::const_iterator matIt = pParser.mMaterialLibrary.begin();
{ matIt != pParser.mMaterialLibrary.end(); ++matIt) {
const Collada::Material& material = matIt->second; const Collada::Material& material = matIt->second;
// a material is only a reference to an effect // a material is only a reference to an effect
ColladaParser::EffectLibrary::iterator effIt = pParser.mEffectLibrary.find( material.mEffect); ColladaParser::EffectLibrary::iterator effIt = pParser.mEffectLibrary.find( material.mEffect);
@ -1808,7 +1808,7 @@ void ColladaLoader::ConvertPath (aiString& ss)
{ {
// TODO: collada spec, p 22. Handle URI correctly. // TODO: collada spec, p 22. Handle URI correctly.
// For the moment we're just stripping the file:// away to make it work. // For the moment we're just stripping the file:// away to make it work.
// Windoes doesn't seem to be able to find stuff like // Windows doesn't seem to be able to find stuff like
// 'file://..\LWO\LWO2\MappingModes\earthSpherical.jpg' // 'file://..\LWO\LWO2\MappingModes\earthSpherical.jpg'
if (0 == strncmp(ss.data,"file://",7)) if (0 == strncmp(ss.data,"file://",7))
{ {
@ -1822,7 +1822,7 @@ void ColladaLoader::ConvertPath (aiString& ss)
if( ss.data[0] == '/' && isalpha( ss.data[1]) && ss.data[2] == ':' ) if( ss.data[0] == '/' && isalpha( ss.data[1]) && ss.data[2] == ':' )
{ {
ss.length--; ss.length--;
memmove( ss.data, ss.data+1, ss.length); ::memmove( ss.data, ss.data+1, ss.length);
ss.data[ss.length] = 0; ss.data[ss.length] = 0;
} }
@ -1872,9 +1872,9 @@ const std::string& ColladaLoader::ReadString( const Collada::Accessor& pAccessor
void ColladaLoader::CollectNodes( const aiNode* pNode, std::vector<const aiNode*>& poNodes) const void ColladaLoader::CollectNodes( const aiNode* pNode, std::vector<const aiNode*>& poNodes) const
{ {
poNodes.push_back( pNode); poNodes.push_back( pNode);
for (size_t a = 0; a < pNode->mNumChildren; ++a) {
for( size_t a = 0; a < pNode->mNumChildren; ++a) CollectNodes(pNode->mChildren[a], poNodes);
CollectNodes( pNode->mChildren[a], poNodes); }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View File

@ -179,7 +179,7 @@ inline static void MakeAbsolutePath (const char* in, char* _out)
if (!ret) { if (!ret) {
// preserve the input path, maybe someone else is able to fix // preserve the input path, maybe someone else is able to fix
// the path before it is accessed (e.g. our file system filter) // the path before it is accessed (e.g. our file system filter)
ASSIMP_LOG_WARN("Invalid path: ", std::string(in)); ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in));
strcpy(_out, in); strcpy(_out, in);
} }
} }

View File

@ -71,7 +71,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://code.blender.org/2013/08/fbx-binary-file-format-specification/
// https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure
const double DEG = 57.29577951308232087679815481; // degrees per radian const ai_real DEG = ai_real( 57.29577951308232087679815481 ); // degrees per radian
// some constants that we'll use for writing metadata // some constants that we'll use for writing metadata
namespace FBX { namespace FBX {
@ -980,9 +980,9 @@ aiMatrix4x4 get_world_transform(const aiNode* node, const aiScene* scene)
int64_t to_ktime(double ticks, const aiAnimation* anim) { int64_t to_ktime(double ticks, const aiAnimation* anim) {
if (anim->mTicksPerSecond <= 0) { if (anim->mTicksPerSecond <= 0) {
return ticks * FBX::SECOND; return static_cast<int64_t>(ticks) * FBX::SECOND;
} }
return (ticks / anim->mTicksPerSecond) * FBX::SECOND; return (static_cast<int64_t>(ticks) / static_cast<int64_t>(anim->mTicksPerSecond)) * FBX::SECOND;
} }
void FBXExporter::WriteObjects () void FBXExporter::WriteObjects ()
@ -2440,7 +2440,7 @@ void FBXExporter::WriteAnimationCurve(
// TODO: keyattr flags and data (STUB for now) // TODO: keyattr flags and data (STUB for now)
n.AddChild("KeyAttrFlags", std::vector<int32_t>{0}); n.AddChild("KeyAttrFlags", std::vector<int32_t>{0});
n.AddChild("KeyAttrDataFloat", std::vector<float>{0,0,0,0}); n.AddChild("KeyAttrDataFloat", std::vector<float>{0,0,0,0});
ai_assert(times.size() <= std::numeric_limits<int32_t>::max()); ai_assert(static_cast<int32_t>(times.size()) <= std::numeric_limits<int32_t>::max());
n.AddChild( n.AddChild(
"KeyAttrRefCount", "KeyAttrRefCount",
std::vector<int32_t>{static_cast<int32_t>(times.size())} std::vector<int32_t>{static_cast<int32_t>(times.size())}

View File

@ -1037,7 +1037,7 @@ void MD3Importer::InternReadFile( const std::string& pFile,
if (!DefaultLogger::isNullLogger()) { if (!DefaultLogger::isNullLogger()) {
for (std::list< Q3Shader::SkinData::TextureEntry>::const_iterator it = skins.textures.begin();it != skins.textures.end(); ++it) { for (std::list< Q3Shader::SkinData::TextureEntry>::const_iterator it = skins.textures.begin();it != skins.textures.end(); ++it) {
if (!(*it).resolved) { if (!(*it).resolved) {
ASSIMP_LOG_ERROR("MD3: Failed to match skin ", (*it).first, " to surface ", (*it).second); ASSIMP_LOG_ERROR_F("MD3: Failed to match skin ", (*it).first, " to surface ", (*it).second);
} }
} }
} }

View File

@ -189,7 +189,7 @@ BEGIN
LTEXT "Angle limit (in degrees):",IDC_STATIC,13,10,76,8 LTEXT "Angle limit (in degrees):",IDC_STATIC,13,10,76,8
LTEXT "The angle limit defines the maximum angle that may be between two adjacent face normals that they're smoothed together.",IDC_STATIC,13,31,253,19 LTEXT "The angle limit defines the maximum angle that may be between two adjacent face normals that they're smoothed together.",IDC_STATIC,13,31,253,19
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,113,278,1 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,113,278,1
LTEXT "This setting is also used during import, but it can be overridden by single model importers to match the original look of a model as closely as possible. Examples include 3DS, ASE and LWO, all of them relying on smoothing groups and their own angle limits. ",IDC_STATIC,13,51,254,33 LTEXT "Also used during import, but can be overridden by single model importers to match the original look of a model as close as possible. Examples includes 3DS, ASE and LWO, all of them relying on smoothing groups and their own angle limits. ",IDC_STATIC,13,51,254,33
LTEXT "NOTE: New settings don't take effect immediately, use 'Smooth Normals' or 'Reload' to update the model.",IDC_STATIC,14,118,254,22 LTEXT "NOTE: New settings don't take effect immediately, use 'Smooth Normals' or 'Reload' to update the model.",IDC_STATIC,14,118,254,22
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,90,277,1 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,90,277,1
END END