Ticket #3011: 0011-Automatically-replace-hs-ls-with-s-in-CLogger-format.patch

File 0011-Automatically-replace-hs-ls-with-s-in-CLogger-format.patch, 137.4 KB (added by Philip Taylor, 9 years ago)
  • source/graphics/ColladaManager.cpp

    From b6a8873c47fcdf532708c5497a0e91c69e518bd3 Mon Sep 17 00:00:00 2001
    From: Philip Taylor <philip@zaynar.co.uk>
    Date: Tue, 20 Jan 2015 23:16:19 +0000
    Subject: [PATCH 11/13] Automatically replace %hs/%ls with %s in CLogger format
     strings.
    
    Everything is char* now, so we don't need to mess around with different string types.
    
    Done with:
    
      ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl -pi -e'1 while s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'
    ---
     source/graphics/ColladaManager.cpp                 | 20 +++---
     source/graphics/FontManager.cpp                    |  6 +-
     source/graphics/MapGenerator.cpp                   | 16 ++---
     source/graphics/MapReader.cpp                      | 10 +--
     source/graphics/MapWriter.cpp                      |  4 +-
     source/graphics/MeshManager.cpp                    |  4 +-
     source/graphics/ObjectBase.cpp                     |  4 +-
     source/graphics/ObjectEntry.cpp                    | 12 ++--
     source/graphics/ObjectManager.cpp                  |  2 +-
     source/graphics/ParticleEmitterType.cpp            |  2 +-
     source/graphics/ShaderManager.cpp                  |  4 +-
     source/graphics/ShaderProgram.cpp                  | 12 ++--
     source/graphics/ShaderProgramFFP.cpp               |  2 +-
     source/graphics/SkeletonAnimManager.cpp            |  8 +--
     source/graphics/TerrainProperties.cpp              |  4 +-
     source/graphics/TerrainTextureEntry.cpp            |  4 +-
     source/graphics/TerrainTextureManager.cpp          |  6 +-
     source/graphics/TextureConverter.cpp               | 26 ++++----
     source/graphics/TextureManager.cpp                 | 10 +--
     source/gui/CGUI.cpp                                | 78 +++++++++++-----------
     source/gui/COList.cpp                              |  6 +-
     source/gui/GUIManager.cpp                          | 14 ++--
     source/gui/GUIRenderer.cpp                         |  4 +-
     source/gui/GUITooltip.cpp                          | 10 +--
     source/gui/GUIbase.cpp                             |  6 +-
     source/gui/GUItext.cpp                             | 28 ++++----
     source/gui/GUIutil.cpp                             | 22 +++---
     source/gui/IGUIObject.cpp                          |  2 +-
     source/gui/scripting/ScriptFunctions.cpp           |  2 +-
     source/i18n/L10n.cpp                               | 10 +--
     source/lobby/XmppClient.cpp                        |  4 +-
     source/network/NetClient.cpp                       |  2 +-
     source/network/NetHost.cpp                         |  2 +-
     source/network/NetServer.cpp                       | 30 ++++-----
     source/network/NetSession.cpp                      |  4 +-
     source/network/NetTurnManager.cpp                  |  2 +-
     source/ps/CStrIntern.cpp                           |  2 +-
     source/ps/ConfigDB.cpp                             | 26 ++++----
     source/ps/DllLoader.cpp                            |  6 +-
     source/ps/FileIo.cpp                               |  2 +-
     source/ps/Filesystem.cpp                           |  2 +-
     source/ps/GameSetup/GameSetup.cpp                  | 16 ++---
     source/ps/GameSetup/Paths.cpp                      |  2 +-
     source/ps/Hotkey.cpp                               |  2 +-
     source/ps/Joystick.cpp                             |  8 +--
     source/ps/Overlay.cpp                              |  8 +--
     source/ps/Preprocessor.cpp                         |  4 +-
     source/ps/PreprocessorWrapper.cpp                  |  2 +-
     source/ps/ProfileViewer.cpp                        |  2 +-
     source/ps/Profiler2.cpp                            |  2 +-
     source/ps/SavedGame.cpp                            |  4 +-
     source/ps/TemplateLoader.cpp                       | 22 +++---
     source/ps/Util.cpp                                 |  8 +--
     source/ps/VideoMode.cpp                            | 10 +--
     source/ps/World.cpp                                |  2 +-
     source/ps/XML/XMLWriter.cpp                        |  2 +-
     source/ps/XML/Xeromyces.cpp                        |  8 +--
     source/renderer/DecalRData.cpp                     |  2 +-
     source/renderer/ModelRenderer.cpp                  |  2 +-
     source/renderer/PostprocManager.cpp                |  2 +-
     source/renderer/Renderer.cpp                       |  2 +-
     source/renderer/ShadowMap.cpp                      |  2 +-
     source/renderer/SkyManager.cpp                     |  2 +-
     source/scriptinterface/DebuggingServer.cpp         |  2 +-
     source/scriptinterface/ScriptInterface.cpp         | 24 +++----
     source/scriptinterface/ThreadDebugger.cpp          |  2 +-
     source/simulation2/Simulation2.cpp                 | 14 ++--
     source/simulation2/components/CCmpAIManager.cpp    | 24 +++----
     source/simulation2/components/CCmpPathfinder.cpp   |  4 +-
     .../components/CCmpProjectileManager.cpp           |  2 +-
     source/simulation2/components/CCmpRangeManager.cpp |  4 +-
     .../simulation2/components/CCmpTemplateManager.cpp |  4 +-
     source/simulation2/scripting/ScriptComponent.cpp   |  2 +-
     source/simulation2/scripting/ScriptComponent.h     |  4 +-
     .../simulation2/serialization/BinarySerializer.cpp |  4 +-
     source/simulation2/system/ComponentManager.cpp     |  8 +--
     .../system/ComponentManagerSerialization.cpp       |  6 +-
     source/simulation2/system/ParamNode.cpp            |  2 +-
     source/soundmanager/SoundManager.cpp               |  8 +--
     source/soundmanager/data/SoundData.cpp             |  2 +-
     source/soundmanager/scripting/SoundGroup.cpp       |  6 +-
     source/tools/atlas/GameInterface/GameLoop.cpp      |  2 +-
     .../GameInterface/Handlers/ObjectHandlers.cpp      |  2 +-
     83 files changed, 330 insertions(+), 330 deletions(-)
    
    diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp
    index 5309789..c7b806a 100644
    a b namespace  
    4242        VfsPath* path = static_cast<VfsPath*>(cb_data);
    4343
    4444        if (severity == LOG_INFO)
    45             LOGMESSAGE("%ls: %hs", path->string8(), text);
     45            LOGMESSAGE("%s: %s", path->string8(), text);
    4646        else if (severity == LOG_WARNING)
    47             LOGWARNING("%ls: %hs", path->string8(), text);
     47            LOGWARNING("%s: %s", path->string8(), text);
    4848        else
    49             LOGERROR("%ls: %hs", path->string8(), text);
     49            LOGERROR("%s: %s", path->string8(), text);
    5050    }
    5151
    5252    void ColladaOutput(void* cb_data, const char* data, unsigned int length)
    public:  
    9999        if (!dll.IsLoaded() && !TryLoadDLL())
    100100            return ERR::FAIL;   
    101101
    102         LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string8());
     102        LOGMESSAGE("Hotloading skeleton definitions from '%s'", path.string8());
    103103        // Set the filename for the logger to report
    104104        set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&path)));
    105105
    106106        CVFSFile skeletonFile;
    107107        if (skeletonFile.Load(m_VFS, path) != PSRETURN_OK)
    108108        {
    109             LOGERROR("Failed to read skeleton defintions from '%ls'", path.string8());
     109            LOGERROR("Failed to read skeleton defintions from '%s'", path.string8());
    110110            return ERR::FAIL;
    111111        }
    112112
    113113        int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize());
    114114        if (ok < 0)
    115115        {
    116             LOGERROR("Failed to load skeleton definitions from '%ls'", path.string8());
     116            LOGERROR("Failed to load skeleton definitions from '%s'", path.string8());
    117117            return ERR::FAIL;
    118118        }
    119119
    public:  
    221221        bool loaded = false;
    222222        for (VfsPaths::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it)
    223223        {
    224             LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string8());
     224            LOGMESSAGE("Loading skeleton definitions from '%s'", it->string8());
    225225            // Set the filename for the logger to report
    226226            set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&(*it))));
    227227
    228228            CVFSFile skeletonFile;
    229229            if (skeletonFile.Load(m_VFS, *it) != PSRETURN_OK)
    230230            {
    231                 LOGERROR("Failed to read skeleton defintions from '%ls'", it->string8());
     231                LOGERROR("Failed to read skeleton defintions from '%s'", it->string8());
    232232                continue;
    233233            }
    234234
    235235            int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize());
    236236            if (ok < 0)
    237237            {
    238                 LOGERROR("Failed to load skeleton definitions from '%ls'", it->string8());
     238                LOGERROR("Failed to load skeleton definitions from '%s'", it->string8());
    239239                continue;
    240240            }
    241241
    public:  
    287287                //  should never happen, unless there really is a problem
    288288                if (m_VFS->GetFileInfo(*it, &fileInfo) != INFO::OK)
    289289                {
    290                     LOGERROR("Failed to stat '%ls' for DAE caching", it->string8());
     290                    LOGERROR("Failed to stat '%s' for DAE caching", it->string8());
    291291                }
    292292                else
    293293                {
  • source/graphics/FontManager.cpp

    diff --git a/source/graphics/FontManager.cpp b/source/graphics/FontManager.cpp
    index a6e14b3..f7038c0 100644
    a b bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)  
    5959    const VfsPath fntName(fontName.string() + ".fnt");
    6060    if (g_VFS->LoadFile(path / fntName, buf, size) < 0)
    6161    {
    62         LOGERROR("Failed to open font file %ls", (path / fntName).string8());
     62        LOGERROR("Failed to open font file %s", (path / fntName).string8());
    6363        return false;
    6464    }
    6565    std::istringstream FNTStream(std::string((const char*)buf.get(), size));
    bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)  
    6868    FNTStream >> Version;
    6969    if (Version != 101) // Make sure this is from a recent version of the font builder
    7070    {
    71         LOGERROR("Font %hs has invalid version", fontName.c_str());
     71        LOGERROR("Font %s has invalid version", fontName.c_str());
    7272        return 0;
    7373    }
    7474
    bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)  
    102102
    103103        if (Codepoint < 0 || Codepoint > 0xFFFF)
    104104        {
    105             LOGWARNING("Font %hs has invalid codepoint 0x%x", fontName.c_str(), Codepoint);
     105            LOGWARNING("Font %s has invalid codepoint 0x%x", fontName.c_str(), Codepoint);
    106106            continue;
    107107        }
    108108
  • source/graphics/MapGenerator.cpp

    diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp
    index 366592e..91d26e9 100644
    a b bool CMapGeneratorWorker::Run()  
    134134    }
    135135
    136136    // Load RMS
    137     LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string8());
     137    LOGMESSAGE("Loading RMS '%s'", m_ScriptPath.string8());
    138138    if (!m_ScriptInterface->LoadGlobalScriptFile(m_ScriptPath))
    139139    {
    140         LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string8());
     140        LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%s'", m_ScriptPath.string8());
    141141        return false;
    142142    }
    143143
    std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv  
    210210            PSRETURN ret = file.Load(g_VFS, *it);
    211211            if (ret != PSRETURN_OK)
    212212            {
    213                 LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
     213                LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
    214214            }
    215215            else
    216216            {
    std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv  
    222222    {
    223223        // Some error reading directory
    224224        wchar_t error[200];
    225         LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     225        LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%s': %s", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    226226    }
    227227
    228228    return data;
    CParamNode CMapGeneratorWorker::GetTemplate(ScriptInterface::CxPrivate* pCxPriva  
    234234    CMapGeneratorWorker* self = static_cast<CMapGeneratorWorker*>(pCxPrivate->pCBData);
    235235    const CParamNode& templateRoot = self->m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity");
    236236    if (!templateRoot.IsOk())
    237         LOGERROR("Invalid template found for '%hs'", templateName.c_str());
     237        LOGERROR("Invalid template found for '%s'", templateName.c_str());
    238238   
    239239    return templateRoot;
    240240}
    bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)  
    271271    {
    272272        for (VfsPaths::iterator it = pathnames.begin(); it != pathnames.end(); ++it)
    273273        {
    274             LOGMESSAGE("Loading map generator script '%ls'", it->string8());
     274            LOGMESSAGE("Loading map generator script '%s'", it->string8());
    275275
    276276            if (!m_ScriptInterface->LoadGlobalScriptFile(*it))
    277277            {
    278                 LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string8());
     278                LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%s'", it->string8());
    279279                return false;
    280280            }
    281281        }
    bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)  
    284284    {
    285285        // Some error reading directory
    286286        wchar_t error[200];
    287         LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     287        LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%s': %s", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    288288        return false;
    289289    }
    290290
  • source/graphics/MapReader.cpp

    diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp
    index c6dccd0..fd11ee5 100644
    a b int CXMLReader::ReadEntities(XMBElement parent, double end_time)  
    10521052        entity_id_t player = cmpPlayerManager->GetPlayerByID(PlayerID);
    10531053        if (ent == INVALID_ENTITY || player == INVALID_ENTITY)
    10541054        {   // Don't add entities with invalid player IDs
    1055             LOGERROR("Failed to load entity template '%ls'", TemplateName.c_str());
     1055            LOGERROR("Failed to load entity template '%s'", TemplateName.c_str());
    10561056        }
    10571057        else
    10581058        {
    int CMapReader::ParseTerrain()  
    13321332    //  an error here should stop the loading process
    13331333#define GET_TERRAIN_PROPERTY(val, prop, out)\
    13341334    if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\
    1335         {   LOGERROR("CMapReader::ParseTerrain() failed to get '%hs' property", #prop);\
     1335        {   LOGERROR("CMapReader::ParseTerrain() failed to get '%s' property", #prop);\
    13361336            throw PSERROR_Game_World_MapLoadFailed("Error parsing terrain data.\nCheck application log for details"); }
    13371337
    13381338    JS::RootedValue tmpMapData(cx, m_MapData.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade
    int CMapReader::ParseEntities()  
    14301430        entity_id_t player = cmpPlayerManager->GetPlayerByID(currEnt.playerID);
    14311431        if (ent == INVALID_ENTITY || player == INVALID_ENTITY)
    14321432        {   // Don't add entities with invalid player IDs
    1433             LOGERROR("Failed to load entity template '%ls'", currEnt.templateName.c_str());
     1433            LOGERROR("Failed to load entity template '%s'", currEnt.templateName.c_str());
    14341434        }
    14351435        else
    14361436        {
    int CMapReader::ParseEnvironment()  
    14761476
    14771477#define GET_ENVIRONMENT_PROPERTY(val, prop, out)\
    14781478    if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\
    1479         LOGWARNING("CMapReader::ParseEnvironment() failed to get '%hs' property", #prop);
     1479        LOGWARNING("CMapReader::ParseEnvironment() failed to get '%s' property", #prop);
    14801480
    14811481    JS::RootedValue envObj(cx);
    14821482    GET_ENVIRONMENT_PROPERTY(tmpMapData, Environment, &envObj)
    int CMapReader::ParseCamera()  
    15811581
    15821582#define GET_CAMERA_PROPERTY(val, prop, out)\
    15831583    if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\
    1584         LOGWARNING("CMapReader::ParseCamera() failed to get '%hs' property", #prop);
     1584        LOGWARNING("CMapReader::ParseCamera() failed to get '%s' property", #prop);
    15851585
    15861586    JS::RootedValue tmpMapData(cx, m_MapData.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade
    15871587    JS::RootedValue cameraObj(cx);
  • source/graphics/MapWriter.cpp

    diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp
    index 8ea3c38..4259f3f 100644
    a b void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain,  
    7171    }
    7272    catch (PSERROR_File_WriteFailed&)
    7373    {
    74         LOGERROR("Failed to write map '%ls'", pathname.string8());
     74        LOGERROR("Failed to write map '%s'", pathname.string8());
    7575        return;
    7676    }
    7777
    void CMapWriter::WriteXML(const VfsPath& filename,  
    447447        }
    448448    }
    449449    if (!XML_StoreVFS(g_VFS, filename))
    450         LOGERROR("Failed to write map '%ls'", filename.string8());
     450        LOGERROR("Failed to write map '%s'", filename.string8());
    451451}
  • source/graphics/MeshManager.cpp

    diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp
    index 1a7ed6b..103c401 100644
    a b CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)  
    5353
    5454    if (pmdFilename.empty())
    5555    {
    56         LOGERROR("Could not load mesh '%ls'", pathname.string8());
     56        LOGERROR("Could not load mesh '%s'", pathname.string8());
    5757        return CModelDefPtr();
    5858    }
    5959
    CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)  
    6565    }
    6666    catch (PSERROR_File&)
    6767    {
    68         LOGERROR("Could not load mesh '%ls'", pmdFilename.string8());
     68        LOGERROR("Could not load mesh '%s'", pmdFilename.string8());
    6969        return CModelDefPtr();
    7070    }
    7171}
  • source/graphics/ObjectBase.cpp

    diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp
    index 28bc016..c32e285 100644
    a b bool CObjectBase::Load(const VfsPath& pathname)  
    9090
    9191    if (root.GetNodeName() != el_actor)
    9292    {
    93         LOGERROR("Invalid actor format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str());
     93        LOGERROR("Invalid actor format (unrecognised root element '%s')", XeroFile.GetElementString(root.GetNodeName()).c_str());
    9494        return false;
    9595    }
    9696
    bool CObjectBase::Load(const VfsPath& pathname)  
    266266
    267267            if (currentGroup->size() == 0)
    268268            {
    269                 LOGERROR("Actor group has zero variants ('%ls')", pathname.string8());
     269                LOGERROR("Actor group has zero variants ('%s')", pathname.string8());
    270270            }
    271271
    272272            ++currentGroup;
  • source/graphics/ObjectEntry.cpp

    diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp
    index a11463a..e4c26a0 100644
    a b bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    7373        str << variation.color;
    7474        int r, g, b;
    7575        if (! (str >> r >> g >> b)) // Any trailing data is ignored
    76             LOGERROR("Actor '%ls' has invalid RGB colour '%hs'", m_Base->m_ShortName.c_str(), variation.color.c_str());
     76            LOGERROR("Actor '%s' has invalid RGB colour '%s'", m_Base->m_ShortName.c_str(), variation.color.c_str());
    7777        else
    7878            m_Color = CColor(r/255.0f, g/255.0f, b/255.0f, 1.0f);
    7979    }
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    119119    CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName));
    120120    if (!modeldef)
    121121    {
    122         LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string8());
     122        LOGERROR("CObjectEntry::BuildVariation(): Model %s failed to load", m_ModelName.string8());
    123123        return false;
    124124    }
    125125
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    133133   
    134134    if (m_Samplers.size() == 0)
    135135    {
    136         LOGERROR("Actor '%ls' has no textures.", m_Base->m_ShortName.c_str());
     136        LOGERROR("Actor '%s' has no textures.", m_Base->m_ShortName.c_str());
    137137    }
    138138   
    139139    std::vector<CObjectBase::Samp>::iterator samp;
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    190190    {
    191191        // start up idling
    192192        if (!model->SetAnimation(GetRandomAnimation("idle")))
    193             LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string8());
     193            LOGERROR("Failed to set idle animation in model \"%s\"", m_ModelName.string8());
    194194    }
    195195
    196196    // build props - TODO, RC - need to fix up bounds here
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    209209        CObjectEntry* oe = objectManager.FindObjectVariation(prop.m_ModelName.c_str(), selections);
    210210        if (!oe)
    211211        {
    212             LOGERROR("Failed to build prop model \"%ls\" on actor \"%ls\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str());
     212            LOGERROR("Failed to build prop model \"%s\" on actor \"%s\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str());
    213213            continue;
    214214        }
    215215
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    240240                propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
    241241        }
    242242        else
    243             LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string8(), m_Base->m_ShortName.c_str());
     243            LOGERROR("Failed to find matching prop point called \"%s\" in model \"%s\" for actor \"%s\"", ppn.c_str(), m_ModelName.string8(), m_Base->m_ShortName.c_str());
    244244    }
    245245
    246246    // setup flags
  • source/graphics/ObjectManager.cpp

    diff --git a/source/graphics/ObjectManager.cpp b/source/graphics/ObjectManager.cpp
    index 8101364..5a0ab1a 100644
    a b CObjectBase* CObjectManager::FindObjectBase(const CStrW& objectname)  
    9696    else
    9797        delete obj;
    9898
    99     LOGERROR("CObjectManager::FindObjectBase(): Cannot find object '%ls'", objectname.c_str());
     99    LOGERROR("CObjectManager::FindObjectBase(): Cannot find object '%s'", objectname.c_str());
    100100
    101101    return 0;
    102102}
  • source/graphics/ParticleEmitterType.cpp

    diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp
    index 7ecd403..46cc663 100644
    a b int CParticleEmitterType::GetVariableID(const std::string& name)  
    329329    if (name == "color.r")          return VAR_COLOR_R;
    330330    if (name == "color.g")          return VAR_COLOR_G;
    331331    if (name == "color.b")          return VAR_COLOR_B;
    332     LOGWARNING("Particle sets unknown variable '%hs'", name.c_str());
     332    LOGWARNING("Particle sets unknown variable '%s'", name.c_str());
    333333    return -1;
    334334}
    335335
  • source/graphics/ShaderManager.cpp

    diff --git a/source/graphics/ShaderManager.cpp b/source/graphics/ShaderManager.cpp
    index dcb3f1c..a65071d 100644
    a b CShaderProgramPtr CShaderManager::LoadProgram(const char* name, const CShaderDef  
    7777    CShaderProgramPtr program;
    7878    if (!NewProgram(name, defines, program))
    7979    {
    80         LOGERROR("Failed to load shader '%hs'", name);
     80        LOGERROR("Failed to load shader '%s'", name);
    8181        program = CShaderProgramPtr();
    8282    }
    8383
    CShaderTechniquePtr CShaderManager::LoadEffect(CStrIntern name, const CShaderDef  
    378378    CShaderTechniquePtr tech(new CShaderTechnique());
    379379    if (!NewEffect(name.c_str(), defines, tech))
    380380    {
    381         LOGERROR("Failed to load effect '%hs'", name.c_str());
     381        LOGERROR("Failed to load effect '%s'", name.c_str());
    382382        tech = CShaderTechniquePtr();
    383383    }
    384384
  • source/graphics/ShaderProgram.cpp

    diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp
    index 3d8f3c2..55ffe5a 100644
    a b public:  
    7171            glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
    7272            int errLine = std::count(code.begin(), code.begin() + std::min((int)code.length(), errPos + 1), '\n') + 1;
    7373            char* errStr = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
    74             LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string8(), errLine, errStr);
     74            LOGERROR("Failed to compile %s program '%s' (line %d):\n%s", targetName, file.string8(), errLine, errStr);
    7575            return false;
    7676        }
    7777
    public:  
    310310            pglGetShaderInfoLog(shader, length, NULL, infolog);
    311311
    312312            if (ok)
    313                 LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string8(), infolog);
     313                LOGMESSAGE("Info when compiling shader '%s':\n%s", file.string8(), infolog);
    314314            else
    315                 LOGERROR("Failed to compile shader '%ls':\n%hs", file.string8(), infolog);
     315                LOGERROR("Failed to compile shader '%s':\n%s", file.string8(), infolog);
    316316
    317317            delete[] infolog;
    318318        }
    public:  
    357357            pglGetProgramInfoLog(m_Program, length, NULL, infolog);
    358358
    359359            if (ok)
    360                 LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
     360                LOGMESSAGE("Info when linking program '%s'+'%s':\n%s", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
    361361            else
    362                 LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
     362                LOGERROR("Failed to link program '%s'+'%s':\n%s", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
    363363           
    364364            delete[] infolog;
    365365        }
    CShaderProgram::CShaderProgram(int streamflags)  
    663663    const std::map<CStrIntern, int>& UNUSED(vertexIndexes), const std::map<CStrIntern, frag_index_pair_t>& UNUSED(fragmentIndexes),
    664664    int UNUSED(streamflags))
    665665{
    666     LOGERROR("CShaderProgram::ConstructARB: '%ls'+'%ls': ARB shaders not supported on this device",
     666    LOGERROR("CShaderProgram::ConstructARB: '%s'+'%s': ARB shaders not supported on this device",
    667667        vertexFile.string().c_str(), fragmentFile.string().c_str());
    668668    return NULL;
    669669}
  • source/graphics/ShaderProgramFFP.cpp

    diff --git a/source/graphics/ShaderProgramFFP.cpp b/source/graphics/ShaderProgramFFP.cpp
    index 771bdd5..f46e629 100644
    a b public:  
    11591159    if (id == "model_solid_tex")
    11601160        return new CShaderProgramFFP_ModelSolidTex(defines);
    11611161
    1162     LOGERROR("CShaderProgram::ConstructFFP: '%hs': Invalid id", id.c_str());
     1162    LOGERROR("CShaderProgram::ConstructFFP: '%s': Invalid id", id.c_str());
    11631163    debug_warn(L"CShaderProgram::ConstructFFP: Invalid id");
    11641164    return NULL;
    11651165}
  • source/graphics/SkeletonAnimManager.cpp

    diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp
    index 9872c16..fa4f121 100644
    a b CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)  
    6565
    6666    if (psaFilename.empty())
    6767    {
    68         LOGERROR("Could not load animation '%ls'", pathname.string8());
     68        LOGERROR("Could not load animation '%s'", pathname.string8());
    6969        def = NULL;
    7070    }
    7171    else
    CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)  
    7676        }
    7777        catch (PSERROR_File&)
    7878        {
    79             LOGERROR("Could not load animation '%ls'", psaFilename.string8());
     79            LOGERROR("Could not load animation '%s'", psaFilename.string8());
    8080        }
    8181    }
    8282
    8383    if (def)
    84         LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string8());
     84        LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%s): Loaded successfully", pathname.string8());
    8585    else
    86         LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string8());
     86        LOGERROR("CSkeletonAnimManager::GetAnimation(%s): Failed loading, marked file as bad", pathname.string8());
    8787
    8888    // Add to map
    8989    m_Animations[name] = def; // NULL if failed to load - we won't try loading it again
  • source/graphics/TerrainProperties.cpp

    diff --git a/source/graphics/TerrainProperties.cpp b/source/graphics/TerrainProperties.cpp
    index da4684c..f5d7427 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("TerrainProperties: Loading %ls: Root node is not terrains (found \"%hs\")",
     58        LOGERROR("TerrainProperties: Loading %s: Root node is not terrains (found \"%s\")",
    5959            pathname.string().c_str(),
    6060            rootName.c_str());
    6161        return CTerrainPropertiesPtr();
    CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p  
    7979        }
    8080        else
    8181        {
    82             LOGWARNING("TerrainProperties: Loading %ls: Unexpected node %hs\n",
     82            LOGWARNING("TerrainProperties: Loading %s: Unexpected node %s\n",
    8383                pathname.string().c_str(),
    8484                XeroFile.GetElementString(child.GetNodeName()).c_str());
    8585            // Keep reading - typos shouldn't be showstoppers
  • source/graphics/TerrainTextureEntry.cpp

    diff --git a/source/graphics/TerrainTextureEntry.cpp b/source/graphics/TerrainTextureEntry.cpp
    index 94930d8..d1c8ce3 100644
    a b CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con  
    4747    CXeromyces XeroFile;
    4848    if (XeroFile.Load(g_VFS, path) != PSRETURN_OK)
    4949    {
    50         LOGERROR("Terrain xml not found (%hs)", path.string8());
     50        LOGERROR("Terrain xml not found (%s)", path.string8());
    5151        return;
    5252    }
    5353
    CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con  
    7070
    7171    if (root.GetNodeName() != el_terrain)
    7272    {
    73         LOGERROR("Invalid terrain format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str());
     73        LOGERROR("Invalid terrain format (unrecognised root element '%s')", XeroFile.GetElementString(root.GetNodeName()).c_str());
    7474        return;
    7575    }
    7676   
  • source/graphics/TerrainTextureManager.cpp

    diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp
    index 8429c69..e7e3391 100644
    a b CTerrainTextureEntry* CTerrainTextureManager::FindTexture(const CStr& tag_)  
    8989            return m_TextureEntries[i];
    9090    }
    9191
    92     LOGWARNING("CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str());
     92    LOGWARNING("CTerrainTextureManager: Couldn't find terrain %s", tag.c_str());
    9393    return 0;
    9494}
    9595
    void CTerrainTextureManager::LoadTextures(const CTerrainPropertiesPtr& props, co  
    141141
    142142void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& parentProps, const VfsPath& path)
    143143{
    144     //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string8());
     144    //LOGMESSAGE("CTextureManager::RecurseDirectory(%s)", path.string8());
    145145
    146146    CTerrainPropertiesPtr props;
    147147
    void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& paren  
    153153    // No terrains.xml, or read failures -> use parent props (i.e.
    154154    if (!props)
    155155    {
    156         LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string8());
     156        LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%s): no terrains.xml (or errors while loading) - using parent properties", path.string8());
    157157        props = parentProps;
    158158    }
    159159
  • source/graphics/TextureConverter.cpp

    diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp
    index 9c52652..3f9c7cb 100644
    a b CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    120120
    121121    if (root.GetNodeName() != el_textures)
    122122    {
    123         LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string8());
     123        LOGERROR("Invalid texture settings file \"%s\" (unrecognised root element)", path.string8());
    124124        return NULL;
    125125    }
    126126
    CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    152152                    else if (v == "alpha")
    153153                        p.settings.format = FMT_ALPHA;
    154154                    else
    155                         LOGERROR("Invalid attribute value <file format='%hs'>", v.c_str());
     155                        LOGERROR("Invalid attribute value <file format='%s'>", v.c_str());
    156156                }
    157157                else if (attr.Name == at_mipmap)
    158158                {
    CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    162162                    else if (v == "false")
    163163                        p.settings.mipmap = MIP_FALSE;
    164164                    else
    165                         LOGERROR("Invalid attribute value <file mipmap='%hs'>", v.c_str());
     165                        LOGERROR("Invalid attribute value <file mipmap='%s'>", v.c_str());
    166166                }
    167167                else if (attr.Name == at_normal)
    168168                {
    CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    172172                    else if (v == "false")
    173173                        p.settings.normal = NORMAL_FALSE;
    174174                    else
    175                         LOGERROR("Invalid attribute value <file normal='%hs'>", v.c_str());
     175                        LOGERROR("Invalid attribute value <file normal='%s'>", v.c_str());
    176176                }
    177177                else if (attr.Name == at_alpha)
    178178                {
    CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    184184                    else if (v == "transparency")
    185185                        p.settings.alpha = ALPHA_TRANSPARENCY;
    186186                    else
    187                         LOGERROR("Invalid attribute value <file alpha='%hs'>", v.c_str());
     187                        LOGERROR("Invalid attribute value <file alpha='%s'>", v.c_str());
    188188                }
    189189                else if (attr.Name == at_filter)
    190190                {
    CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    196196                    else if (v == "kaiser")
    197197                        p.settings.filter = FILTER_KAISER;
    198198                    else
    199                         LOGERROR("Invalid attribute value <file filter='%hs'>", v.c_str());
     199                        LOGERROR("Invalid attribute value <file filter='%s'>", v.c_str());
    200200                }
    201201                else if (attr.Name == at_kaiserwidth)
    202202                {
    CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    212212                }
    213213                else
    214214                {
    215                     LOGERROR("Invalid attribute name <file %hs='...'>", XeroFile.GetAttributeString(attr.Name).c_str());
     215                    LOGERROR("Invalid attribute name <file %s='...'>", XeroFile.GetAttributeString(attr.Name).c_str());
    216216                }
    217217            }
    218218
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    326326    size_t fileSize;
    327327    if (m_VFS->LoadFile(src, file, fileSize) < 0)
    328328    {
    329         LOGERROR("Failed to load texture \"%ls\"", src.string8());
     329        LOGERROR("Failed to load texture \"%s\"", src.string8());
    330330        return false;
    331331    }
    332332
    333333    Tex tex;
    334334    if (tex.decode(file, fileSize) < 0)
    335335    {
    336         LOGERROR("Failed to decode texture \"%ls\"", src.string8());
     336        LOGERROR("Failed to decode texture \"%s\"", src.string8());
    337337        return false;
    338338    }
    339339
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    345345        // Convert to uncompressed 8-bit with no mipmaps
    346346        if (tex.transform_to((tex.m_Flags | TEX_GREY) & ~(TEX_DXT | TEX_MIPMAPS | TEX_ALPHA)) < 0)
    347347        {
    348             LOGERROR("Failed to transform texture \"%ls\"", src.string8());
     348            LOGERROR("Failed to transform texture \"%s\"", src.string8());
    349349            return false;
    350350        }
    351351    }
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    356356        // (plain_transform doesn't know how to construct the alpha channel)
    357357        if (tex.m_Flags & TEX_GREY)
    358358        {
    359             LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string8());
     359            LOGERROR("Failed to convert grayscale texture \"%s\" - only RGB textures are currently supported", src.string8());
    360360            return false;
    361361        }
    362362
    363363        // Convert to uncompressed BGRA with no mipmaps
    364364        if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0)
    365365        {
    366             LOGERROR("Failed to transform texture \"%ls\"", src.string8());
     366            LOGERROR("Failed to transform texture \"%s\"", src.string8());
    367367            return false;
    368368        }
    369369    }
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    482482    return true;
    483483
    484484#else
    485     LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string8());
     485    LOGERROR("Failed to convert texture \"%s\" (NVTT not available)", src.string8());
    486486    return false;
    487487#endif
    488488}
  • source/graphics/TextureManager.cpp

    diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp
    index eb08e0d..2adf7c9 100644
    a b public:  
    178178        Handle h = ogl_tex_load(m_VFS, path, RES_UNIQUE);
    179179        if (h <= 0)
    180180        {
    181             LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string8());
     181            LOGERROR("Texture failed to load; \"%s\"", texture->m_Properties.m_Path.string8());
    182182
    183183            // Replace with error texture to make it obvious
    184184            texture->SetHandle(m_ErrorHandle);
    public:  
    218218        // Upload to GL
    219219        if (!m_DisableGL && ogl_tex_upload(h, texture->m_Properties.m_Format) < 0)
    220220        {
    221             LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string8());
     221            LOGERROR("Texture failed to upload: \"%s\"", texture->m_Properties.m_Path.string8());
    222222
    223223            ogl_tex_free(h);
    224224
    public:  
    277277
    278278            // No source file or archive cache was found, so we can't load the
    279279            // real texture at all - return the error texture instead
    280             LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string8());
     280            LOGERROR("CCacheLoader failed to find archived or source file for: \"%s\"", texture->m_Properties.m_Path.string8());
    281281            texture->SetHandle(m_ErrorHandle);
    282282            return true;
    283283        }
    public:  
    299299        PrepareCacheKey(texture, hash, version);
    300300        VfsPath looseCachePath = m_CacheLoader.LooseCachePath(sourcePath, hash, version);
    301301
    302 //      LOGWARNING("Converting texture \"%ls\"", srcPath.c_str());
     302//      LOGWARNING("Converting texture \"%s\"", srcPath.c_str());
    303303
    304304        CTextureConverter::Settings settings = GetConverterSettings(texture);
    305305
    public:  
    345345                }
    346346                else
    347347                {
    348                     LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string8());
     348                    LOGERROR("Texture failed to convert: \"%s\"", texture->m_Properties.m_Path.string8());
    349349                    texture->SetHandle(m_ErrorHandle);
    350350                }
    351351                texture->m_State = CTexture::LOADED;
  • source/gui/CGUI.cpp

    diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp
    index f2a1c28..cc88ff5 100644
    a b void CGUI::Draw()  
    380380    }
    381381    catch (PSERROR_GUI& e)
    382382    {
    383         LOGERROR("GUI draw error: %hs", e.what());
     383        LOGERROR("GUI draw error: %s", e.what());
    384384    }
    385385}
    386386
    void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& P  
    969969    }
    970970    catch (PSERROR_GUI& e)
    971971    {
    972         LOGERROR("Errors loading GUI file %ls (%u)", Filename.string8(), e.getCode());
     972        LOGERROR("Errors loading GUI file %s (%u)", Filename.string8(), e.getCode());
    973973        return;
    974974    }
    975975}
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    10911091    if (!object)
    10921092    {
    10931093        // Report error that object was unsuccessfully loaded
    1094         LOGERROR("GUI: Unrecognized object type \"%hs\"", type.c_str());
     1094        LOGERROR("GUI: Unrecognized object type \"%s\"", type.c_str());
    10951095        return;
    10961096    }
    10971097
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    11331133    {
    11341134        // additional check
    11351135        if (m_Styles.count(argStyle) == 0)
    1136             LOGERROR("GUI: Trying to use style '%hs' that doesn't exist.", argStyle.c_str());
     1136            LOGERROR("GUI: Trying to use style '%s' that doesn't exist.", argStyle.c_str());
    11371137        else
    11381138            object->LoadStyle(*this, argStyle);
    11391139    }
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    11851185        // Try setting the value
    11861186        if (object->SetSetting(pFile->GetAttributeString(attr.Name), attr.Value.FromUTF8(), true) != PSRETURN_OK)
    11871187        {
    1188             LOGERROR("GUI: (object: %hs) Can't set \"%hs\" to \"%ls\"", object->GetPresentableName().c_str(), pFile->GetAttributeString(attr.Name).c_str(), attr.Value.FromUTF8().c_str());
     1188            LOGERROR("GUI: (object: %s) Can't set \"%s\" to \"%s\"", object->GetPresentableName().c_str(), pFile->GetAttributeString(attr.Name).c_str(), attr.Value.FromUTF8().c_str());
    11891189
    11901190            // This is not a fatal error
    11911191        }
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    12481248                CVFSFile scriptfile;
    12491249                if (scriptfile.Load(g_VFS, filename) != PSRETURN_OK)
    12501250                {
    1251                     LOGERROR("Error opening GUI script action file '%ls'", filename.c_str());
     1251                    LOGERROR("Error opening GUI script action file '%s'", filename.c_str());
    12521252                    throw PSERROR_GUI_JSOpenFailed();
    12531253                }
    12541254
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    12931293            CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name.
    12941294            if (attributeName.empty())
    12951295            {
    1296                 LOGERROR("GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str());
     1296                LOGERROR("GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %s)", object->GetPresentableName().c_str());
    12971297                continue;
    12981298            }
    12991299
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    13201320            CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name.
    13211321            if (attributeName.empty())
    13221322            {
    1323                 LOGERROR("GUI: ‘attribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str());
     1323                LOGERROR("GUI: ‘attribute’ XML element with empty ‘id’ XML attribute found. (object: %s)", object->GetPresentableName().c_str());
    13241324                continue;
    13251325            }
    13261326
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    13481348            if (!filename.empty())
    13491349            {
    13501350                if (!directory.empty())
    1351                     LOGWARNING("GUI: Include element found with file name (%ls) and directory name (%ls). Only the file will be processed.", filename.c_str(), directory.c_str());
     1351                    LOGWARNING("GUI: Include element found with file name (%s) and directory name (%s). Only the file will be processed.", filename.c_str(), directory.c_str());
    13521352
    13531353                Paths.insert(filename);
    13541354
    13551355                CXeromyces XeroIncluded;
    13561356                if (XeroIncluded.Load(g_VFS, filename) != PSRETURN_OK)
    13571357                {
    1358                     LOGERROR("GUI: Error reading included XML: '%ls'", filename.c_str());
     1358                    LOGERROR("GUI: Error reading included XML: '%s'", filename.c_str());
    13591359                    continue;
    13601360                }
    13611361
    13621362                XMBElement node = XeroIncluded.GetRoot();
    13631363                if (node.GetNodeName() != XeroIncluded.GetElementID("object"))
    13641364                {
    1365                     LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", filename.c_str());
     1365                    LOGERROR("GUI: Error reading included XML: '%s', root element must have be of type 'object'.", filename.c_str());
    13661366                    continue;
    13671367                }
    13681368                Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1);
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    13791379                    CXeromyces XeroIncluded;
    13801380                    if (XeroIncluded.Load(g_VFS, *it) != PSRETURN_OK)
    13811381                    {
    1382                         LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string8());
     1382                        LOGERROR("GUI: Error reading included XML: '%s'", (*it).string8());
    13831383                        continue;
    13841384                    }
    13851385
    13861386                    XMBElement node = XeroIncluded.GetRoot();
    13871387                    if (node.GetNodeName() != XeroIncluded.GetElementID("object"))
    13881388                    {
    1389                         LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string8());
     1389                        LOGERROR("GUI: Error reading included XML: '%s', root element must have be of type 'object'.", (*it).string8());
    13901390                        continue;
    13911391                    }
    13921392                    Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1);
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    13941394
    13951395            }
    13961396            else
    1397                 LOGERROR("GUI: 'include' XML element must have valid 'file' or 'directory' attribute found. (object %hs)", object->GetPresentableName().c_str());
     1397                LOGERROR("GUI: 'include' XML element must have valid 'file' or 'directory' attribute found. (object %s)", object->GetPresentableName().c_str());
    13981398        }
    13991399        else
    14001400        {
    14011401            // Try making the object read the tag.
    14021402            if (!object->HandleAdditionalChildren(child, pFile))
    14031403            {
    1404                 LOGERROR("GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str());
     1404                LOGERROR("GUI: (object: %s) Reading unknown children for its type", object->GetPresentableName().c_str());
    14051405            }
    14061406        }
    14071407    }
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    14421442    }
    14431443    catch (PSERROR_GUI& e)
    14441444    {
    1445         LOGERROR("GUI error: %hs", e.what());
     1445        LOGERROR("GUI error: %s", e.what());
    14461446    }
    14471447}
    14481448
    void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un  
    14911491        }
    14921492        catch (PSERROR_Scripting& e)
    14931493        {
    1494             LOGERROR("GUI: Error executing script %ls: %hs", file.c_str(), e.what());
     1494            LOGERROR("GUI: Error executing script %s: %s", file.c_str(), e.what());
    14951495        }
    14961496    }
    14971497
    void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un  
    15121512                }
    15131513                catch (PSERROR_Scripting& e)
    15141514                {
    1515                     LOGERROR("GUI: Error executing script %ls: %hs", (*it).string8(), e.what());
     1515                    LOGERROR("GUI: Error executing script %s: %s", (*it).string8(), e.what());
    15161516                }
    15171517            }
    15181518        }
    void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un  
    15271527    }
    15281528    catch (PSERROR_Scripting& e)
    15291529    {
    1530         LOGERROR("GUI: Error executing inline script: %hs", e.what());
     1530        LOGERROR("GUI: Error executing inline script: %s", e.what());
    15311531    }
    15321532}
    15331533
    void CGUI::Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile)  
    15471547    name = Element.GetAttributes().GetNamedItem( pFile->GetAttributeID("name") );
    15481548
    15491549    if (m_Sprites.find(name) != m_Sprites.end())
    1550         LOGWARNING("GUI sprite name '%hs' used more than once; first definition will be discarded", name.c_str());
     1550        LOGWARNING("GUI sprite name '%s' used more than once; first definition will be discarded", name.c_str());
    15511551
    15521552    //
    15531553    //  Read Children (the images)
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16361636        {
    16371637            CClientArea ca;
    16381638            if (!GUI<CClientArea>::ParseString(attr_value, ca))
    1639                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1639                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16401640            else Image->m_Size = ca;
    16411641        }
    16421642        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16441644        {
    16451645            CClientArea ca;
    16461646            if (!GUI<CClientArea>::ParseString(attr_value, ca))
    1647                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1647                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16481648            else Image->m_TextureSize = ca;
    16491649        }
    16501650        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16521652        {
    16531653            CRect rect;
    16541654            if (!GUI<CRect>::ParseString(attr_value, rect))
    1655                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1655                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16561656            else Image->m_TexturePlacementInFile = rect;
    16571657        }
    16581658        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16601660        {
    16611661            CSize size;
    16621662            if (!GUI<CSize>::ParseString(attr_value, size))
    1663                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1663                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16641664            else Image->m_CellSize = size;
    16651665        }
    16661666        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16681668        {
    16691669            float val;
    16701670            if (!GUI<float>::ParseString(attr_value, val))
    1671                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1671                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16721672            else Image->m_FixedHAspectRatio = val;
    16731673        }
    16741674        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16761676        {
    16771677            bool b;
    16781678            if (!GUI<bool>::ParseString(attr_value, b))
    1679                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1679                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16801680            else Image->m_RoundCoordinates = b;
    16811681        }
    16821682        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    16891689            else if (attr_value == L"clamp_to_edge")
    16901690                Image->m_WrapMode = GL_CLAMP_TO_EDGE;
    16911691            else
    1692                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1692                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    16931693        }
    16941694        else
    16951695        if (attr_name == "z_level")
    16961696        {
    16971697            float z_level;
    16981698            if (!GUI<float>::ParseString(attr_value, z_level))
    1699                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1699                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    17001700            else Image->m_DeltaZ = z_level/100.f;
    17011701        }
    17021702        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    17041704        {
    17051705            CColor color;
    17061706            if (!GUI<CColor>::ParseString(attr_value, color))
    1707                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1707                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    17081708            else Image->m_BackColor = color;
    17091709        }
    17101710        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    17121712        {
    17131713            CColor color;
    17141714            if (!GUI<CColor>::ParseString(attr_value, color))
    1715                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1715                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    17161716            else Image->m_BorderColor = color;
    17171717        }
    17181718        else
    void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite  
    17201720        {
    17211721            bool b;
    17221722            if (!GUI<bool>::ParseString(attr_value, b))
    1723                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1723                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    17241724            else Image->m_Border = b;
    17251725        }
    17261726        else
    void CGUI::Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImag  
    17731773        {
    17741774            CColor color;
    17751775            if (!GUI<int>::ParseColor(attr_value, color, 0))
    1776                 LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     1776                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    17771777            else effects.m_AddColor = color;
    17781778        }
    17791779        else if (attr_name == "grayscale")
    void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)  
    18531853        {
    18541854            bool b;
    18551855            if (!GUI<bool>::ParseString(attr_value.FromUTF8(), b))
    1856                 LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
     1856                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    18571857            else
    18581858                scrollbar.m_UseEdgeButtons = b;
    18591859        }
    void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)  
    18611861        {
    18621862            float f;
    18631863            if (!GUI<float>::ParseString(attr_value.FromUTF8(), f))
    1864                 LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
     1864                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    18651865            else
    18661866                scrollbar.m_Width = f;
    18671867        }
    void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)  
    18701870        {
    18711871            float f;
    18721872            if (!GUI<float>::ParseString(attr_value.FromUTF8(), f))
    1873                 LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
     1873                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    18741874            else
    18751875                scrollbar.m_MinimumBarSize = f;
    18761876        }
    void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile)  
    18791879        {
    18801880            float f;
    18811881            if (!GUI<float>::ParseString(attr_value.FromUTF8(), f))
    1882                 LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
     1882                LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    18831883            else
    18841884                scrollbar.m_MaximumBarSize = f;
    18851885        }
    void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile)  
    19521952        {
    19531953            CSize size;
    19541954            if (!GUI<CSize>::ParseString(attr_value.FromUTF8(), size))
    1955                 LOGERROR("Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str());
     1955                LOGERROR("Error parsing '%s' (\"%s\") inside <icon>.", attr_name.c_str(), attr_value.c_str());
    19561956            else
    19571957                icon.m_Size = size;
    19581958        }
    void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile)  
    19601960        {
    19611961            int cell_id;
    19621962            if (!GUI<int>::ParseString(attr_value.FromUTF8(), cell_id))
    1963                 LOGERROR("GUI: Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str());
     1963                LOGERROR("GUI: Error parsing '%s' (\"%s\") inside <icon>.", attr_name.c_str(), attr_value.c_str());
    19641964            else
    19651965                icon.m_CellID = cell_id;
    19661966        }
    void CGUI::Xeromyces_ReadColor(XMBElement Element, CXeromyces* pFile)  
    20132013        // Try setting color to value
    20142014        if (!color.ParseString(value))
    20152015        {
    2016             LOGERROR("GUI: Unable to create custom color '%hs'. Invalid color syntax.", name.c_str());
     2016            LOGERROR("GUI: Unable to create custom color '%s'. Invalid color syntax.", name.c_str());
    20172017        }
    20182018        else
    20192019        {
  • source/gui/COList.cpp

    diff --git a/source/gui/COList.cpp b/source/gui/COList.cpp
    index 633ca91..d42ed1f 100644
    a b bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile  
    158158            {
    159159                CColor color;
    160160                if (!GUI<CColor>::ParseString(attr_value.FromUTF8(), color))
    161                     LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     161                    LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    162162                else oDef.m_TextColor = color;
    163163            }
    164164            else if (attr_name == "id")
    bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile  
    169169            {
    170170                float width;
    171171                if (!GUI<float>::ParseString(attr_value.FromUTF8(), width))
    172                     LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
     172                    LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
    173173                else
    174174                {
    175175                    // Check if it's a relative value, and save as decimal if so.
    bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile  
    215215                }
    216216                else // Ignore.
    217217                {
    218                     LOGERROR("GUI: translatable attribute in olist def that isn't a heading. (object: %hs)", this->GetPresentableName().c_str());
     218                    LOGERROR("GUI: translatable attribute in olist def that isn't a heading. (object: %s)", this->GetPresentableName().c_str());
    219219                }
    220220            }
    221221        }
  • source/gui/GUIManager.cpp

    diff --git a/source/gui/GUIManager.cpp b/source/gui/GUIManager.cpp
    index a77c97d..55db7d6 100644
    a b void CGUIManager::PopPageCB(shared_ptr<ScriptInterface::StructuredClone> args)  
    137137    JS::RootedValue global(cx, scriptInterface->GetGlobalObject());
    138138    if (!scriptInterface->HasProperty(global, callback.c_str()))
    139139    {
    140         LOGERROR("The specified callback function %hs does not exist in the page %ls", callback.c_str(), m_PageStack.back().name.c_str());
     140        LOGERROR("The specified callback function %s does not exist in the page %s", callback.c_str(), m_PageStack.back().name.c_str());
    141141        return;
    142142    }
    143143
    void CGUIManager::PopPageCB(shared_ptr<ScriptInterface::StructuredClone> args)  
    146146        scriptInterface->ReadStructuredClone(args, &argVal);
    147147    if (!scriptInterface->CallFunctionVoid(global, callback.c_str(), argVal))
    148148    {
    149         LOGERROR("Failed to call the callback function %hs in the page %ls", callback.c_str(), m_PageStack.back().name.c_str());
     149        LOGERROR("Failed to call the callback function %s in the page %s", callback.c_str(), m_PageStack.back().name.c_str());
    150150        return;
    151151    }
    152152}
    void CGUIManager::LoadPage(SGUIPage& page)  
    204204
    205205    if (root.GetNodeName() != elmt_page)
    206206    {
    207         LOGERROR("GUI page '%ls' must have root element <page>", page.name.c_str());
     207        LOGERROR("GUI page '%s' must have root element <page>", page.name.c_str());
    208208        return;
    209209    }
    210210
    void CGUIManager::LoadPage(SGUIPage& page)  
    212212    {
    213213        if (node.GetNodeName() != elmt_include)
    214214        {
    215             LOGERROR("GUI page '%ls' must only have <include> elements inside <page>", page.name.c_str());
     215            LOGERROR("GUI page '%s' must only have <include> elements inside <page>", page.name.c_str());
    216216            continue;
    217217        }
    218218
    void CGUIManager::LoadPage(SGUIPage& page)  
    252252            hotloadDataVal)
    253253        )
    254254    {
    255         LOGERROR("GUI page '%ls': Failed to call init() function", page.name.c_str());
     255        LOGERROR("GUI page '%s': Failed to call init() function", page.name.c_str());
    256256    }
    257257
    258258    m_CurrentGUI = oldGUI;
    Status CGUIManager::ReloadChangedFile(const VfsPath& path)  
    264264    {
    265265        if (it->inputs.count(path))
    266266        {
    267             LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string8(), it->name.c_str());
     267            LOGMESSAGE("GUI file '%s' changed - reloading page '%s'", path.string8(), it->name.c_str());
    268268            LoadPage(*it);
    269269            // TODO: this can crash if LoadPage runs an init script which modifies the page stack and breaks our iterators
    270270        }
    const CParamNode& CGUIManager::GetTemplate(const std::string& templateName)  
    407407{
    408408    const CParamNode& templateRoot = m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity");
    409409    if (!templateRoot.IsOk())
    410         LOGERROR("Invalid template found for '%hs'", templateName.c_str());
     410        LOGERROR("Invalid template found for '%s'", templateName.c_str());
    411411
    412412    return templateRoot;
    413413}
  • source/gui/GUIRenderer.cpp

    diff --git a/source/gui/GUIRenderer.cpp b/source/gui/GUIRenderer.cpp
    index ebeed7f..ec5087b 100644
    a b void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName,  
    144144            // Check colour is valid
    145145            if (!GUI<CColor>::ParseString(value, color))
    146146            {
    147                 LOGERROR("GUI: Error parsing sprite 'colour' (\"%ls\")", value.c_str());
     147                LOGERROR("GUI: Error parsing sprite 'colour' (\"%s\")", value.c_str());
    148148                return;
    149149            }
    150150
    void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName,  
    167167        else
    168168        {
    169169            // Otherwise, just complain and give up:
    170             LOGERROR("Trying to use a sprite that doesn't exist (\"%hs\").", SpriteName.c_str());
     170            LOGERROR("Trying to use a sprite that doesn't exist (\"%s\").", SpriteName.c_str());
    171171            return;
    172172        }
    173173    }
  • source/gui/GUITooltip.cpp

    diff --git a/source/gui/GUITooltip.cpp b/source/gui/GUITooltip.cpp
    index c18f59a..55907bc 100644
    a b void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI*  
    149149    IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style);
    150150    if (! tooltipobj)
    151151    {
    152         LOGERROR("Cannot find tooltip named '%hs'", style.c_str());
     152        LOGERROR("Cannot find tooltip named '%s'", style.c_str());
    153153        return;
    154154    }
    155155
    void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI*  
    162162        usedobj = gui->FindObjectByName(usedObjectName);
    163163        if (! usedobj)
    164164        {
    165             LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str());
     165            LOGERROR("Cannot find object named '%s' used by tooltip '%s'", usedObjectName.c_str(), style.c_str());
    166166            return;
    167167        }
    168168
    void GUITooltip::HideTooltip(const CStr& style, CGUI* gui)  
    213213    IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style);
    214214    if (! tooltipobj)
    215215    {
    216         LOGERROR("Cannot find tooltip named '%hs'", style.c_str());
     216        LOGERROR("Cannot find tooltip named '%s'", style.c_str());
    217217        return;
    218218    }
    219219
    void GUITooltip::HideTooltip(const CStr& style, CGUI* gui)  
    224224        IGUIObject* usedobj = gui->FindObjectByName(usedObjectName);
    225225        if (! usedobj)
    226226        {
    227             LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str());
     227            LOGERROR("Cannot find object named '%s' used by tooltip '%s'", usedObjectName.c_str(), style.c_str());
    228228            return;
    229229        }
    230230
    static int GetTooltipDelay(CStr& style, CGUI* gui)  
    254254    IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style);
    255255    if (! tooltipobj)
    256256    {
    257         LOGERROR("Cannot find tooltip object named '%hs'", style.c_str());
     257        LOGERROR("Cannot find tooltip object named '%s'", style.c_str());
    258258        return delay;
    259259    }
    260260    GUI<int>::GetSetting(tooltipobj, "delay", delay);
  • source/gui/GUIbase.cpp

    diff --git a/source/gui/GUIbase.cpp b/source/gui/GUIbase.cpp
    index effb583..4d730a0 100644
    a b bool CClientArea::SetClientArea(const CStr& Value)  
    113113            coord++;
    114114            break;
    115115        default:
    116             LOGWARNING("ClientArea definitions may only contain numerics. Your input: '%hs'", Value.c_str());
     116            LOGWARNING("ClientArea definitions may only contain numerics. Your input: '%s'", Value.c_str());
    117117            return false;
    118118        }
    119119        if (coord > 3)
    120120        {
    121             LOGWARNING("Too many CClientArea parameters (4 max). Your input: '%hs'", Value.c_str());
     121            LOGWARNING("Too many CClientArea parameters (4 max). Your input: '%s'", Value.c_str());
    122122            return false;
    123123        }
    124124    }
    125125
    126126    if (coord < 3)
    127127    {
    128         LOGWARNING("Too few CClientArea parameters (4 min). Your input: '%hs'", Value.c_str());
     128        LOGWARNING("Too few CClientArea parameters (4 min). Your input: '%s'", Value.c_str());
    129129        return false;
    130130    }
    131131
  • source/gui/GUItext.cpp

    diff --git a/source/gui/GUItext.cpp b/source/gui/GUItext.cpp
    index 8b5f594..15ca677 100644
    a b void CGUIString::GenerateTextCall(const CGUI *pGUI,  
    109109            if (!pGUI->IconExists(path))
    110110            {
    111111                if (pObject)
    112                     LOGERROR("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%hs\").", path.c_str());
     112                    LOGERROR("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%s\").", path.c_str());
    113113                continue;
    114114            }
    115115
    void CGUIString::GenerateTextCall(const CGUI *pGUI,  
    207207
    208208                    if (!GUI<CColor>::ParseString(it2->m_TagValue, TextCall.m_Color)
    209209                        && pObject)
    210                         LOGERROR("Error parsing the value of a [color]-tag in GUI text when reading object \"%hs\".", pObject->GetPresentableName().c_str());
     210                        LOGERROR("Error parsing the value of a [color]-tag in GUI text when reading object \"%s\".", pObject->GetPresentableName().c_str());
    211211                    break;
    212212                case CGUIString::TextChunk::Tag::TAG_FONT:
    213213                    // TODO Gee: (2004-08-15) Check if Font exists?
    void CGUIString::SetValue(const CStrW& str)  
    306306            closing = false;
    307307            if (++p == l)
    308308            {
    309                 LOGERROR("Partial tag at end of string '%ls'", str.c_str());
     309                LOGERROR("Partial tag at end of string '%s'", str.c_str());
    310310                break;
    311311            }
    312312            if (str[p] == L'/')
    void CGUIString::SetValue(const CStrW& str)  
    314314                closing = true;
    315315                if (tags.empty())
    316316                {
    317                     LOGERROR("Encountered closing tag without having any open tags. At %d in '%ls'", p, str.c_str());
     317                    LOGERROR("Encountered closing tag without having any open tags. At %d in '%s'", p, str.c_str());
    318318                    break;
    319319                }
    320320                if (++p == l)
    321321                {
    322                     LOGERROR("Partial closing tag at end of string '%ls'", str.c_str());
     322                    LOGERROR("Partial closing tag at end of string '%s'", str.c_str());
    323323                    break;
    324324                }
    325325            }
    void CGUIString::SetValue(const CStrW& str)  
    332332                {
    333333                case L' ':
    334334                    if (closing) // We still parse them to make error handling cleaner
    335                         LOGERROR("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str());
     335                        LOGERROR("Closing tags do not support parameters (at pos %d '%s')", p, str.c_str());
    336336
    337337                    // parse something="something else"
    338338                    for (++p; p < l && str[p] != L'='; ++p)
    void CGUIString::SetValue(const CStrW& str)  
    340340
    341341                    if (p == l)
    342342                    {
    343                         LOGERROR("Parameter without value at pos %d '%ls'", p, str.c_str());
     343                        LOGERROR("Parameter without value at pos %d '%s'", p, str.c_str());
    344344                        break;
    345345                    }
    346346                    // fall-through
    347347                case L'=':
    348348                    // parse a quoted parameter
    349349                    if (closing) // We still parse them to make error handling cleaner
    350                         LOGERROR("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str());
     350                        LOGERROR("Closing tags do not support parameters (at pos %d '%s')", p, str.c_str());
    351351
    352352                    if (++p == l)
    353353                    {
    354                         LOGERROR("Expected parameter, got end of string '%ls'", str.c_str());
     354                        LOGERROR("Expected parameter, got end of string '%s'", str.c_str());
    355355                        break;
    356356                    }
    357357                    if (str[p] != L'"')
    358358                    {
    359                         LOGERROR("Unquoted parameters are not supported (at pos %d '%ls')", p, str.c_str());
     359                        LOGERROR("Unquoted parameters are not supported (at pos %d '%s')", p, str.c_str());
    360360                        break;
    361361                    }
    362362                    for (++p; p < l && str[p] != L'"'; ++p)
    void CGUIString::SetValue(const CStrW& str)  
    366366                        case L'\\':
    367367                            if (++p == l)
    368368                            {
    369                                 LOGERROR("Escape character at end of string '%ls'", str.c_str());
     369                                LOGERROR("Escape character at end of string '%s'", str.c_str());
    370370                                break;
    371371                            }
    372372                            // NOTE: We do not support \n in tag parameters
    void CGUIString::SetValue(const CStrW& str)  
    392392
    393393            if (!tag_.SetTagType(tag))
    394394            {
    395                 LOGERROR("Invalid tag '%ls' at %d in '%ls'", tag.c_str(), p, str.c_str());
     395                LOGERROR("Invalid tag '%s' at %d in '%s'", tag.c_str(), p, str.c_str());
    396396                break;
    397397            }
    398398            if (!closing)
    void CGUIString::SetValue(const CStrW& str)  
    415415            {
    416416                if (tag != tags.back())
    417417                {
    418                     LOGERROR("Closing tag '%ls' does not match last opened tag '%ls' at %d in '%ls'", tag.c_str(), tags.back().c_str(), p, str.c_str());
     418                    LOGERROR("Closing tag '%s' does not match last opened tag '%s' at %d in '%s'", tag.c_str(), tags.back().c_str(), p, str.c_str());
    419419                    break;
    420420                }
    421421
    void CGUIString::SetValue(const CStrW& str)  
    426426        case L'\\':
    427427            if (++p == l)
    428428            {
    429                 LOGERROR("Escape character at end of string '%ls'", str.c_str());
     429                LOGERROR("Escape character at end of string '%s'", str.c_str());
    430430                break;
    431431            }
    432432            if (str[p] == L'n')
  • source/gui/GUIutil.cpp

    diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp
    index 15f0da4..95ff0fd 100644
    a b bool __ParseString<CRect>(const CStrW& Value, CRect &Output)  
    6969    {
    7070        if (stream.eof())
    7171        {
    72             LOGWARNING("Too few CRect parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
     72            LOGWARNING("Too few CRect parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
    7373            return false;
    7474        }
    7575        stream >> coords[i];
    7676        if ((stream.rdstate() & std::wstringstream::failbit) != 0)
    7777        {
    78             LOGWARNING("Unable to parse CRect parameters. Your input: '%hs'", Value.ToUTF8().c_str());
     78            LOGWARNING("Unable to parse CRect parameters. Your input: '%s'", Value.ToUTF8().c_str());
    7979            return false;
    8080        }
    8181    }
    8282
    8383    if (!stream.eof())
    8484    {
    85         LOGWARNING("Too many CRect parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
     85        LOGWARNING("Too many CRect parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
    8686        return false;
    8787    }
    8888
    bool __ParseString<CSize>(const CStrW& Value, CSize &Output)  
    134134    {
    135135        if (stream.eof())
    136136        {
    137             LOGWARNING("Too few CSize parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
     137            LOGWARNING("Too few CSize parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
    138138            return false;
    139139        }
    140140        stream >> coords[i];
    141141        if ((stream.rdstate() & std::wstringstream::failbit) != 0)
    142142        {
    143             LOGWARNING("Unable to parse CSize parameters. Your input: '%hs'", Value.ToUTF8().c_str());
     143            LOGWARNING("Unable to parse CSize parameters. Your input: '%s'", Value.ToUTF8().c_str());
    144144            return false;
    145145        }
    146146    }
    bool __ParseString<CSize>(const CStrW& Value, CSize &Output)  
    150150
    151151    if (!stream.eof())
    152152    {
    153         LOGWARNING("Too many CSize parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
     153        LOGWARNING("Too many CSize parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
    154154        return false;
    155155    }
    156156
    bool __ParseString<CPos>(const CStrW& Value, CPos &Output)  
    169169    {
    170170        if (stream.eof())
    171171        {
    172             LOGWARNING("Too few CPos parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
     172            LOGWARNING("Too few CPos parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
    173173            return false;
    174174        }
    175175        stream >> coords[i];
    176176        if ((stream.rdstate() & std::wstringstream::failbit) != 0)
    177177        {
    178             LOGWARNING("Unable to parse CPos parameters. Your input: '%hs'", Value.ToUTF8().c_str());
     178            LOGWARNING("Unable to parse CPos parameters. Your input: '%s'", Value.ToUTF8().c_str());
    179179            return false;
    180180        }
    181181    }
    bool __ParseString<CPos>(const CStrW& Value, CPos &Output)  
    185185
    186186    if (!stream.eof())
    187187    {
    188         LOGWARNING("Too many CPos parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
     188        LOGWARNING("Too many CPos parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
    189189        return false;
    190190    }
    191191
    PSRETURN GUI<T>::GetSettingPointer(const IGUIObject *pObject, const CStr& Settin  
    339339    std::map<CStr, SGUISetting>::const_iterator it = pObject->m_Settings.find(Setting);
    340340    if (it == pObject->m_Settings.end())
    341341    {
    342         LOGWARNING("setting %hs was not found on object %hs",
     342        LOGWARNING("setting %s was not found on object %s",
    343343            Setting.c_str(),
    344344            pObject->GetPresentableName().c_str());
    345345        return PSRETURN_GUI_InvalidSetting;
    PSRETURN GUI<T>::SetSetting(IGUIObject *pObject, const CStr& Setting,  
    388388
    389389    if (!pObject->SettingExists(Setting))
    390390    {
    391         LOGWARNING("setting %hs was not found on object %hs",
     391        LOGWARNING("setting %s was not found on object %s",
    392392            Setting.c_str(),
    393393            pObject->GetPresentableName().c_str());
    394394        return PSRETURN_GUI_InvalidSetting;
  • source/gui/IGUIObject.cpp

    diff --git a/source/gui/IGUIObject.cpp b/source/gui/IGUIObject.cpp
    index 62e93e5..091cdd3 100644
    a b bool IGUIObject::IsRootObject() const  
    561561
    562562PSRETURN IGUIObject::LogInvalidSettings(const CStr8 &Setting) const
    563563{
    564     LOGWARNING("IGUIObject: setting %hs was not found on an object",
     564    LOGWARNING("IGUIObject: setting %s was not found on an object",
    565565        Setting.c_str());
    566566    return PSRETURN_GUI_InvalidSetting;
    567567}
  • source/gui/scripting/ScriptFunctions.cpp

    diff --git a/source/gui/scripting/ScriptFunctions.cpp b/source/gui/scripting/ScriptFunctions.cpp
    index 5df3f0c..ad56e91 100644
    a b void DumpTerrainMipmap(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))  
    676676    g_Game->GetWorld()->GetTerrain()->GetHeightMipmap().DumpToDisk(filename);
    677677    OsPath realPath;
    678678    g_VFS->GetRealPath(filename, realPath);
    679     LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string8());
     679    LOGMESSAGERENDER("Terrain mipmap written to '%s'", realPath.string8());
    680680}
    681681
    682682void EnableTimeWarpRecording(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int numTurns)
  • source/i18n/L10n.cpp

    diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp
    index 97bf604..e1eb005 100644
    a b std::string L10n::FormatMillisecondsIntoDateString(const UDate& milliseconds, co  
    408408    UnicodeString unicodeFormat = UnicodeString::fromUTF8(formatString.c_str());
    409409    SimpleDateFormat* dateFormat = new SimpleDateFormat(unicodeFormat, status);
    410410    if (U_FAILURE(status))
    411         LOGERROR("Error creating SimpleDateFormat: %hs", u_errorName(status));
     411        LOGERROR("Error creating SimpleDateFormat: %s", u_errorName(status));
    412412
    413413    const TimeZone* timeZone = TimeZone::getGMT();
    414414
    415415    status = U_ZERO_ERROR;
    416416    Calendar* calendar = Calendar::createInstance(*timeZone, currentLocale, status);
    417417    if (U_FAILURE(status))
    418         LOGERROR("Error creating calendar: %hs", u_errorName(status));
     418        LOGERROR("Error creating calendar: %s", u_errorName(status));
    419419   
    420420    dateFormat->adoptCalendar(calendar);
    421421    dateFormat->format(milliseconds, dateString);
    Status L10n::ReloadChangedFile(const VfsPath& path)  
    470470    if (path.string().rfind(dictName) == std::string::npos)
    471471        return INFO::OK;
    472472
    473     LOGMESSAGE("Hotloading translations from '%ls'", path.string8());
     473    LOGMESSAGE("Hotloading translations from '%s'", path.string8());
    474474
    475475    CVFSFile file;
    476476    if (file.Load(g_VFS, path) != PSRETURN_OK)
    477477    {
    478         LOGERROR("Failed to read translations from '%ls'", path.string8());
     478        LOGERROR("Failed to read translations from '%s'", path.string8());
    479479        return ERR::FAIL;
    480480    }
    481481
    void L10n::ReadPoIntoDictionary(const std::string& poContent, tinygettext::Dicti  
    569569    }
    570570    catch(std::exception& e)
    571571    {
    572         LOGERROR("[Localization] Exception while reading virtual PO file: %hs", e.what());
     572        LOGERROR("[Localization] Exception while reading virtual PO file: %s", e.what());
    573573    }
    574574}
    575575
  • source/lobby/XmppClient.cpp

    diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp
    index a09bfb9..26c8c2e 100644
    a b bool XmppClient::handleIq(const glooxwrapper::IQ& iq)  
    749749    {
    750750        CreateSimpleMessage("system", g_L10n.Translate("unknown subtype (see logs)"), "error");
    751751        std::string tag = tag_name(iq);
    752         LOGMESSAGE("unknown subtype '%hs'", tag.c_str());
     752        LOGMESSAGE("unknown subtype '%s'", tag.c_str());
    753753    }
    754754
    755755    return true;
    void XmppClient::SetPresence(const std::string& presence)  
    896896    else IF("offline", Unavailable);
    897897    // The others are not to be set
    898898#undef IF
    899     else LOGERROR("Unknown presence '%hs'", presence.c_str());
     899    else LOGERROR("Unknown presence '%s'", presence.c_str());
    900900}
    901901
    902902/**
  • source/network/NetClient.cpp

    diff --git a/source/network/NetClient.cpp b/source/network/NetClient.cpp
    index bc5aa66..68b253c 100644
    a b bool CNetClient::OnAuthenticate(void* context, CFsmEvent* event)  
    428428
    429429    CAuthenticateResultMessage* message = (CAuthenticateResultMessage*)event->GetParamRef();
    430430
    431     LOGMESSAGE("Net: Authentication result: host=%u, %ls", message->m_HostID, message->m_Message.c_str());
     431    LOGMESSAGE("Net: Authentication result: host=%u, %s", message->m_HostID, message->m_Message.c_str());
    432432
    433433    bool  isRejoining = (message->m_Code == ARC_OK_REJOINING);
    434434
  • source/network/NetHost.cpp

    diff --git a/source/network/NetHost.cpp b/source/network/NetHost.cpp
    index 1f14daf..e81a4ce 100644
    a b bool CNetHost::SendMessage(const CNetMessage* message, ENetPeer* peer, const cha  
    2929    if (!packet)
    3030        return false;
    3131
    32     LOGMESSAGE("Net: Sending message %hs of size %lu to %hs", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName);
     32    LOGMESSAGE("Net: Sending message %s of size %lu to %s", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName);
    3333
    3434    // Let ENet send the message to peer
    3535    if (enet_peer_send(peer, DEFAULT_CHANNEL, packet) < 0)
  • source/network/NetServer.cpp

    diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp
    index ca48504..b3c14f3 100644
    a b void* CNetServerWorker::SetupUPnP(void*)  
    224224    std::string rootDescURL;
    225225    CFG_GET_VAL("network.upnprootdescurl", rootDescURL);
    226226    if (!rootDescURL.empty())
    227         LOGMESSAGE("Net server: attempting to use cached root descriptor URL: %hs", rootDescURL.c_str());
     227        LOGMESSAGE("Net server: attempting to use cached root descriptor URL: %s", rootDescURL.c_str());
    228228
    229229    int ret = 0;
    230230    bool allocatedUrls = false;
    void* CNetServerWorker::SetupUPnP(void*)  
    232232    // Try a cached URL first
    233233    if (!rootDescURL.empty() && UPNP_GetIGDFromUrl(rootDescURL.c_str(), &urls, &data, internalIPAddress, sizeof(internalIPAddress)))
    234234    {
    235         LOGMESSAGE("Net server: using cached IGD = %hs", urls.controlURL);
     235        LOGMESSAGE("Net server: using cached IGD = %s", urls.controlURL);
    236236        ret = 1;
    237237    }
    238238    // No cached URL, or it did not respond. Try getting a valid UPnP device for 10 seconds.
    void* CNetServerWorker::SetupUPnP(void*)  
    253253        LOGMESSAGE("Net server: No IGD found");
    254254        break;
    255255    case 1:
    256         LOGMESSAGE("Net server: found valid IGD = %hs", urls.controlURL);
     256        LOGMESSAGE("Net server: found valid IGD = %s", urls.controlURL);
    257257        break;
    258258    case 2:
    259         LOGMESSAGE("Net server: found a valid, not connected IGD = %hs, will try to continue anyway", urls.controlURL);
     259        LOGMESSAGE("Net server: found a valid, not connected IGD = %s, will try to continue anyway", urls.controlURL);
    260260        break;
    261261    case 3:
    262         LOGMESSAGE("Net server: found a UPnP device unrecognized as IGD = %hs, will try to continue anyway", urls.controlURL);
     262        LOGMESSAGE("Net server: found a UPnP device unrecognized as IGD = %s, will try to continue anyway", urls.controlURL);
    263263        break;
    264264    default:
    265265        debug_warn(L"Unrecognized return value from UPNP_GetValidIGD");
    void* CNetServerWorker::SetupUPnP(void*)  
    269269    ret = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress);
    270270    if (ret != UPNPCOMMAND_SUCCESS)
    271271    {
    272         LOGMESSAGE("Net server: GetExternalIPAddress failed with code %d (%hs)", ret, strupnperror(ret));
     272        LOGMESSAGE("Net server: GetExternalIPAddress failed with code %d (%s)", ret, strupnperror(ret));
    273273        return NULL;
    274274    }
    275     LOGMESSAGE("Net server: ExternalIPAddress = %hs", externalIPAddress);
     275    LOGMESSAGE("Net server: ExternalIPAddress = %s", externalIPAddress);
    276276
    277277    // Try to setup port forwarding.
    278278    ret = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, psPort, psPort,
    279279                            internalIPAddress, description, protocall, 0, leaseDuration);
    280280    if (ret != UPNPCOMMAND_SUCCESS)
    281281    {
    282         LOGMESSAGE("Net server: AddPortMapping(%hs, %hs, %hs) failed with code %d (%hs)",
     282        LOGMESSAGE("Net server: AddPortMapping(%s, %s, %s) failed with code %d (%s)",
    283283               psPort, psPort, internalIPAddress, ret, strupnperror(ret));
    284284        return NULL;
    285285    }
    void* CNetServerWorker::SetupUPnP(void*)  
    296296
    297297    if (ret != UPNPCOMMAND_SUCCESS)
    298298    {
    299         LOGMESSAGE("Net server: GetSpecificPortMappingEntry() failed with code %d (%hs)", ret, strupnperror(ret));
     299        LOGMESSAGE("Net server: GetSpecificPortMappingEntry() failed with code %d (%s)", ret, strupnperror(ret));
    300300        return NULL;
    301301    }
    302302
    303     LOGMESSAGE("Net server: External %hs:%hs %hs is redirected to internal %hs:%hs (duration=%hs)",
     303    LOGMESSAGE("Net server: External %s:%s %s is redirected to internal %s:%s (duration=%s)",
    304304                   externalIPAddress, psPort, protocall, intClient, intPort, duration);
    305305
    306306    // Cache root descriptor URL to try to avoid discovery next time.
    307307    g_ConfigDB.SetValueString(CFG_USER, "network.upnprootdescurl", urls.controlURL);
    308308    g_ConfigDB.WriteFile(CFG_USER);
    309     LOGMESSAGE("Net server: cached UPnP root descriptor URL as %hs", urls.controlURL);
     309    LOGMESSAGE("Net server: cached UPnP root descriptor URL as %s", urls.controlURL);
    310310
    311311    // Make sure everything is properly freed.
    312312    if (allocatedUrls)
    bool CNetServerWorker::RunStep()  
    471471        // Report the client address
    472472        char hostname[256] = "(error)";
    473473        enet_address_get_host_ip(&event.peer->address, hostname, ARRAY_SIZE(hostname));
    474         LOGMESSAGE("Net server: Received connection from %hs:%u", hostname, (unsigned int)event.peer->address.port);
     474        LOGMESSAGE("Net server: Received connection from %s:%u", hostname, (unsigned int)event.peer->address.port);
    475475
    476476        // Set up a session object for this peer
    477477
    bool CNetServerWorker::RunStep()  
    496496        CNetServerSession* session = static_cast<CNetServerSession*>(event.peer->data);
    497497        if (session)
    498498        {
    499             LOGMESSAGE("Net server: Disconnected %hs", DebugName(session).c_str());
     499            LOGMESSAGE("Net server: Disconnected %s", DebugName(session).c_str());
    500500
    501501            // Remove the session first, so we won't send player-update messages to it
    502502            // when updating the FSM
    bool CNetServerWorker::RunStep()  
    522522            CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, GetScriptInterface());
    523523            if (msg)
    524524            {
    525                 LOGMESSAGE("Net server: Received message %hs of size %lu from %hs", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str());
     525                LOGMESSAGE("Net server: Received message %s of size %lu from %s", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str());
    526526
    527527                HandleMessageReceive(msg, session);
    528528
    bool CNetServerWorker::OnAuthenticate(void* context, CFsmEvent* event)  
    810810        // Players who weren't already in the game are not allowed to join now that it's started
    811811        if (!isRejoining)
    812812        {
    813             LOGMESSAGE("Refused connection after game start from not-previously-known user \"%ls\"", username.c_str());
     813            LOGMESSAGE("Refused connection after game start from not-previously-known user \"%s\"", username.c_str());
    814814            session->Disconnect(NDR_SERVER_ALREADY_IN_GAME);
    815815            return true;
    816816        }
  • source/network/NetSession.cpp

    diff --git a/source/network/NetSession.cpp b/source/network/NetSession.cpp
    index cadf277..82fa031 100644
    a b void CNetClientSession::Poll()  
    112112            // Report the server address
    113113            char hostname[256] = "(error)";
    114114            enet_address_get_host_ip(&event.peer->address, hostname, ARRAY_SIZE(hostname));
    115             LOGMESSAGE("Net client: Connected to %hs:%u", hostname, (unsigned int)event.peer->address.port);
     115            LOGMESSAGE("Net client: Connected to %s:%u", hostname, (unsigned int)event.peer->address.port);
    116116
    117117            m_Client.HandleConnect();
    118118
    void CNetClientSession::Poll()  
    133133            CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, m_Client.GetScriptInterface());
    134134            if (msg)
    135135            {
    136                 LOGMESSAGE("Net client: Received message %hs of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength());
     136                LOGMESSAGE("Net client: Received message %s of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength());
    137137
    138138                m_Client.HandleMessage(msg);
    139139
  • source/network/NetTurnManager.cpp

    diff --git a/source/network/NetTurnManager.cpp b/source/network/NetTurnManager.cpp
    index 2b9ade2..5a57470 100644
    a b void CNetTurnManager::OnSyncError(u32 turn, const std::string& expectedHash)  
    244244    if (g_GUI)
    245245        g_GUI->DisplayMessageBox(600, 350, L"Sync error", msg.str());
    246246    else
    247         LOGERROR("%ls", msg.str().c_str());
     247        LOGERROR("%s", msg.str().c_str());
    248248}
    249249
    250250void CNetTurnManager::Interpolate(float simFrameLength, float realFrameLength)
  • source/ps/CStrIntern.cpp

    diff --git a/source/ps/CStrIntern.cpp b/source/ps/CStrIntern.cpp
    index 6d87a4c..6692b35 100644
    a b public:  
    3030    CStrInternInternals(const char* str, size_t len)
    3131        : data(str, str+len), hash(fnv_hash(str, len))
    3232    {
    33 //      LOGWARNING("New interned string '%hs'", data.c_str());
     33//      LOGWARNING("New interned string '%s'", data.c_str());
    3434    }
    3535
    3636    bool operator==(const CStrInternInternals& b) const
  • source/ps/ConfigDB.cpp

    diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp
    index 9ab102c..2c14e15 100644
    a b bool CConfigDB::Reload(EConfigNamespace ns)  
    214214        // Handle missing files quietly
    215215        if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0)
    216216        {
    217             LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string8());
     217            LOGMESSAGE("Cannot find config file \"%s\" - ignoring", m_ConfigFile[ns].string8());
    218218            return false;
    219219        }
    220220
    221         LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string8());
     221        LOGMESSAGE("Loading config file \"%s\"", m_ConfigFile[ns].string8());
    222222        Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen);
    223223        if (ret != INFO::OK)
    224224        {
    225             LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string8(), (long long)ret);
     225            LOGERROR("CConfigDB::Reload(): vfs_load for \"%s\" failed: return was %lld", m_ConfigFile[ns].string8(), (long long)ret);
    226226            return false;
    227227        }
    228228    }
    bool CConfigDB::Reload(EConfigNamespace ns)  
    256256
    257257            if (pos == filebufend || *pos == '\n')
    258258            {
    259                 LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string8());
     259                LOGERROR("Config header with missing close tag encountered on line %d in '%s'", line, m_ConfigFile[ns].string8());
    260260                header.clear();
    261261                ++line;
    262262                continue;
    263263            }
    264264
    265             LOGMESSAGE("Found config header '%hs'", header.c_str());
     265            LOGMESSAGE("Found config header '%s'", header.c_str());
    266266            header.push_back('.');
    267267            while (++pos < filebufend && *pos != '\n' && *pos != ';')
    268268                if (*pos != ' ' && *pos != '\r')
    269269                {
    270                     LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string8());
     270                    LOGERROR("Config settings on the same line as a header on line %d in '%s'", line, m_ConfigFile[ns].string8());
    271271                    break;
    272272                }
    273273            while (pos < filebufend && *pos != '\n')
    bool CConfigDB::Reload(EConfigNamespace ns)  
    288288                    {
    289289                        if (*pos == '\\' && ++pos == filebufend)
    290290                        {
    291                             LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string8());
     291                            LOGERROR("Escape character at end of input (line %d in '%s')", line, m_ConfigFile[ns].string8());
    292292                            break;
    293293                        }
    294294
    bool CConfigDB::Reload(EConfigNamespace ns)  
    316316                }
    317317            }
    318318            if (quoted) // We ignore the invalid parameter
    319                 LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string8(), line);
     319                LOGERROR("Unmatched quote while parsing config file '%s' on line %d", m_ConfigFile[ns].string8(), line);
    320320            else if (!value.empty())
    321321                values.push_back(value);
    322322            value.clear();
    bool CConfigDB::Reload(EConfigNamespace ns)  
    337337            CStr key(header + name);
    338338            newMap[key] = values;
    339339            if (key == "lobby.password")
    340                 LOGMESSAGE("Loaded config string \"%hs\"", key.c_str());
     340                LOGMESSAGE("Loaded config string \"%s\"", key.c_str());
    341341            else
    342342            {
    343343                std::string vals;
    344344                for (size_t i = 0; i < newMap[key].size() - 1; ++i)
    345345                    vals += "\"" + EscapeString(newMap[key][i]) + "\", ";
    346346                vals += "\"" + EscapeString(newMap[key][values.size()-1]) + "\"";
    347                 LOGMESSAGE("Loaded config string \"%hs\" = %hs", key.c_str(), vals.c_str());
     347                LOGMESSAGE("Loaded config string \"%s\" = %s", key.c_str(), vals.c_str());
    348348            }
    349349        }
    350350        else if (!name.empty())
    351             LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string8(), line);
     351            LOGERROR("Encountered config setting '%s' without value while parsing '%s' on line %d", name.c_str(), m_ConfigFile[ns].string8(), line);
    352352
    353353        name.clear();
    354354        values.clear();
    bool CConfigDB::Reload(EConfigNamespace ns)  
    356356    }
    357357
    358358    if (!name.empty())
    359         LOGERROR("Config file does not have a new line after the last config setting '%hs'", name.c_str());
     359        LOGERROR("Config file does not have a new line after the last config setting '%s'", name.c_str());
    360360
    361361    m_Map[ns].swap(newMap);
    362362
    bool CConfigDB::WriteFile(EConfigNamespace ns, const VfsPath& path)  
    393393    Status ret = g_VFS->CreateFile(path, buf, len);
    394394    if (ret < 0)
    395395    {
    396         LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string8(), (int)ret);
     396        LOGERROR("CConfigDB::WriteFile(): CreateFile \"%s\" failed (error: %d)", path.string8(), (int)ret);
    397397        return false;
    398398    }
    399399
  • source/ps/DllLoader.cpp

    diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp
    index 758ba81..18151ad 100644
    a b void DllLoader::LogLoadError(const char* errors)  
    196196    switch (m_LoadErrorLogMethod)
    197197    {
    198198    case CLogger::Normal:
    199         LOGMESSAGE("DllLoader: %hs", errors);
     199        LOGMESSAGE("DllLoader: %s", errors);
    200200        break;
    201201    case CLogger::Warning:
    202         LOGWARNING("DllLoader: %hs", errors);
     202        LOGWARNING("DllLoader: %s", errors);
    203203        break;
    204204    case CLogger::Error:
    205         LOGERROR("DllLoader: %hs", errors);
     205        LOGERROR("DllLoader: %s", errors);
    206206        break;
    207207    }
    208208}
  • source/ps/FileIo.cpp

    diff --git a/source/ps/FileIo.cpp b/source/ps/FileIo.cpp
    index 8ffa31b..f8c358e 100644
    a b void CFilePacker::Write(const VfsPath& filename)  
    6969    const Status st = g_VFS->CreateFile(filename, m_writeBuffer.Data(), m_writeBuffer.Size());
    7070    if (st < 0)
    7171    {
    72         LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string8(), (long long)st);
     72        LOGERROR("Failed to write file '%s' with status '%lld'", filename.string8(), (long long)st);
    7373        throw PSERROR_File_WriteFailed();
    7474    }
    7575}
  • source/ps/Filesystem.cpp

    diff --git a/source/ps/Filesystem.cpp b/source/ps/Filesystem.cpp
    index 1c5a446..be16108 100644
    a b PSRETURN CVFSFile::Load(const PIVFS& vfs, const VfsPath& filename, bool log /* =  
    124124    if (ret != INFO::OK)
    125125    {
    126126        if (log)
    127             LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string8(), (long long)ret);
     127            LOGERROR("CVFSFile: file %s couldn't be opened (vfs_load: %lld)", filename.string8(), (long long)ret);
    128128        m_Buffer.reset();
    129129        m_BufferSize = 0;
    130130        return PSRETURN_CVFSFile_LoadFailed;
  • source/ps/GameSetup/GameSetup.cpp

    diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp
    index 13bd34e..d1fb63c 100644
    a b void Render()  
    293293#warning TODO: cursors for Android
    294294#else
    295295            if (cursor_draw(g_VFS, cursorName.c_str(), g_mouse_x, g_yres-g_mouse_y, forceGL) < 0)
    296                 LOGWARNING("Failed to draw cursor '%ls'", cursorName.c_str());
     296                LOGWARNING("Failed to draw cursor '%s'", cursorName.c_str());
    297297#endif
    298298
    299299#if CONFIG2_GLES
    static void InitSDL()  
    656656
    657657    if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) < 0)
    658658    {
    659         LOGERROR("SDL library initialization failed: %hs", SDL_GetError());
     659        LOGERROR("SDL library initialization failed: %s", SDL_GetError());
    660660        throw PSERROR_System_SDLInitFailed();
    661661    }
    662662    atexit(SDL_Quit);
    static void FixLocales()  
    819819        for (size_t i = 0; i < ARRAY_SIZE(LocaleEnvVars); i++)
    820820        {
    821821            if (char* envval = getenv(LocaleEnvVars[i]))
    822                 LOGWARNING("  %hs=\"%hs\"", LocaleEnvVars[i], envval);
     822                LOGWARNING("  %s=\"%s\"", LocaleEnvVars[i], envval);
    823823            else
    824                 LOGWARNING("  %hs=\"(unset)\"", LocaleEnvVars[i]);
     824                LOGWARNING("  %s=\"(unset)\"", LocaleEnvVars[i]);
    825825        }
    826826
    827827        // We should set LC_ALL since it overrides LANG
    828828        if (setenv("LC_ALL", std::locale::classic().name().c_str(), 1))
    829829            debug_warn(L"Invalid locale settings, and unable to set LC_ALL env variable.");
    830830        else
    831             LOGWARNING("Setting LC_ALL env variable to: %hs", getenv("LC_ALL"));
     831            LOGWARNING("Setting LC_ALL env variable to: %s", getenv("LC_ALL"));
    832832    }
    833833}
    834834#else
    CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath)  
    11321132
    11331133    if (INFO::OK != loadResult)
    11341134    {
    1135         LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string8());
     1135        LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%s'", mapPath.string8());
    11361136        throw PSERROR_Game_World_MapLoadFailed("Unable to load map file, check the path for typos.");
    11371137    }
    11381138    XMBElement mapElement = mapFile.GetRoot();
    bool Autostart(const CmdLineArgs& args)  
    12461246        else
    12471247        {
    12481248            // Problem with JSON file
    1249             LOGERROR("Autostart: Error reading random map script '%ls'", scriptPath.c_str());
     1249            LOGERROR("Autostart: Error reading random map script '%s'", scriptPath.c_str());
    12501250            throw PSERROR_Game_World_MapLoadFailed("Error reading random map script.\nCheck application log for details.");
    12511251        }
    12521252
    bool Autostart(const CmdLineArgs& args)  
    13011301    }
    13021302    else
    13031303    {
    1304         LOGERROR("Autostart: Unrecognized map type '%ls'", mapDirectory.c_str());
     1304        LOGERROR("Autostart: Unrecognized map type '%s'", mapDirectory.c_str());
    13051305        throw PSERROR_Game_World_MapLoadFailed("Unrecognized map type.\nConsult readme.txt for the currently supported types.");
    13061306    }
    13071307    scriptInterface.SetProperty(attrs, "mapType", mapType);
  • source/ps/GameSetup/Paths.cpp

    diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp
    index db53c54..434f02c 100644
    a b Paths::Paths(const CmdLineArgs& args)  
    172172    // make sure it's valid
    173173    if(!FileExists(pathname))
    174174    {
    175         LOGERROR("Cannot find executable (expected at '%ls')", pathname.string8());
     175        LOGERROR("Cannot find executable (expected at '%s')", pathname.string8());
    176176        WARN_IF_ERR(StatusFromErrno());
    177177    }
    178178
  • source/ps/Hotkey.cpp

    diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp
    index cd7730b..42cc72a 100644
    a b static void LoadConfigBindings()  
    8383                int mapping = FindKeyCode(*it);
    8484                if (!mapping)
    8585                {
    86                     LOGWARNING("Hotkey mapping used invalid key '%hs'", hotkey.c_str());
     86                    LOGWARNING("Hotkey mapping used invalid key '%s'", hotkey.c_str());
    8787                    continue;
    8888                }
    8989
  • source/ps/Joystick.cpp

    diff --git a/source/ps/Joystick.cpp b/source/ps/Joystick.cpp
    index 3fa207a..d219f1d 100644
    a b void CJoystick::Initialise()  
    4141
    4242    if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
    4343    {
    44         LOGERROR("CJoystick::Initialise failed to initialise joysticks (\"%hs\")", SDL_GetError());
     44        LOGERROR("CJoystick::Initialise failed to initialise joysticks (\"%s\")", SDL_GetError());
    4545        return;
    4646    }
    4747
    void CJoystick::Initialise()  
    5555        SDL_Joystick* stick = SDL_JoystickOpen(i);
    5656        if (!stick)
    5757        {
    58             LOGERROR("CJoystick::Initialise failed to open joystick %d (\"%hs\")", i, SDL_GetError());
     58            LOGERROR("CJoystick::Initialise failed to open joystick %d (\"%s\")", i, SDL_GetError());
    5959            continue;
    6060        }
    6161        const char* name = SDL_JoystickName(stick);
    6262#else // SDL 1.2
    6363        const char* name = SDL_JoystickName(i);
    6464#endif
    65         LOGMESSAGE("Joystick %d: %hs", i, name);
     65        LOGMESSAGE("Joystick %d: %s", i, name);
    6666#if SDL_VERSION_ATLEAST(2, 0, 0)
    6767        SDL_JoystickClose(stick);
    6868#endif
    void CJoystick::Initialise()  
    7575        // Always pick the first joystick, and assume that's the right one
    7676        m_Joystick = SDL_JoystickOpen(0);
    7777        if (!m_Joystick)
    78             LOGERROR("CJoystick::Initialise failed to open joystick (\"%hs\")", SDL_GetError());
     78            LOGERROR("CJoystick::Initialise failed to open joystick (\"%s\")", SDL_GetError());
    7979    }
    8080}
    8181
  • source/ps/Overlay.cpp

    diff --git a/source/ps/Overlay.cpp b/source/ps/Overlay.cpp
    index a7e90aa..2bf190c 100644
    a b bool CColor::ParseString(const CStr8& Value, int DefaultAlpha)  
    4848        stream >> values[i];
    4949        if ((stream.rdstate() & std::stringstream::failbit) != 0)
    5050        {
    51             LOGWARNING("Unable to parse CColor parameters. Your input: '%hs'", Value.c_str());
     51            LOGWARNING("Unable to parse CColor parameters. Your input: '%s'", Value.c_str());
    5252            return false;
    5353        }
    5454        if (values[i] < 0 || values[i] > 255)
    5555        {
    56             LOGWARNING("Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%hs'", Value.c_str());
     56            LOGWARNING("Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%s'", Value.c_str());
    5757            return false;
    5858        }
    5959    }
    6060
    6161    if (i < 3)
    6262    {
    63         LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%hs'", Value.c_str());
     63        LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%s'", Value.c_str());
    6464        return false;
    6565    }
    6666    if (!stream.eof())
    6767    {
    68         LOGWARNING("Too many parameters when parsing as CColor. Your input: '%hs'", Value.c_str());
     68        LOGWARNING("Too many parameters when parsing as CColor. Your input: '%s'", Value.c_str());
    6969        return false;
    7070    }
    7171
  • source/ps/Preprocessor.cpp

    diff --git a/source/ps/Preprocessor.cpp b/source/ps/Preprocessor.cpp
    index 7821423..f3a9ede 100644
    a b static void DefaultError (void *iData, int iLine, const char *iError,  
    231231{
    232232    (void)iData;
    233233    if (iToken)
    234         LOGERROR("Preprocessor error: line %d: %hs: '%.*hs'\n",
     234        LOGERROR("Preprocessor error: line %d: %s: '%.*hs'\n",
    235235                  iLine, iError, int (iTokenLen), iToken);
    236236    else
    237         LOGERROR("Preprocessor error: line %d: %hs\n", iLine, iError);
     237        LOGERROR("Preprocessor error: line %d: %s\n", iLine, iError);
    238238}
    239239
    240240//---------------------------------------------------------------------------//
  • source/ps/PreprocessorWrapper.cpp

    diff --git a/source/ps/PreprocessorWrapper.cpp b/source/ps/PreprocessorWrapper.cpp
    index 096d284..f4ca4ce 100644
    a b bool CPreprocessorWrapper::TestConditional(const CStr& expr)  
    5151
    5252    if (!output)
    5353    {
    54         LOGERROR("Failed to parse conditional expression '%hs'", expr.c_str());
     54        LOGERROR("Failed to parse conditional expression '%s'", expr.c_str());
    5555        return false;
    5656    }
    5757
  • source/ps/ProfileViewer.cpp

    diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp
    index 2551a02..d1ef938 100644
    a b void CProfileViewer::SaveToFile()  
    575575        }
    576576        else
    577577        {
    578             LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string8());
     578            LOGMESSAGERENDER("Profiler snapshot saved to '%s'", path.string8());
    579579        }
    580580    }
    581581
  • source/ps/Profiler2.cpp

    diff --git a/source/ps/Profiler2.cpp b/source/ps/Profiler2.cpp
    index d989e42..5f8a505 100644
    a b static void* MgCallback(mg_event event, struct mg_connection *conn, const struct  
    126126
    127127    case MG_EVENT_LOG:
    128128        // Called by Mongoose's cry()
    129         LOGERROR("Mongoose error: %hs", request_info->log_message);
     129        LOGERROR("Mongoose error: %s", request_info->log_message);
    130130        return NULL;
    131131
    132132    case MG_INIT_SSL:
  • source/ps/SavedGame.cpp

    diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp
    index a1c5855..94421b5 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(g_L10n.Translate("Saved game to '%ls'"), realPath.string8());
     129    LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%s'"), realPath.string8());
    130130
    131131    return INFO::OK;
    132132}
    std::vector<CScriptValRooted> SavedGames::GetSavedGames(ScriptInterface& scriptI  
    244244        if (!archiveReader)
    245245        {
    246246            // Triggered by e.g. the file being open in another program
    247             LOGWARNING("Failed to read saved game '%ls'", realPath.string8());
     247            LOGWARNING("Failed to read saved game '%s'", realPath.string8());
    248248            continue; // skip this file
    249249        }
    250250
  • source/ps/TemplateLoader.cpp

    diff --git a/source/ps/TemplateLoader.cpp b/source/ps/TemplateLoader.cpp
    index 67029d6..dba610f 100644
    a b bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    3939    // Handle infinite loops more gracefully than running out of stack space and crashing
    4040    if (depth > 100)
    4141    {
    42         LOGERROR("Probable infinite inheritance loop in entity template '%hs'", templateName.c_str());
     42        LOGERROR("Probable infinite inheritance loop in entity template '%s'", templateName.c_str());
    4343        return false;
    4444    }
    4545
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    5757        std::string baseName = templateName.substr(8);
    5858        if (!LoadTemplateFile(baseName, depth+1))
    5959        {
    60             LOGERROR("Failed to load entity template '%hs'", baseName.c_str());
     60            LOGERROR("Failed to load entity template '%s'", baseName.c_str());
    6161            return false;
    6262        }
    6363        // Copy a subset to the requested template
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    7272        std::string baseName = templateName.substr(7);
    7373        if (!LoadTemplateFile(baseName, depth+1))
    7474        {
    75             LOGERROR("Failed to load entity template '%hs'", baseName.c_str());
     75            LOGERROR("Failed to load entity template '%s'", baseName.c_str());
    7676            return false;
    7777        }
    7878        // Copy a subset to the requested template
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    8787        std::string baseName = templateName.substr(7);
    8888        if (!LoadTemplateFile(baseName, depth+1))
    8989        {
    90             LOGERROR("Failed to load entity template '%hs'", baseName.c_str());
     90            LOGERROR("Failed to load entity template '%s'", baseName.c_str());
    9191            return false;
    9292        }
    9393        // Copy a subset to the requested template
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    102102        std::string baseName = templateName.substr(11);
    103103        if (!LoadTemplateFile(baseName, depth+1))
    104104        {
    105             LOGERROR("Failed to load entity template '%hs'", baseName.c_str());
     105            LOGERROR("Failed to load entity template '%s'", baseName.c_str());
    106106            return false;
    107107        }
    108108        // Copy a subset to the requested template
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    117117        std::string baseName = templateName.substr(13);
    118118        if (!LoadTemplateFile(baseName, depth+1))
    119119        {
    120             LOGERROR("Failed to load entity template '%hs'", baseName.c_str());
     120            LOGERROR("Failed to load entity template '%s'", baseName.c_str());
    121121            return false;
    122122        }
    123123        // Copy a subset to the requested template
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    132132        std::string baseName = templateName.substr(9);
    133133        if (!LoadTemplateFile(baseName, depth+1))
    134134        {
    135             LOGERROR("Failed to load entity template '%hs'", baseName.c_str());
     135            LOGERROR("Failed to load entity template '%s'", baseName.c_str());
    136136            return false;
    137137        }
    138138        // Copy a subset to the requested template
    bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept  
    155155        // To prevent needless complexity in template design, we don't allow |-separated strings as parents
    156156        if (parentName.find('|') != parentName.npos)
    157157        {
    158             LOGERROR("Invalid parent '%hs' in entity template '%hs'", parentName.c_str(), templateName.c_str());
     158            LOGERROR("Invalid parent '%s' in entity template '%s'", parentName.c_str(), templateName.c_str());
    159159            return false;
    160160        }
    161161
    162162        // Ensure the parent is loaded
    163163        if (!LoadTemplateFile(parentName, depth+1))
    164164        {
    165             LOGERROR("Failed to load parent '%hs' of entity template '%hs'", parentName.c_str(), templateName.c_str());
     165            LOGERROR("Failed to load parent '%s' of entity template '%s'", parentName.c_str(), templateName.c_str());
    166166            return false;
    167167        }
    168168
    const CParamNode& CTemplateLoader::GetTemplateFileData(const std::string& templa  
    314314    // Load the template if necessary
    315315    if (!LoadTemplateFile(templateName, 0))
    316316    {
    317         LOGERROR("Failed to load entity template '%hs'", templateName.c_str());
     317        LOGERROR("Failed to load entity template '%s'", templateName.c_str());
    318318        return NULL_NODE;
    319319    }
    320320
    void CTemplateLoader::ConstructTemplateActor(const std::string& actorName, CPara  
    327327    const char* templateName = "special/actor";
    328328    if (!LoadTemplateFile(templateName, 0))
    329329    {
    330         LOGERROR("Failed to load entity template '%hs'", templateName);
     330        LOGERROR("Failed to load entity template '%s'", templateName);
    331331        return;
    332332    }
    333333
  • source/ps/Util.cpp

    diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp
    index 8e66339..17c58d1 100644
    a b void WriteScreenshot(const VfsPath& extension)  
    241241    {
    242242        OsPath realPath;
    243243        g_VFS->GetRealPath(filename, realPath);
    244         LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8());
     244        LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%s'"), realPath.string8());
    245245    }
    246246    else
    247         LOGERROR("Error writing screenshot to '%ls'", filename.string8());
     247        LOGERROR("Error writing screenshot to '%s'", filename.string8());
    248248}
    249249
    250250
    void WriteBigScreenshot(const VfsPath& extension, int tiles)  
    374374    {
    375375        OsPath realPath;
    376376        g_VFS->GetRealPath(filename, realPath);
    377         LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8());
     377        LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%s'"), realPath.string8());
    378378    }
    379379    else
    380         LOGERROR("Error writing screenshot to '%ls'", filename.string8());
     380        LOGERROR("Error writing screenshot to '%s'", filename.string8());
    381381
    382382    free(tile_data);
    383383}
  • source/ps/VideoMode.cpp

    diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp
    index de429e0..08b6a44 100644
    a b bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    9797            }
    9898            else
    9999            {
    100                 LOGERROR("SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%hs\")",
     100                LOGERROR("SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%s\")",
    101101                    w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
    102102                return false;
    103103            }
    bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    105105
    106106        if (SDL_SetWindowDisplayMode(m_Window, NULL) < 0)
    107107        {
    108             LOGERROR("SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%hs\")",
     108            LOGERROR("SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%s\")",
    109109                w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
    110110            return false;
    111111        }
    bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    113113        SDL_GLContext context = SDL_GL_CreateContext(m_Window);
    114114        if (!context)
    115115        {
    116             LOGERROR("SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%hs\")",
     116            LOGERROR("SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%s\")",
    117117                w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
    118118            return false;
    119119        }
    bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    132132
    133133            if (SDL_SetWindowFullscreen(m_Window, flags) < 0)
    134134            {
    135                 LOGERROR("SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%hs\")",
     135                LOGERROR("SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%s\")",
    136136                    w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
    137137                return false;
    138138            }
    bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    181181        }
    182182        else
    183183        {
    184             LOGERROR("SetVideoMode failed: %dx%d:%d %d (\"%hs\")",
     184            LOGERROR("SetVideoMode failed: %dx%d:%d %d (\"%s\")",
    185185                w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
    186186            return false;
    187187        }
  • source/ps/World.cpp

    diff --git a/source/ps/World.cpp b/source/ps/World.cpp
    index 60a4b66..5a20b3c 100644
    a b void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings  
    8989        catch (PSERROR_File& err)
    9090        {
    9191            delete reader;
    92             LOGERROR("Failed to load map %ls: %hs", mapfilename.string8(), err.what());
     92            LOGERROR("Failed to load map %s: %s", mapfilename.string8(), err.what());
    9393            throw PSERROR_Game_World_MapLoadFailed("Failed to load map.\nCheck application log for details.");
    9494        }
    9595    }
  • source/ps/XML/XMLWriter.cpp

    diff --git a/source/ps/XML/XMLWriter.cpp b/source/ps/XML/XMLWriter.cpp
    index b104c67..9c3e9a0 100644
    a b bool XMLWriter_File::StoreVFS(const PIVFS& vfs, const VfsPath& pathname)  
    102102    Status ret = vfs->CreateFile(pathname, data, size);
    103103    if (ret < 0)
    104104    {
    105         LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string8());
     105        LOGERROR("Error saving XML data through VFS: %lld '%s'", (long long)ret, pathname.string8());
    106106        return false;
    107107    }
    108108    return true;
  • source/ps/XML/Xeromyces.cpp

    diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp
    index d4aea8d..9e2709e 100644
    a b static void errorHandler(void* UNUSED(userData), xmlErrorPtr error)  
    3838    if (message.length() > 0 && message[message.length()-1] == '\n')
    3939        message.erase(message.length()-1);
    4040
    41     LOGERROR("CXeromyces: Parse %ls: %hs:%d: %hs",
     41    LOGERROR("CXeromyces: Parse %s: %s:%d: %s",
    4242        error->level == XML_ERR_WARNING ? L"warning" : L"error",
    4343        error->file, error->line, message.c_str());
    4444    // TODO: The (non-fatal) warnings and errors don't get stored in the XMB,
    PSRETURN CXeromyces::Load(const PIVFS& vfs, const VfsPath& filename)  
    8989
    9090        // No source file or archive cache was found, so we can't load the
    9191        // XML file at all
    92         LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string8());
     92        LOGERROR("CCacheLoader failed to find archived or source file for: \"%s\"", filename.string8());
    9393        return PSRETURN_Xeromyces_XMLOpenFailed;
    9494    }
    9595
    PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons  
    111111    CVFSFile input;
    112112    if (input.Load(vfs, filename))
    113113    {
    114         LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string8());
     114        LOGERROR("CXeromyces: Failed to open XML file %s", filename.string8());
    115115        return PSRETURN_Xeromyces_XMLOpenFailed;
    116116    }
    117117
    PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons  
    120120        filename8.c_str(), NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA);
    121121    if (! doc)
    122122    {
    123         LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string8());
     123        LOGERROR("CXeromyces: Failed to parse XML file %s", filename.string8());
    124124        return PSRETURN_Xeromyces_XMLParseError;
    125125    }
    126126
  • source/renderer/DecalRData.cpp

    diff --git a/source/renderer/DecalRData.cpp b/source/renderer/DecalRData.cpp
    index 62c565b..363f7b4 100644
    a b void CDecalRData::RenderDecals(std::vector<CDecalRData*>& decals, const CShaderD  
    9898           
    9999            if (!techBase)
    100100            {
    101                 LOGERROR("Terrain renderer failed to load shader effect (%hs)\n",           
     101                LOGERROR("Terrain renderer failed to load shader effect (%s)\n",           
    102102                        material.GetShaderEffect().string().c_str());
    103103                continue;
    104104            }
  • source/renderer/ModelRenderer.cpp

    diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp
    index 6c13815..941b4e2 100644
    a b void ModelRenderer::BuildPositionAndNormals(  
    9898        // some broken situations
    9999        if (numVertices && vertices[0].m_Blend.m_Bone[0] == 0xff)
    100100        {
    101             LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string8());
     101            LOGERROR("Model %s is boned with unboned animation", mdef->GetName().string8());
    102102            return;
    103103        }
    104104
  • source/renderer/PostprocManager.cpp

    diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp
    index becfb1c..81cc923 100644
    a b std::vector<CStrW> CPostprocManager::GetPostEffects()  
    519519   
    520520    VfsPaths pathnames;
    521521    if(vfs::GetPathnames(g_VFS, path, 0, pathnames) < 0)
    522         LOGERROR("Error finding Post effects in '%ls'", path.string8());
     522        LOGERROR("Error finding Post effects in '%s'", path.string8());
    523523
    524524    for(size_t i = 0; i < pathnames.size(); i++)
    525525    {
  • source/renderer/Renderer.cpp

    diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp
    index 398c331..3fe81ab 100644
    a b CRenderer::RenderPath CRenderer::GetRenderPathByName(const CStr& name)  
    843843    if (name == "default")
    844844        return RP_DEFAULT;
    845845
    846     LOGWARNING("Unknown render path name '%hs', assuming 'default'", name.c_str());
     846    LOGWARNING("Unknown render path name '%s', assuming 'default'", name.c_str());
    847847    return RP_DEFAULT;
    848848}
    849849
  • source/renderer/ShadowMap.cpp

    diff --git a/source/renderer/ShadowMap.cpp b/source/renderer/ShadowMap.cpp
    index e23e555..934eefd 100644
    a b void ShadowMapInternals::CreateTexture()  
    406406    default: formatname = "DEPTH_COMPONENT"; break;
    407407    }
    408408
    409     LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %hs)",
     409    LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %s)",
    410410        Width, Height, formatname);
    411411
    412412
  • source/renderer/SkyManager.cpp

    diff --git a/source/renderer/SkyManager.cpp b/source/renderer/SkyManager.cpp
    index 49b6def..d65c054 100644
    a b std::vector<CStrW> SkyManager::GetSkySets() const  
    207207    DirectoryNames subdirectories;
    208208    if(g_VFS->GetDirectoryEntries(path, 0, &subdirectories) < 0)
    209209    {
    210         LOGERROR("Error opening directory '%ls'", path.string8());
     210        LOGERROR("Error opening directory '%s'", path.string8());
    211211        return std::vector<CStrW>(1, GetSkySet()); // just return what we currently have
    212212    }
    213213
  • source/scriptinterface/DebuggingServer.cpp

    diff --git a/source/scriptinterface/DebuggingServer.cpp b/source/scriptinterface/DebuggingServer.cpp
    index 1b8b9bf..366a1c1 100644
    a b void* CDebuggingServer::MgDebuggingServerCallback(mg_event event, struct mg_conn  
    396396
    397397    case MG_EVENT_LOG:
    398398        // Called by Mongoose's cry()
    399         LOGERROR("Mongoose error: %hs", request_info->log_message);
     399        LOGERROR("Mongoose error: %s", request_info->log_message);
    400400        return NULL;
    401401
    402402    case MG_INIT_SSL:
  • source/scriptinterface/ScriptInterface.cpp

    diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp
    index 31fa302..975cde1 100644
    a b void ErrorReporter(JSContext* cx, const char* message, JSErrorReport* report)  
    126126    }
    127127
    128128    if (isWarning)
    129         LOGWARNING("%hs", msg.str().c_str());
     129        LOGWARNING("%s", msg.str().c_str());
    130130    else
    131         LOGERROR("%hs", msg.str().c_str());
     131        LOGERROR("%s", msg.str().c_str());
    132132
    133133    // When running under Valgrind, print more information in the error message
    134134//  VALGRIND_PRINTF_BACKTRACE("->");
    JSBool logmsg(JSContext* cx, uint argc, jsval* vp)  
    163163    std::wstring str;
    164164    if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str))
    165165        return JS_FALSE;
    166     LOGMESSAGE("%ls", str.c_str());
     166    LOGMESSAGE("%s", str.c_str());
    167167    args.rval().setUndefined();
    168168    return JS_TRUE;
    169169}
    JSBool warn(JSContext* cx, uint argc, jsval* vp)  
    180180    std::wstring str;
    181181    if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str))
    182182        return JS_FALSE;
    183     LOGWARNING("%ls", str.c_str());
     183    LOGWARNING("%s", str.c_str());
    184184    args.rval().setUndefined();
    185185    return JS_TRUE;
    186186}
    JSBool error(JSContext* cx, uint argc, jsval* vp)  
    197197    std::wstring str;
    198198    if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str))
    199199        return JS_FALSE;
    200     LOGERROR("%ls", str.c_str());
     200    LOGERROR("%s", str.c_str());
    201201    args.rval().setUndefined();
    202202    return JS_TRUE;
    203203}
    bool ScriptInterface::LoadGlobalScripts()  
    478478    {
    479479        if (!LoadGlobalScriptFile(*it))
    480480        {
    481             LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string8());
     481            LOGERROR("LoadGlobalScripts: Failed to load script %s", it->string8());
    482482            return false;
    483483        }
    484484    }
    bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)  
    866866    JSAutoRequest rq(m->m_cx);
    867867    if (!VfsFileExists(path))
    868868    {
    869         LOGERROR("File '%ls' does not exist", path.string8());
     869        LOGERROR("File '%s' does not exist", path.string8());
    870870        return false;
    871871    }
    872872
    bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)  
    876876
    877877    if (ret != PSRETURN_OK)
    878878    {
    879         LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
     879        LOGERROR("Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
    880880        return false;
    881881    }
    882882
    bool ScriptInterface::ParseJSON(const std::string& string_utf8, JS::MutableHandl  
    946946
    947947    std::wstring error;
    948948    ScriptInterface::FromJSVal(m->m_cx, rval, error);
    949     LOGERROR("%ls", error.c_str());
     949    LOGERROR("%s", error.c_str());
    950950    return false;
    951951}
    952952
    void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o  
    954954{
    955955    if (!VfsFileExists(path))
    956956    {
    957         LOGERROR("File '%ls' does not exist", path.string8());
     957        LOGERROR("File '%s' does not exist", path.string8());
    958958        return;
    959959    }
    960960
    void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o  
    964964
    965965    if (ret != PSRETURN_OK)
    966966    {
    967         LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
     967        LOGERROR("Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
    968968        return;
    969969    }
    970970
    971971    std::string content(file.DecodeUTF8()); // assume it's UTF-8
    972972
    973973    if (!ParseJSON(content, out))
    974         LOGERROR("Failed to parse '%ls'", path.string8());
     974        LOGERROR("Failed to parse '%s'", path.string8());
    975975}
    976976
    977977struct Stringifier
  • source/scriptinterface/ThreadDebugger.cpp

    diff --git a/source/scriptinterface/ThreadDebugger.cpp b/source/scriptinterface/ThreadDebugger.cpp
    index a320f02..f5d9768 100644
    a b std::string CThreadDebugger::StringifyCyclicJSON(jsval obj, bool indent)  
    858858                if (JSVAL_IS_STRING(execString))
    859859                {
    860860                    std::string strExec = JS_EncodeString(m->m_pScriptInterface->GetContext(), JSVAL_TO_STRING(execString));
    861                     LOGERROR("Error: %hs", strExec.c_str());
     861                    LOGERROR("Error: %s", strExec.c_str());
    862862                }
    863863            }
    864864           
  • source/simulation2/Simulation2.cpp

    diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp
    index 8573fe8..fbb1664 100644
    a b bool CSimulation2Impl::LoadScripts(CComponentManager& componentManager, std::set  
    187187        VfsPath filename = *it;
    188188        if (loadedScripts)
    189189            loadedScripts->insert(filename);
    190         LOGMESSAGE("Loading simulation script '%ls'", filename.string8());
     190        LOGMESSAGE("Loading simulation script '%s'", filename.string8());
    191191        if (!componentManager.LoadScript(filename))
    192192            ok = false;
    193193    }
    bool CSimulation2Impl::LoadTriggerScripts(CComponentManager& componentManager, J  
    204204        for (u32 i = 0; i < scriptNames.size(); ++i)
    205205        {
    206206            std::string scriptName = "maps/" + scriptNames[i];
    207             LOGMESSAGE("Loading trigger script '%hs'", scriptName.c_str());
     207            LOGMESSAGE("Loading trigger script '%s'", scriptName.c_str());
    208208            if (!componentManager.LoadScript(scriptName.data()))
    209209                ok = false;
    210210        }
    Status CSimulation2Impl::ReloadChangedFile(const VfsPath& path)  
    224224    if (!VfsFileExists(path))
    225225        return INFO::OK;
    226226
    227     LOGMESSAGE("Reloading simulation script '%ls'", path.string8());
     227    LOGMESSAGE("Reloading simulation script '%s'", path.string8());
    228228    if (!m_ComponentManager.LoadScript(path, true))
    229229        return ERR::FAIL;
    230230
    static std::vector<std::string> GetJSONData(const VfsPath& path)  
    828828    {
    829829        // Some error reading directory
    830830        wchar_t error[200];
    831         LOGERROR("Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     831        LOGERROR("Error reading directory '%s': %s", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    832832        return std::vector<std::string>();
    833833    }
    834834
    static std::vector<std::string> GetJSONData(const VfsPath& path)  
    840840        PSRETURN ret = file.Load(g_VFS, *it);
    841841        if (ret != PSRETURN_OK)
    842842        {
    843             LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
     843            LOGERROR("GetJSONData: Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
    844844            continue;
    845845        }
    846846
    static std::string ReadJSON(const VfsPath& path)  
    864864{
    865865    if (!VfsFileExists(path))
    866866    {
    867         LOGERROR("File '%ls' does not exist", path.string8());
     867        LOGERROR("File '%s' does not exist", path.string8());
    868868        return std::string();
    869869    }
    870870
    static std::string ReadJSON(const VfsPath& path)  
    873873    PSRETURN ret = file.Load(g_VFS, path);
    874874    if (ret != PSRETURN_OK)
    875875    {
    876         LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
     876        LOGERROR("Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
    877877        return std::string();
    878878    }
    879879
  • source/simulation2/components/CCmpAIManager.cpp

    diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp
    index 9efb936..ffe0fc4 100644
    a b private:  
    104104            m_Worker.LoadMetadata(path, &metadata);
    105105            if (metadata.isUndefined())
    106106            {
    107                 LOGERROR("Failed to create AI player: can't find %ls", path.string8());
     107                LOGERROR("Failed to create AI player: can't find %s", path.string8());
    108108                return false;
    109109            }
    110110
    private:  
    116116            JS::RootedValue ctor(cx);
    117117            if (!m_ScriptInterface->HasProperty(metadata, "moduleName"))
    118118            {
    119                 LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string8());
     119                LOGERROR("Failed to create AI player: %s: missing 'moduleName'", path.string8());
    120120                return false;
    121121            }
    122122
    private:  
    124124            if (!m_ScriptInterface->GetProperty(global, moduleName.c_str(), &objectWithConstructor)
    125125                || objectWithConstructor.isUndefined())
    126126            {
    127                 LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string8(), moduleName.c_str());
     127                LOGERROR("Failed to create AI player: %s: can't find the module that should contain the constructor: '%s'", path.string8(), moduleName.c_str());
    128128                return false;
    129129            }
    130130
    131131            if (!m_ScriptInterface->GetProperty(metadata, "constructor", constructor))
    132132            {
    133                 LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string8());
     133                LOGERROR("Failed to create AI player: %s: missing 'constructor'", path.string8());
    134134                return false;
    135135            }
    136136
    private:  
    138138            if (!m_ScriptInterface->GetProperty(objectWithConstructor, constructor.c_str(), &ctor)
    139139                || ctor.isNull())
    140140            {
    141                 LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string8(), constructor.c_str());
     141                LOGERROR("Failed to create AI player: %s: can't find constructor '%s'", path.string8(), constructor.c_str());
    142142                return false;
    143143            }
    144144
    private:  
    160160
    161161            if (obj.isNull())
    162162            {
    163                 LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string8(), constructor.c_str());
     163                LOGERROR("Failed to create AI player: %s: error calling constructor '%s'", path.string8(), constructor.c_str());
    164164                return false;
    165165            }
    166166
    public:  
    261261        VfsPaths pathnames;
    262262        if (vfs::GetPathnames(g_VFS, L"simulation/ai/" + moduleName + L"/", L"*.js", pathnames) < 0)
    263263        {
    264             LOGERROR("Failed to load AI scripts for module %ls", moduleName.c_str());
     264            LOGERROR("Failed to load AI scripts for module %s", moduleName.c_str());
    265265            return false;
    266266        }
    267267
    public:  
    269269        {
    270270            if (!m_ScriptInterface->LoadGlobalScriptFile(*it))
    271271            {
    272                 LOGERROR("Failed to load script %ls", it->string8());
     272                LOGERROR("Failed to load script %s", it->string8());
    273273                return false;
    274274            }
    275275        }
    public:  
    391391        JS::RootedValue ctor(cx);
    392392        if (!m_ScriptInterface->GetProperty(global, "API3", &AIModule) || AIModule.isUndefined())
    393393        {
    394             LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string8(), "API3");
     394            LOGERROR("Failed to create shared AI component: %s: can't find module '%s'", path.string8(), "API3");
    395395            return false;
    396396        }
    397397       
    398398        if (!m_ScriptInterface->GetProperty(AIModule, "SharedScript", &ctor)
    399399            || ctor.isUndefined())
    400400        {
    401             LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string8(), "SharedScript");
     401            LOGERROR("Failed to create shared AI component: %s: can't find constructor '%s'", path.string8(), "SharedScript");
    402402            return false;
    403403        }
    404404       
    public:  
    440440       
    441441        if (tmpSharedAIObj.isNull())
    442442        {
    443             LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string8(), "SharedScript");
     443            LOGERROR("Failed to create shared AI component: %s: error calling constructor '%s'", path.string8(), "SharedScript");
    444444            return false;
    445445        }
    446446       
    public:  
    748748        std::pair<std::map<JSObject*, std::wstring>::iterator, bool> ret1 = m_SerializablePrototypes.insert(std::make_pair(obj, name));
    749749        std::pair<std::map<std::wstring, JSObject*>::iterator, bool> ret2 = m_DeserializablePrototypes.insert(std::make_pair(name, obj));
    750750        if (!ret1.second || !ret2.second)
    751             LOGERROR("RegisterSerializablePrototype called with same prototype multiple times: p=%p n='%ls'", obj, name.c_str());
     751            LOGERROR("RegisterSerializablePrototype called with same prototype multiple times: p=%p n='%s'", obj, name.c_str());
    752752    }
    753753
    754754private:
  • source/simulation2/components/CCmpPathfinder.cpp

    diff --git a/source/simulation2/components/CCmpPathfinder.cpp b/source/simulation2/components/CCmpPathfinder.cpp
    index 2fe21f6..59c700a 100644
    a b ICmpPathfinder::pass_class_t CCmpPathfinder::GetPassabilityClass(const std::stri  
    254254{
    255255    if (m_PassClassMasks.find(name) == m_PassClassMasks.end())
    256256    {
    257         LOGERROR("Invalid passability class name '%hs'", name.c_str());
     257        LOGERROR("Invalid passability class name '%s'", name.c_str());
    258258        return 0;
    259259    }
    260260
    ICmpPathfinder::cost_class_t CCmpPathfinder::GetCostClass(const std::string& nam  
    270270{
    271271    if (m_UnitCostClassTags.find(name) == m_UnitCostClassTags.end())
    272272    {
    273         LOGERROR("Invalid unit cost class name '%hs'", name.c_str());
     273        LOGERROR("Invalid unit cost class name '%s'", name.c_str());
    274274        return m_UnitCostClassTags["default"];
    275275    }
    276276
  • source/simulation2/components/CCmpProjectileManager.cpp

    diff --git a/source/simulation2/components/CCmpProjectileManager.cpp b/source/simulation2/components/CCmpProjectileManager.cpp
    index 0b61a2a..d8af231 100644
    a b uint32_t CCmpProjectileManager::LaunchProjectile(entity_id_t source, CFixedVecto  
    175175    {
    176176        // If the actor was actually loaded, complain that it doesn't have a projectile
    177177        if (!cmpSourceVisual->GetActorShortName().empty())
    178             LOGERROR("Unit with actor '%ls' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str());
     178            LOGERROR("Unit with actor '%s' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str());
    179179        return 0;
    180180    }
    181181
  • source/simulation2/components/CCmpRangeManager.cpp

    diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp
    index 6c31b7c..275b1ec 100644
    a b public:  
    13371337        if (identifier == "injured")
    13381338            return 2;
    13391339
    1340         LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs", identifier.c_str());
     1340        LOGWARNING("CCmpRangeManager: Invalid flag identifier %s", identifier.c_str());
    13411341        return 0;
    13421342    }
    13431343
    public:  
    13541354        // We don't have a flag set
    13551355        if (flag == 0)
    13561356        {
    1357             LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs for entity %u", identifier.c_str(), ent);
     1357            LOGWARNING("CCmpRangeManager: Invalid flag identifier %s for entity %u", identifier.c_str(), ent);
    13581358            return;
    13591359        }
    13601360
  • source/simulation2/components/CCmpTemplateManager.cpp

    diff --git a/source/simulation2/components/CCmpTemplateManager.cpp b/source/simulation2/components/CCmpTemplateManager.cpp
    index 192cd77..8f90626 100644
    a b const CParamNode* CCmpTemplateManager::GetTemplate(std::string templateName)  
    187187
    188188            // Show error on the first failure to validate the template
    189189            if (!m_TemplateSchemaValidity[templateName])
    190                 LOGERROR("Failed to validate entity template '%hs'", templateName.c_str());
     190                LOGERROR("Failed to validate entity template '%s'", templateName.c_str());
    191191        }
    192192        // Refuse to return invalid templates
    193193        if (!m_TemplateSchemaValidity[templateName])
    const CParamNode* CCmpTemplateManager::GetTemplate(std::string templateName)  
    198198    if (!templateRoot.IsOk())
    199199    {
    200200        // The validator should never let this happen
    201         LOGERROR("Invalid root element in entity template '%hs'", templateName.c_str());
     201        LOGERROR("Invalid root element in entity template '%s'", templateName.c_str());
    202202        return NULL;
    203203    }
    204204
  • source/simulation2/scripting/ScriptComponent.cpp

    diff --git a/source/simulation2/scripting/ScriptComponent.cpp b/source/simulation2/scripting/ScriptComponent.cpp
    index 1df5b45..f2fe1fc 100644
    a b void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global)  
    7373
    7474    JS::RootedValue tmpInstance(cx, m_Instance.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade
    7575    if (!m_ScriptInterface.CallFunctionVoid(tmpInstance, name, msgVal))
    76         LOGERROR("Script message handler %hs failed", name);
     76        LOGERROR("Script message handler %s failed", name);
    7777}
    7878
    7979void CComponentTypeScript::Serialize(ISerializer& serialize)
  • source/simulation2/scripting/ScriptComponent.h

    diff --git a/source/simulation2/scripting/ScriptComponent.h b/source/simulation2/scripting/ScriptComponent.h
    index a772756..7268499 100644
    a b public:  
    6464        R ret; \
    6565        if (m_ScriptInterface.CallFunction(tmpInstance, funcname  BOOST_PP_ENUM_TRAILING_PARAMS(i, a), ret)) \
    6666            return ret; \
    67         LOGERROR("Error calling component script function %hs", funcname); \
     67        LOGERROR("Error calling component script function %s", funcname); \
    6868        return R(); \
    6969    } \
    7070    BOOST_PP_IF(i, template<, ) BOOST_PP_ENUM_PARAMS(i, typename T) BOOST_PP_IF(i, >, ) \
    public:  
    7575        JS::RootedValue tmpInstance(cx, m_Instance.get()); \
    7676        if (m_ScriptInterface.CallFunctionVoid(tmpInstance, funcname  BOOST_PP_ENUM_TRAILING_PARAMS(i, a))) \
    7777            return; \
    78         LOGERROR("Error calling component script function %hs", funcname); \
     78        LOGERROR("Error calling component script function %s", funcname); \
    7979    }
    8080BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~)
    8181#undef OVERLOADS
  • source/simulation2/serialization/BinarySerializer.cpp

    diff --git a/source/simulation2/serialization/BinarySerializer.cpp b/source/simulation2/serialization/BinarySerializer.cpp
    index cf3d222..f6da94f 100644
    a b void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val)  
    258258            else
    259259            {
    260260                // Unrecognized class
    261                 LOGERROR("Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name);
     261                LOGERROR("Cannot serialise JS objects with unrecognized class '%s'", jsclass->name);
    262262                throw PSERROR_Serialize_InvalidScriptValue();
    263263            }
    264264        }
    void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val)  
    317317            }
    318318        }
    319319
    320         LOGERROR("Cannot serialise JS objects of type 'function': %ls", funcname.c_str());
     320        LOGERROR("Cannot serialise JS objects of type 'function': %s", funcname.c_str());
    321321        throw PSERROR_Serialize_InvalidScriptValue();
    322322    }
    323323    case JSTYPE_STRING:
  • source/simulation2/system/ComponentManager.cpp

    diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp
    index 86dae1f..53e69ee 100644
    a b CComponentManager::ComponentTypeId CComponentManager::GetScriptWrapper(Interface  
    672672    for (; iiit != m_InterfaceIdsByName.end(); ++iiit)
    673673        if (iiit->second == iid)
    674674        {
    675             LOGERROR("No script wrapper found for interface id %d '%hs'", iid, iiit->first.c_str());
     675            LOGERROR("No script wrapper found for interface id %d '%s'", iid, iiit->first.c_str());
    676676            return CID__Invalid;
    677677        }
    678678
    entity_id_t CComponentManager::AddEntity(const std::wstring& templateName, entit  
    887887        CComponentManager::ComponentTypeId cid = LookupCID(it->first);
    888888        if (cid == CID__Invalid)
    889889        {
    890             LOGERROR("Unrecognised component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str());
     890            LOGERROR("Unrecognised component type name '%s' in entity template '%s'", it->first.c_str(), templateName.c_str());
    891891            return INVALID_ENTITY;
    892892        }
    893893
    894894        if (!AddComponent(handle, cid, it->second))
    895895        {
    896             LOGERROR("Failed to construct component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str());
     896            LOGERROR("Failed to construct component type name '%s' in entity template '%s'", it->first.c_str(), templateName.c_str());
    897897            return INVALID_ENTITY;
    898898        }
    899899        // TODO: maybe we should delete already-constructed components if one of them fails?
    std::vector<std::string> CComponentManager::Script_FindJSONFiles(ScriptInterface  
    12261226    {
    12271227        // Some error reading directory
    12281228        wchar_t error[200];
    1229         LOGERROR("Error reading directory '%ls': %ls", cbData.path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     1229        LOGERROR("Error reading directory '%s': %s", cbData.path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    12301230    }
    12311231   
    12321232    return cbData.templates;
  • source/simulation2/system/ComponentManagerSerialization.cpp

    diff --git a/source/simulation2/system/ComponentManagerSerialization.cpp b/source/simulation2/system/ComponentManagerSerialization.cpp
    index 1dd0939..053b3c6 100644
    a b bool CComponentManager::DeserializeState(std::istream& stream)  
    322322            ComponentTypeId ctid = LookupCID(ctname);
    323323            if (ctid == CID__Invalid)
    324324            {
    325                 LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str());
     325                LOGERROR("Deserialization saw unrecognised component type '%s'", ctname.c_str());
    326326                return false;
    327327            }
    328328
    bool CComponentManager::DeserializeState(std::istream& stream)  
    349349            ComponentTypeId ctid = LookupCID(ctname);
    350350            if (ctid == CID__Invalid)
    351351            {
    352                 LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str());
     352                LOGERROR("Deserialization saw unrecognised component type '%s'", ctname.c_str());
    353353                return false;
    354354            }
    355355
    bool CComponentManager::DeserializeState(std::istream& stream)  
    391391    }
    392392    catch (PSERROR_Deserialize& e)
    393393    {
    394         LOGERROR("Deserialization failed: %hs", e.what());
     394        LOGERROR("Deserialization failed: %s", e.what());
    395395        return false;
    396396    }
    397397}
  • source/simulation2/system/ParamNode.cpp

    diff --git a/source/simulation2/system/ParamNode.cpp b/source/simulation2/system/ParamNode.cpp
    index 0c5016a..0e5dc41 100644
    a b void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element, const  
    123123                        if (tokenIt != tokens.end())
    124124                            tokens.erase(tokenIt);
    125125                        else
    126                             LOGWARNING("[ParamNode] Could not remove token '%ls' from node '%hs'%ls; not present in list nor inherited (possible typo?)",
     126                            LOGWARNING("[ParamNode] Could not remove token '%s' from node '%s'%s; not present in list nor inherited (possible typo?)",
    127127                                newTokens[i].substr(1).c_str(), name.c_str(), sourceIdentifier ? (L" in '" + std::wstring(sourceIdentifier) + L"'").c_str() : L"");
    128128                    }
    129129                    else
  • source/soundmanager/SoundManager.cpp

    diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp
    index 1fe169f..5bf843d 100644
    a b void ISoundManager::CloseGame()  
    204204
    205205void CSoundManager::al_ReportError(ALenum err, const char* caller, int line)
    206206{
    207     LOGERROR("OpenAL error: %hs; called from %hs (line %d)\n", alGetString(err), caller, line);
     207    LOGERROR("OpenAL error: %s; called from %s (line %d)\n", alGetString(err), caller, line);
    208208}
    209209
    210210void CSoundManager::al_check(const char* caller, int line)
    void CSoundManager::al_check(const char* caller, int line)  
    216216
    217217Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path))
    218218{
    219 //  LOGERROR("GUI file '%ls' changed - reloading page", path.string8());
     219//  LOGERROR("GUI file '%s' changed - reloading page", path.string8());
    220220
    221221    return INFO::OK;
    222222}
    Status CSoundManager::AlcInit()  
    354354        debug_printf(L"Sound: AlcInit success, using %hs\n", dev_name);
    355355    else
    356356    {
    357         LOGERROR("Sound: AlcInit failed, m_Device=%p m_Context=%p dev_name=%hs err=%x\n", m_Device, m_Context, dev_name, err);
     357        LOGERROR("Sound: AlcInit failed, m_Device=%p m_Context=%p dev_name=%s err=%x\n", m_Device, m_Context, dev_name, err);
    358358
    359359// FIXME Hack to get around exclusive access to the sound device
    360360#if OS_UNIX
    void CSoundManager::PlayAsGroup(const VfsPath& groupPath, CVector3D sourcePos, e  
    654654        group = new CSoundGroup();
    655655        if (!group->LoadSoundGroup(L"audio/" + groupPath.string()))
    656656        {
    657             LOGERROR("Failed to load sound group '%ls'", groupPath.string8());
     657            LOGERROR("Failed to load sound group '%s'", groupPath.string8());
    658658            delete group;
    659659            group = NULL;
    660660        }
  • source/soundmanager/data/SoundData.cpp

    diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp
    index 22a8dd0..80bb547 100644
    a b CSoundData* CSoundData::SoundDataFromOgg(const VfsPath& itemPath)  
    107107    }
    108108    else
    109109    {
    110         LOGERROR("could not initialize ogg data at %ls", itemPath.string8());
     110        LOGERROR("could not initialize ogg data at %s", itemPath.string8());
    111111        delete oggAnswer;
    112112    }
    113113
  • source/soundmanager/scripting/SoundGroup.cpp

    diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp
    index ebd9bc0..2b7a4be 100644
    a b void CSoundGroup::UploadPropertiesAndPlay(size_t theIndex, const CVector3D& posi  
    197197            itemRollOff = 0;
    198198       
    199199        if ( sndData->IsStereo() )
    200             LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string8() );
     200            LOGWARNING( "OpenAL: stereo sounds can't be positioned: %s", sndData->GetFileName()->string8() );
    201201
    202202        hSound->SetLocation(CVector3D((sndDist * sin(offSet)), 0, - sndDist * cos(offSet)));
    203203        hSound->SetRollOff(itemRollOff);
    static void HandleError(const CStrW& message, const VfsPath& pathname, Status er  
    227227{
    228228    if (err == ERR::AGAIN)
    229229        return; // open failed because sound is disabled (don't log this)
    230     LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string8(), ErrorString(err));
     230    LOGERROR("%s: pathname=%s, error=%s", message.c_str(), pathname.string8(), ErrorString(err));
    231231}
    232232
    233233void CSoundGroup::PlayNext(const CVector3D& position, entity_id_t source)
    bool CSoundGroup::LoadSoundGroup(const VfsPath& pathnameXML)  
    320320
    321321    if (root.GetNodeName() != el_soundgroup)
    322322    {
    323         LOGERROR("Invalid SoundGroup format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str());
     323        LOGERROR("Invalid SoundGroup format (unrecognised root element '%s')", XeroFile.GetElementString(root.GetNodeName()).c_str());
    324324        return false;
    325325    }
    326326   
  • source/tools/atlas/GameInterface/GameLoop.cpp

    diff --git a/source/tools/atlas/GameInterface/GameLoop.cpp b/source/tools/atlas/GameInterface/GameLoop.cpp
    index 4943f6b..342f983 100644
    a b static void* RunEngine(void* data)  
    178178                    debug_warn(L"Unrecognised message");
    179179                    // CLogger might not be initialised, but this error will be sent
    180180                    // to the debug output window anyway so people can still see it
    181                     LOGERROR("Unrecognised message (%hs)", name.c_str());
     181                    LOGERROR("Unrecognised message (%s)", name.c_str());
    182182                }
    183183
    184184                if (msg->GetType() == IMessage::Query)
  • source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp

    diff --git a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
    index 6da4081..368befd 100644
    a b BEGIN_COMMAND(DeleteObjects)  
    930930            entity_id_t ent = sim.AddEntity(oldObjects[i].templateName.FromUTF8(), oldObjects[i].entityID);
    931931            if (ent == INVALID_ENTITY)
    932932            {
    933                 LOGERROR("Failed to load entity template '%hs'", oldObjects[i].templateName.c_str());
     933                LOGERROR("Failed to load entity template '%s'", oldObjects[i].templateName.c_str());
    934934            }
    935935            else
    936936            {