From ff1c6705d6552f9c54ea8ae1a500a9654a46ab03 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 3 Mar 2016 23:40:19 +0800 Subject: [PATCH] fix compile warning --- src/game/client/components/menus_settings.cpp | 8 ++++---- src/game/client/gameclient.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index d44256d48..b3a40c041 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1155,11 +1155,11 @@ void CMenus::RenderLanguageSelection(CUIRect MainView) // Load Font static CFont *pDefaultFont = 0; char aFilename[512]; - char *fontFile = "fonts/DejaVuSansCJKName.ttf"; + const char *pFontFile = "fonts/DejaVuSansCJKName.ttf"; if (str_find(g_Config.m_ClLanguagefile, "chinese") != NULL || str_find(g_Config.m_ClLanguagefile, "japanese") != NULL || str_find(g_Config.m_ClLanguagefile, "korean") != NULL) - fontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; - IOHANDLE File = Storage()->OpenFile(fontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); + pFontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; + IOHANDLE File = Storage()->OpenFile(pFontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); if(File) { io_close(File); @@ -1167,7 +1167,7 @@ void CMenus::RenderLanguageSelection(CUIRect MainView) TextRender()->SetDefaultFont(pDefaultFont); } if(!pDefaultFont) - Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", fontFile); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", pFontFile); } } diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 34eebe4f3..4b6de67fc 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -294,11 +294,11 @@ void CGameClient::OnInit() // load default font static CFont *pDefaultFont = 0; char aFilename[512]; - char *fontFile = "fonts/DejaVuSansCJKName.ttf"; + const char *pFontFile = "fonts/DejaVuSansCJKName.ttf"; if (str_find(g_Config.m_ClLanguagefile, "chinese") != NULL || str_find(g_Config.m_ClLanguagefile, "japanese") != NULL || str_find(g_Config.m_ClLanguagefile, "korean") != NULL) - fontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; - IOHANDLE File = Storage()->OpenFile(fontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); + pFontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; + IOHANDLE File = Storage()->OpenFile(pFontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); if(File) { io_close(File); @@ -306,7 +306,7 @@ void CGameClient::OnInit() TextRender()->SetDefaultFont(pDefaultFont); } if(!pDefaultFont) - Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", fontFile); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", pFontFile); // init all components for(int i = m_All.m_Num-1; i >= 0; --i)