Ticket #3011: 0009-Manually-fix-the-less-trivial-CLogger-format-strings.patch

File 0009-Manually-fix-the-less-trivial-CLogger-format-strings.patch, 6.3 KB (added by Philip Taylor, 9 years ago)
  • source/graphics/TerrainProperties.cpp

    From 3e188badf2dd160ce7c46e842ddd13f14669859c Mon Sep 17 00:00:00 2001
    From: Philip Taylor <philip@zaynar.co.uk>
    Date: Tue, 20 Jan 2015 23:16:16 +0000
    Subject: [PATCH 09/13] Manually fix the less trivial CLogger format strings.
    
    ---
     source/graphics/TerrainProperties.cpp        | 6 ++----
     source/graphics/TerrainTextureEntry.cpp      | 4 ++--
     source/ps/SavedGame.cpp                      | 2 +-
     source/ps/Util.cpp                           | 4 ++--
     source/ps/VideoMode.cpp                      | 4 ++--
     source/soundmanager/data/OggData.cpp         | 2 +-
     source/soundmanager/scripting/SoundGroup.cpp | 2 +-
     7 files changed, 11 insertions(+), 13 deletions(-)
    
    diff --git a/source/graphics/TerrainProperties.cpp b/source/graphics/TerrainProperties.cpp
    index e4bb788..da4684c 100644
    a b CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p  
    5555    // Check that we've got the right kind of xml document
    5656    if (rootName != "Terrains")
    5757    {
    58         LOGERROR(
    59             L"TerrainProperties: Loading %ls: Root node is not terrains (found \"%hs\")",
     58        LOGERROR("TerrainProperties: Loading %ls: Root node is not terrains (found \"%hs\")",
    6059            pathname.string().c_str(),
    6160            rootName.c_str());
    6261        return CTerrainPropertiesPtr();
    CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p  
    8079        }
    8180        else
    8281        {
    83             LOGWARNING(
    84                 L"TerrainProperties: Loading %ls: Unexpected node %hs\n",
     82            LOGWARNING("TerrainProperties: Loading %ls: Unexpected node %hs\n",
    8583                pathname.string().c_str(),
    8684                XeroFile.GetElementString(child.GetNodeName()).c_str());
    8785            // Keep reading - typos shouldn't be showstoppers
  • source/graphics/TerrainTextureEntry.cpp

    diff --git a/source/graphics/TerrainTextureEntry.cpp b/source/graphics/TerrainTextureEntry.cpp
    index a15b043..bef2216 100644
    a b void CTerrainTextureEntry::LoadAlphaMaps(VfsPath &amtype)  
    253253        if (textures[i] < 0)
    254254        {
    255255            g_TexMan.m_TerrainAlphas.erase(it);
    256             LOGERROR((L"Failed to load alphamap: " + amtype.string()).c_str());
     256            LOGERROR("Failed to load alphamap: %s", amtype.string());
    257257           
    258258            VfsPath standard("standard");
    259259            if (path != standard)
    void CTerrainTextureEntry::LoadAlphaMaps(VfsPath &amtype)  
    362362    result.m_hCompositeAlphaMap = hCompositeAlphaMap;
    363363   
    364364    m_TerrainAlpha = it;
    365 }
    366  No newline at end of file
     365}
  • source/ps/SavedGame.cpp

    diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp
    index 7bc32af..5869595 100644
    a b Status SavedGames::Save(const std::wstring& name, const std::wstring& descriptio  
    126126
    127127    OsPath realPath;
    128128    WARN_RETURN_STATUS_IF_ERR(g_VFS->GetRealPath(filename, realPath));
    129     LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Saved game to '%ls'") + "\n").c_str(), realPath.string().c_str());
     129    LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%ls'"), realPath.string().c_str());
    130130
    131131    return INFO::OK;
    132132}
  • source/ps/Util.cpp

    diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp
    index 62f2897..fc07b38 100644
    a b void WriteScreenshot(const VfsPath& extension)  
    241241    {
    242242        OsPath realPath;
    243243        g_VFS->GetRealPath(filename, realPath);
    244         LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str());
     244        LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string().c_str());
    245245    }
    246246    else
    247247        LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str());
    void WriteBigScreenshot(const VfsPath& extension, int tiles)  
    374374    {
    375375        OsPath realPath;
    376376        g_VFS->GetRealPath(filename, realPath);
    377         LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str());
     377        LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string().c_str());
    378378    }
    379379    else
    380380        LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str());
  • source/ps/VideoMode.cpp

    diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp
    index 626ca22..de429e0 100644
    a b bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    8989            if (fullscreen)
    9090            {
    9191                LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution "
    92                     L"%dx%d:%d (\"%hs\"), falling back to windowed mode",
     92                    "%dx%d:%d (\"%hs\"), falling back to windowed mode",
    9393                    w, h, bpp, SDL_GetError());
    9494                // Using default size for the window for now, as the attempted setting
    9595                // could be as large, or larger than the screen size.
    bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    173173        if (fullscreen)
    174174        {
    175175            LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution "
    176                 L"%dx%d:%d (\"%hs\"), falling back to windowed mode",
     176                "%dx%d:%d (\"%hs\"), falling back to windowed mode",
    177177                w, h, bpp, SDL_GetError());
    178178            // Using default size for the window for now, as the attempted setting
    179179            // could be as large, or larger than the screen size.
  • source/soundmanager/data/OggData.cpp

    diff --git a/source/soundmanager/data/OggData.cpp b/source/soundmanager/data/OggData.cpp
    index 6165c5c..26321fc 100644
    a b bool COggData::InitOggFile(const VfsPath& itemPath)  
    7878           
    7979            if(alGetError() != AL_NO_ERROR)
    8080            {
    81                 LOGERROR( L"- Error creating initial buffer !!\n");
     81                LOGERROR( "- Error creating initial buffer !!\n");
    8282                return false;
    8383            }
    8484            else
  • source/soundmanager/scripting/SoundGroup.cpp

    diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp
    index 373b382..762b513 100644
    a b void CSoundGroup::UploadPropertiesAndPlay(size_t theIndex, const CVector3D& posi  
    197197            itemRollOff = 0;
    198198       
    199199        if ( sndData->IsStereo() )
    200             LOGWARNING( L"OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string().c_str() );
     200            LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string().c_str() );
    201201
    202202        hSound->SetLocation(CVector3D((sndDist * sin(offSet)), 0, - sndDist * cos(offSet)));
    203203        hSound->SetRollOff(itemRollOff);