From 351821c1f18f9285be58df0a05339936311f6490 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 12 Apr 2013 18:39:00 +0300 Subject: first part of style fixed after cpplint checks. --- src/utils/process.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/utils/process.cpp') diff --git a/src/utils/process.cpp b/src/utils/process.cpp index 538d7274e..ec9eea548 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -49,15 +49,15 @@ int execFileWait(std::string pathName, std::string name A_UNUSED, PROCESS_INFORMATION piProcessInfo; memset(&siStartupInfo, 0, sizeof(siStartupInfo)); memset(&piProcessInfo, 0, sizeof(piProcessInfo)); - siStartupInfo.cb = sizeof(siStartupInfo); + siStartupInfo.cb = sizeof(siStartupInfo); DWORD ret = -1; std::string args(std::string(pathName).append(" ").append(arg1)); if (!arg2.empty()) args.append(" ").append(arg2); - if (CreateProcess(pathName.c_str(), (char*)args.c_str(), nullptr, nullptr, - false, CREATE_DEFAULT_ERROR_MODE, nullptr, nullptr, &siStartupInfo, - &piProcessInfo) != false) + if (CreateProcess(pathName.c_str(), static_cast(args.c_str()), + nullptr, nullptr, false, CREATE_DEFAULT_ERROR_MODE, nullptr, nullptr, + &siStartupInfo, &piProcessInfo) != false) { if (!WaitForSingleObject(piProcessInfo.hProcess, timeOut * 1000)) { @@ -83,7 +83,7 @@ bool execFile(std::string pathName, std::string name A_UNUSED, PROCESS_INFORMATION piProcessInfo; memset(&siStartupInfo, 0, sizeof(siStartupInfo)); memset(&piProcessInfo, 0, sizeof(piProcessInfo)); - siStartupInfo.cb = sizeof(siStartupInfo); + siStartupInfo.cb = sizeof(siStartupInfo); std::string args(std::string(pathName).append(" ").append(arg1)); if (!arg2.empty()) args.append(" ").append(arg2); @@ -149,8 +149,7 @@ int execFileWait(std::string pathName, std::string name, } else if (!sleep_pid) { // sleep pid - sleep (waitTime); -// printf ("time out\n"); + sleep(waitTime); execl("/bin/true", "/bin/true", static_cast(nullptr)); _exit(-1); } @@ -232,8 +231,9 @@ bool execFile(std::string pathName, std::string name, #ifdef WIN32 bool openBrowser(std::string url) { - return (int)ShellExecute(nullptr, "open", replaceAll(url, " ", "").c_str(), - nullptr, nullptr, SW_SHOWNORMAL) > 32; + return static_cast(ShellExecute(nullptr, "open", + replaceAll(url, " ", "").c_str(), + nullptr, nullptr, SW_SHOWNORMAL)) > 32; } #elif defined ANDROID #include -- cgit v1.2.3-70-g09d2