Skip to content

Commit

Permalink
Fix Travis GCC warning: zero-length gnu_printf format string [-Wforma…
Browse files Browse the repository at this point in the history
…t-zero-length]

(based on cmangos/mangos-wotlk@3cfee4f23)

Signed-off-by: Xfurry <xfurry.cmangos@outlook.com>
  • Loading branch information
boxa authored and xfurry committed Jan 3, 2018
1 parent 5426466 commit bfd1390
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/game/AI/ScriptDevAI/ScriptDevAIMgr.cpp
Expand Up @@ -463,7 +463,7 @@ void ScriptDevAIMgr::Initialize()
outstring_log("SD2: Loading C++ scripts");
BarGoLink bar(1);
bar.step();
outstring_log("");
outstring_log();

// Resize script ids to needed amount of assigned ScriptNames (from core)
m_scripts.resize(GetScriptIdsCount(), nullptr);
Expand All @@ -481,7 +481,7 @@ void ScriptDevAIMgr::Initialize()

outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
#else
outstring_log("");
outstring_log();
outstring_log(">> ScriptDev is disabled!");
#endif
}
Expand Down
6 changes: 3 additions & 3 deletions src/game/AI/ScriptDevAI/system/system.cpp
Expand Up @@ -42,7 +42,7 @@ void SystemMgr::LoadVersion()
strSD2Version.append("ScriptDev2 ");

outstring_log("Loading %s", strSD2Version.c_str());
outstring_log("");
outstring_log();
}

void SystemMgr::LoadScriptTexts()
Expand Down Expand Up @@ -111,14 +111,14 @@ void SystemMgr::LoadScriptWaypoints()

delete pResult;

outstring_log("");
outstring_log();
outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount);
}
else
{
BarGoLink bar(1);
bar.step();
outstring_log("");
outstring_log();
outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
}
}
5 changes: 5 additions & 0 deletions src/shared/Log.cpp
Expand Up @@ -986,6 +986,11 @@ void Log::setScriptLibraryErrorFile(char const* fname, char const* libName)
scriptErrLogFile = fopen(fileName.c_str(), "a");
}

void outstring_log()
{
sLog.outString();
}

void outstring_log(const char* str, ...)
{
if (!str)
Expand Down
1 change: 1 addition & 0 deletions src/shared/Log.h
Expand Up @@ -269,6 +269,7 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, std::m
ERROR_DB_FILTER_LOG(LOG_FILTER_DB_STRICTED_CHECK, __VA_ARGS__)

// primary for script library
void outstring_log();
void outstring_log(const char* str, ...) ATTR_PRINTF(1, 2);
void detail_log(const char* str, ...) ATTR_PRINTF(1, 2);
void debug_log(const char* str, ...) ATTR_PRINTF(1, 2);
Expand Down

0 comments on commit bfd1390

Please sign in to comment.