diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2014-02-23 23:03:39 +0100 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2014-02-28 12:43:20 +0100 |
| commit | 315a8ba1c04bf8cffd9b04096be898ac462fa89e (patch) | |
| tree | 5655bdf4d940b3fdd372cb76181d70137982aefc /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 5f0a8008f45f2c30a1aed044a428c5b4ce09ce88 (diff) | |
Various changes suggested by cppcheck
- remove unused variables
- reduce the scope where it makes sense
- correct limits (did you know that strcat()'s last parameter does not
include the \0 that is always added?)
- set some free()'d pointers to NULL
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 5abce6fdee..9ea6fae5ad 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -73,11 +73,8 @@ void TextureCache::Invalidate() TextureCache::~TextureCache() { Invalidate(); - if (temp) - { - FreeAlignedMemory(temp); - temp = NULL; - } + FreeAlignedMemory(temp); + temp = NULL; } void TextureCache::OnConfigChanged(VideoConfig& config) @@ -238,11 +235,11 @@ bool TextureCache::CheckForCustomTextureLODs(u64 tex_hash, int texformat, unsign for (unsigned int level = 1; level < levels; ++level) { - sprintf(texPathTemp, "%s_mip%i", texBasePathTemp, level); + sprintf(texPathTemp, "%s_mip%u", texBasePathTemp, level); if (!HiresTextures::HiresTexExists(texPathTemp)) { if (level > 1) - WARN_LOG(VIDEO, "Couldn't find custom texture LOD with index %i (filename: %s), disabling custom LODs for this texture", level, texPathTemp); + WARN_LOG(VIDEO, "Couldn't find custom texture LOD with index %u (filename: %s), disabling custom LODs for this texture", level, texPathTemp); return false; } @@ -260,7 +257,7 @@ PC_TexFormat TextureCache::LoadCustomTexture(u64 tex_hash, int texformat, unsign if (level == 0) sprintf(texPathTemp, "%s_%08x_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), tex_hash_u32, texformat); else - sprintf(texPathTemp, "%s_%08x_%i_mip%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), tex_hash_u32, texformat, level); + sprintf(texPathTemp, "%s_%08x_%i_mip%u", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), tex_hash_u32, texformat, level); unsigned int required_size = 0; PC_TexFormat ret = HiresTextures::GetHiresTex(texPathTemp, &newWidth, &newHeight, &required_size, texformat, temp_size, temp); |
