From 62a3edb84a6437220be1c11a14622f7d5df8a972 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 5 Apr 2015 01:10:14 +0200 Subject: Core/Misc: Warning fixes (cherry picked from commit cc4d79495f98006f77c68792b946a412f5e86714) Partial cherry-picked. Signed-off-by: Naios --- src/server/shared/Updater/UpdateFetcher.h | 25 ++++++++++++------------- src/server/shared/Utilities/ServiceWin32.cpp | 2 +- src/server/worldserver/Main.cpp | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/shared/Updater/UpdateFetcher.h b/src/server/shared/Updater/UpdateFetcher.h index 95988224ee2..fa142547873 100644 --- a/src/server/shared/Updater/UpdateFetcher.h +++ b/src/server/shared/Updater/UpdateFetcher.h @@ -27,7 +27,7 @@ class UpdateFetcher { - using Path = boost::filesystem::path; + typedef boost::filesystem::path Path; public: UpdateFetcher(Path const& updateDirectory, @@ -53,6 +53,9 @@ private: struct AppliedFileEntry { + AppliedFileEntry(std::string const& name_, std::string const& hash_, State state_, uint64 timestamp_) + : name(name_), hash(hash_), state(state_), timestamp(timestamp_) { } + std::string const name; std::string const hash; @@ -61,9 +64,6 @@ private: uint64 const timestamp; - AppliedFileEntry(std::string const& _name, std::string const& _hash, State const _state, uint64 const _timestamp) : - name(_name), hash(_hash), state(_state), timestamp(_timestamp) { } - static inline State StateConvert(std::string const& state) { return (state == "RELEASED") ? RELEASED : ARCHIVED; @@ -82,15 +82,14 @@ private: struct DirectoryEntry { + DirectoryEntry(Path const& path_, State state_) : path(path_), state(state_) { } + Path const path; State const state; - - DirectoryEntry(Path const& _path, State const _state) : - path(_path), state(_state) { } }; - using LocaleFileEntry = std::pair; + typedef std::pair LocaleFileEntry; struct PathCompare { @@ -100,11 +99,11 @@ private: } }; - using LocaleFileStorage = std::set; - using HashToFileNameStorage = std::unordered_map; - using AppliedFileStorage = std::unordered_map; - using DirectoryStorage = std::vector; - using SQLUpdate = std::shared_ptr; + typedef std::set LocaleFileStorage; + typedef std::unordered_map HashToFileNameStorage; + typedef std::unordered_map AppliedFileStorage; + typedef std::vector DirectoryStorage; + typedef std::shared_ptr SQLUpdate; LocaleFileStorage GetFileList() const; void FillFileListRecursively(Path const& path, LocaleFileStorage& storage, State const state, uint32 const depth) const; diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp index c73949fc6a3..3e5e416b1a3 100644 --- a/src/server/shared/Utilities/ServiceWin32.cpp +++ b/src/server/shared/Utilities/ServiceWin32.cpp @@ -255,7 +255,7 @@ bool WinServiceRun() if (!StartServiceCtrlDispatcher(serviceTable)) { - TC_LOG_ERROR("server.worldserver", "StartService Failed. Error [%u]", ::GetLastError()); + TC_LOG_ERROR("server.worldserver", "StartService Failed. Error [%u]", uint32(::GetLastError())); return false; } return true; diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index fbf2c74ac0b..430c3ce4d73 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -308,7 +308,7 @@ void ShutdownCLIThread(std::thread* cliThread) errorBuffer = "Unknown error"; TC_LOG_DEBUG("server.worldserver", "Error cancelling I/O of CliThread, error code %u, detail: %s", - errorCode, errorBuffer); + uint32(errorCode), errorBuffer); LocalFree(errorBuffer); // send keyboard input to safely unblock the CLI thread -- cgit v1.2.3