From 031ba967d32b0935837856c3a9e324d438dfbf2c Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Mon, 15 Aug 2022 16:31:58 +0300 Subject: [PATCH] fix indentation --- client/CServerHandler.cpp | 38 +++++++++++------------ lib/VCMIDirs.cpp | 50 +++++++++++++++--------------- lib/logging/CLogger.cpp | 64 +++++++++++++++++++-------------------- vcmibuilder | 12 ++++---- 4 files changed, 82 insertions(+), 82 deletions(-) diff --git a/client/CServerHandler.cpp b/client/CServerHandler.cpp index d2bc4218a..acdfe95a6 100644 --- a/client/CServerHandler.cpp +++ b/client/CServerHandler.cpp @@ -185,18 +185,18 @@ void CServerHandler::startLocalServerAndConnect() envHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "startServer", true); } #elif defined(VCMI_IOS) - // todo ios: hide keyboard - logNetwork->info("[ios] create server thread"); - boost::condition_variable cond; - threadRunLocalServer = std::make_shared([&cond, this] { - setThreadName("CVCMIServer"); - CVCMIServer::create(&cond, uuid); - // todo ios copypaste - threadRunLocalServer.reset(); - CSH->campaignServerRestartLock.setn(false); - }); - threadRunLocalServer->detach(); - logNetwork->info("[ios] detach server thread"); + // todo ios: hide keyboard + logNetwork->info("[ios] create server thread"); + boost::condition_variable cond; + threadRunLocalServer = std::make_shared([&cond, this] { + setThreadName("CVCMIServer"); + CVCMIServer::create(&cond, uuid); + // todo ios copypaste + threadRunLocalServer.reset(); + CSH->campaignServerRestartLock.setn(false); + }); + threadRunLocalServer->detach(); + logNetwork->info("[ios] detach server thread"); #else threadRunLocalServer = std::make_shared(&CServerHandler::threadRunServer, this); //runs server executable; #endif @@ -215,13 +215,13 @@ void CServerHandler::startLocalServerAndConnect() androidTestServerReadyFlag = false; #elif defined(VCMI_IOS) // todo ios - { - boost::mutex m; - boost::unique_lock lock{m}; - logNetwork->info("[ios] wait for server"); - cond.wait(lock); - logNetwork->info("[ios] server ready"); - } + { + boost::mutex m; + boost::unique_lock lock{m}; + logNetwork->info("waiting for server"); + cond.wait(lock); + logNetwork->info("server is ready"); + } #else if(shm) shm->sr->waitTillReady(); diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp index 4916ad6ef..86749fb17 100644 --- a/lib/VCMIDirs.cpp +++ b/lib/VCMIDirs.cpp @@ -370,10 +370,10 @@ bfs::path IVCMIDirsUNIX::serverPath() const { return binaryPath() / "vcmiserver" #ifdef VCMI_APPLE class VCMIDirsApple : public IVCMIDirsUNIX { - public: - bfs::path userConfigPath() const override; +public: + bfs::path userConfigPath() const override; - std::string libraryName(const std::string& basename) const override; + std::string libraryName(const std::string& basename) const override; }; bfs::path VCMIDirsApple::userConfigPath() const { return userDataPath() / "config"; } @@ -383,15 +383,15 @@ std::string VCMIDirsApple::libraryName(const std::string& basename) const { retu #ifdef VCMI_IOS class VCMIDirsIOS final : public VCMIDirsApple { - public: - bfs::path userDataPath() const override; - bfs::path userCachePath() const override; - bfs::path userLogsPath() const override; +public: + bfs::path userDataPath() const override; + bfs::path userCachePath() const override; + bfs::path userLogsPath() const override; - std::vector dataPaths() const override; + std::vector dataPaths() const override; - bfs::path libraryPath() const override; - bfs::path binaryPath() const override; + bfs::path libraryPath() const override; + bfs::path binaryPath() const override; }; bfs::path VCMIDirsIOS::userDataPath() const { return {iOS_utils::documentsPath()}; } @@ -400,15 +400,15 @@ bfs::path VCMIDirsIOS::userLogsPath() const { return {iOS_utils::documentsPath() std::vector VCMIDirsIOS::dataPaths() const { - std::vector paths; - paths.reserve(4); + std::vector paths; + paths.reserve(4); #ifdef VCMI_IOS_SIM - paths.emplace_back(iOS_utils::hostApplicationSupportPath()); + paths.emplace_back(iOS_utils::hostApplicationSupportPath()); #endif - paths.emplace_back(userDataPath()); - paths.emplace_back(iOS_utils::documentsPath()); - paths.emplace_back(binaryPath()); - return paths; + paths.emplace_back(userDataPath()); + paths.emplace_back(iOS_utils::documentsPath()); + paths.emplace_back(binaryPath()); + return paths; } bfs::path VCMIDirsIOS::libraryPath() const { return {iOS_utils::frameworksPath()}; } @@ -416,17 +416,17 @@ bfs::path VCMIDirsIOS::binaryPath() const { return {iOS_utils::bundlePath()}; } #elif defined(VCMI_MAC) class VCMIDirsOSX final : public VCMIDirsApple { - public: - boost::filesystem::path userDataPath() const override; - boost::filesystem::path userCachePath() const override; - boost::filesystem::path userLogsPath() const override; +public: + boost::filesystem::path userDataPath() const override; + boost::filesystem::path userCachePath() const override; + boost::filesystem::path userLogsPath() const override; - std::vector dataPaths() const override; + std::vector dataPaths() const override; - boost::filesystem::path libraryPath() const override; - boost::filesystem::path binaryPath() const override; + boost::filesystem::path libraryPath() const override; + boost::filesystem::path binaryPath() const override; - void init() override; + void init() override; }; void VCMIDirsOSX::init() diff --git a/lib/logging/CLogger.cpp b/lib/logging/CLogger.cpp index 4aeca9d76..2fa3a933c 100644 --- a/lib/logging/CLogger.cpp +++ b/lib/logging/CLogger.cpp @@ -361,40 +361,40 @@ void CLogConsoleTarget::write(const LogRecord & record) #ifdef VCMI_ANDROID __android_log_write(ELogLevel::toAndroid(record.level), ("VCMI-" + record.domain.getName()).c_str(), message.c_str()); #elif defined(VCMI_IOS) - os_log_type_t type; - switch (record.level) - { - case ELogLevel::TRACE: - type = OS_LOG_TYPE_DEBUG; - break; - case ELogLevel::DEBUG: - type = OS_LOG_TYPE_DEFAULT; - break; - case ELogLevel::INFO: - type = OS_LOG_TYPE_INFO; - break; - case ELogLevel::WARN: - type = OS_LOG_TYPE_ERROR; - break; - case ELogLevel::ERROR: - type = OS_LOG_TYPE_FAULT; - break; - default: - return; - } + os_log_type_t type; + switch (record.level) + { + case ELogLevel::TRACE: + type = OS_LOG_TYPE_DEBUG; + break; + case ELogLevel::DEBUG: + type = OS_LOG_TYPE_DEFAULT; + break; + case ELogLevel::INFO: + type = OS_LOG_TYPE_INFO; + break; + case ELogLevel::WARN: + type = OS_LOG_TYPE_ERROR; + break; + case ELogLevel::ERROR: + type = OS_LOG_TYPE_FAULT; + break; + default: + return; + } - os_log_t currentLog; - static std::unordered_map logs; - const auto& domainName = record.domain.getName(); - auto logIt = logs.find(domainName); - if (logIt != logs.end()) - currentLog = logIt->second; - else - { + os_log_t currentLog; + static std::unordered_map logs; + const auto& domainName = record.domain.getName(); + auto logIt = logs.find(domainName); + if (logIt != logs.end()) + currentLog = logIt->second; + else + { currentLog = os_log_create(iOS_utils::bundleIdentifier(), domainName.c_str()); - logs.insert({domainName, currentLog}); - } - os_log_with_type(currentLog, type, "%{public}s", message.c_str()); + logs.insert({domainName, currentLog}); + } + os_log_with_type(currentLog, type, "%{public}s", message.c_str()); #else const bool printToStdErr = record.level >= ELogLevel::WARN; diff --git a/vcmibuilder b/vcmibuilder index af4df023a..cdd1b337f 100755 --- a/vcmibuilder +++ b/vcmibuilder @@ -116,10 +116,10 @@ if [[ -n "$gog_file" ]] then currentver="$(innoextract --version | head -n1 | cut -d ' ' -f2)" requiredver="1.6" - if verlt $currentver $requiredver; - then - fail "innoextract version is $currentver, update it to version $requiredver or higher" - fi + if verlt $currentver $requiredver; + then + fail "innoextract version is $currentver, update it to version $requiredver or higher" + fi fi if [[ -n "$useffmpeg" ]] @@ -182,7 +182,7 @@ then # innoextract always reports error (iconv 84 error). Just test file for presence test -f "$gog_file" || fail "Error: gog.com executable was not found!" - gog_file="$(cd "$(dirname "$gog_file")"; pwd)/$(basename "$gog_file")" + gog_file="$(cd "$(dirname "$gog_file")"; pwd)/$(basename "$gog_file")" cd "$data_dir" && innoextract "$gog_file" fi @@ -190,7 +190,7 @@ if [[ -n "$cd1_dir" ]] then data_dir="$temp_dir"/cddir mkdir -p "$data_dir" - unshield -d "$data_dir" x "$cd1_dir"/_setup/data1.cab || fail "Error: failed to extract from Install Shield installer!" "rm -rf $data_dir" + unshield -d "$data_dir" x "$cd1_dir"/_setup/data1.cab || fail "Error: failed to extract from Install Shield installer!" "rm -rf $data_dir" # a bit tricky - different releases have different root directory. Move extracted files to data_dir if [ -d "$data_dir"/Heroes3 ]