diff --git a/source/shared_lib/sources/platform/win32/platform_util.cpp b/source/shared_lib/sources/platform/win32/platform_util.cpp index 9a9d4a28..cb68b8f6 100644 --- a/source/shared_lib/sources/platform/win32/platform_util.cpp +++ b/source/shared_lib/sources/platform/win32/platform_util.cpp @@ -19,14 +19,15 @@ #include "util.h" #include "conversion.h" -#include "leak_dumper.h" #include #include #include +#include + +#include "leak_dumper.h" #define S_ISDIR(mode) ((mode) & _S_IFDIR) - using namespace Shared::Util; using namespace std; @@ -161,48 +162,48 @@ void PlatformExceptionHandler::install(string dumpFileName){ // ===================================================== // class Misc // ===================================================== -void findDirs(const vector &paths, vector &results, bool errorOnNotFound) { - results.clear(); - int pathCount = paths.size(); - for(int idx = 0; idx < pathCount; idx++) { - string path = paths[idx] + "/*."; - vector current_results; - findAll(path, current_results, false, errorOnNotFound); - if(current_results.size() > 0) { - for(int folder_index = 0; folder_index < current_results.size(); folder_index++) { - const string current_folder = current_results[folder_index]; - const string current_folder_path = paths[idx] + "/" + current_folder; - if(isdir(current_folder_path.c_str()) == true) { - if(std::find(results.begin(),results.end(),current_folder) == results.end()) { - results.push_back(current_folder); - } - } - } - } - } - - std::sort(results.begin(),results.end()); -} - -void findAll(const vector &paths, const string &fileFilter, vector &results, bool cutExtension, bool errorOnNotFound) { - results.clear(); - int pathCount = paths.size(); - for(int idx = 0; idx < pathCount; idx++) { - string path = paths[idx] + "/" + fileFilter; - vector current_results; - findAll(path, current_results, cutExtension, errorOnNotFound); - if(current_results.size() > 0) { - for(int folder_index = 0; folder_index < current_results.size(); folder_index++) { - string ¤t_file = current_results[folder_index]; - if(std::find(results.begin(),results.end(),current_file) == results.end()) { - results.push_back(current_file); - } - } - } - } - - std::sort(results.begin(),results.end()); -} +void findDirs(const vector &paths, vector &results, bool errorOnNotFound) { + results.clear(); + int pathCount = paths.size(); + for(int idx = 0; idx < pathCount; idx++) { + string path = paths[idx] + "/*."; + vector current_results; + findAll(path, current_results, false, errorOnNotFound); + if(current_results.size() > 0) { + for(unsigned int folder_index = 0; folder_index < current_results.size(); folder_index++) { + const string current_folder = current_results[folder_index]; + const string current_folder_path = paths[idx] + "/" + current_folder; + if(isdir(current_folder_path.c_str()) == true) { + if(std::find(results.begin(),results.end(),current_folder) == results.end()) { + results.push_back(current_folder); + } + } + } + } + } + + std::sort(results.begin(),results.end()); +} + +void findAll(const vector &paths, const string &fileFilter, vector &results, bool cutExtension, bool errorOnNotFound) { + results.clear(); + int pathCount = paths.size(); + for(int idx = 0; idx < pathCount; idx++) { + string path = paths[idx] + "/" + fileFilter; + vector current_results; + findAll(path, current_results, cutExtension, errorOnNotFound); + if(current_results.size() > 0) { + for(unsigned int folder_index = 0; folder_index < current_results.size(); folder_index++) { + string ¤t_file = current_results[folder_index]; + if(std::find(results.begin(),results.end(),current_file) == results.end()) { + results.push_back(current_file); + } + } + } + } + + std::sort(results.begin(),results.end()); +} //finds all filenames like path and stores them in resultys void findAll(const string &path, vector &results, bool cutExtension, bool errorOnNotFound){ @@ -235,7 +236,7 @@ void findAll(const string &path, vector &results, bool cutExtension, boo } if(cutExtension){ - for (int i=0; i &results, bool cutExtension, boo bool isdir(const char *path) { - struct stat stats; - bool ret = stat (path, &stats) == 0 && S_ISDIR (stats.st_mode); - return ret; + struct stat stats; + bool ret = stat (path, &stats) == 0 && S_ISDIR (stats.st_mode); + return ret; } bool EndsWith(const string &str, const string& key) diff --git a/source/shared_lib/sources/platform/win32/socket.cpp b/source/shared_lib/sources/platform/win32/socket.cpp index 187416e8..2eb13799 100644 --- a/source/shared_lib/sources/platform/win32/socket.cpp +++ b/source/shared_lib/sources/platform/win32/socket.cpp @@ -14,11 +14,12 @@ #include #include "conversion.h" - -#include "leak_dumper.h" #include #include #include +#include "util.h" + +#include "leak_dumper.h" #define socklen_t int @@ -155,7 +156,7 @@ const char* WSAGetLastErrorMessage(const char* pcMessagePrefix, namespace Shared{ namespace Platform{ bool Socket::enableDebugText = true; -bool Socket::enableNetworkDebugInfo = true; +bool Socket::enableNetworkDebugInfo = true; // ===================================================== // class Ip @@ -747,7 +748,7 @@ void ClientSocket::connect(const Ip &ip, int port) if(err < 0) { fprintf(stderr, "In [%s::%s] Before END sock = %d, err = %d, errno = %d\n",__FILE__,__FUNCTION__,sock,err,WSAGetLastError()); - //throwException(szBuf); + //throwException(szBuf); disconnectSocket(); }