summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-22 02:24:53 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-22 12:39:21 +0300
commitffcf1df72849711b23ff1d184df69f01826edba9 (patch)
tree51028276f4fc3d928f107b0ff4a68ed1789e4eb8
parent319d525f993b0b95205df1cd431985ce575c4049 (diff)
downloadmv-ffcf1df72849711b23ff1d184df69f01826edba9.tar.gz
mv-ffcf1df72849711b23ff1d184df69f01826edba9.tar.bz2
mv-ffcf1df72849711b23ff1d184df69f01826edba9.tar.xz
mv-ffcf1df72849711b23ff1d184df69f01826edba9.zip
Fix compilation warnings in windows builds.
-rw-r--r--src/client.cpp2
-rw-r--r--src/debug/debug_new.cpp6
-rw-r--r--src/localconsts.h2
-rw-r--r--src/logger.cpp6
-rw-r--r--src/utils/copynpaste.cpp4
-rw-r--r--src/utils/mkdir.cpp2
-rw-r--r--src/utils/paths.cpp2
-rw-r--r--src/utils/process.cpp6
8 files changed, 15 insertions, 15 deletions
diff --git a/src/client.cpp b/src/client.cpp
index bdb43d0b9..3efd9c593 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1872,7 +1872,7 @@ void Client::initUpdatesDir()
loc = newDir.find("/", loc);
}
- if (!CreateDirectory(newDir.c_str(), 0) &&
+ if (!CreateDirectory(newDir.c_str(), nullptr) &&
GetLastError() != ERROR_ALREADY_EXISTS)
{
logger->log("Error: %s can't be made, but doesn't exist!",
diff --git a/src/debug/debug_new.cpp b/src/debug/debug_new.cpp
index bb7e64346..b64fc684b 100644
--- a/src/debug/debug_new.cpp
+++ b/src/debug/debug_new.cpp
@@ -163,9 +163,9 @@
*
* Value of the padding bytes at the end of a memory block.
*/
-#ifndef M_DEBUG_NEW_TAILCHECK_CHAR
-#define M_DEBUG_NEW_TAILCHECK_CHAR 0xCC
-#endif
+//#ifndef M_DEBUG_NEW_TAILCHECK_CHAR
+//#define M_DEBUG_NEW_TAILCHECK_CHAR 0xCC
+//#endif
/**
* @def M_DEBUG_NEW_USE_ADDR2LINE
diff --git a/src/localconsts.h b/src/localconsts.h
index 4fbbbda2e..7bc5555ed 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef nullptr
#define nullptr 0
#else
diff --git a/src/logger.cpp b/src/logger.cpp
index 63af7ae64..91f746ef3 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -33,7 +33,7 @@
#include <windows.h>
#elif defined __APPLE__
#include <Carbon/Carbon.h>
-#elif __linux__ || __linux
+#elif defined(__linux__) || defined(__linux)
#include <stdlib.h>
#endif
@@ -205,7 +205,7 @@ void Logger::safeError(const std::string &error_text)
// StandardAlert(kAlertStopAlert,
// (const unsigned char*)"\pError",
// (ConstStr255Param) msg, nullptr, nullptr);
-#elif defined __linux__ || __linux
+#elif defined(__linux__) || defined(__linux)
std::cerr << "Error: " << error_text << std::endl;
std::string msg = "xmessage \"" + error_text + "\"";
if (system(msg.c_str()) == -1)
@@ -232,7 +232,7 @@ void Logger::error(const std::string &error_text)
// StandardAlert(kAlertStopAlert,
// (const unsigned char*)"\pError",
// (ConstStr255Param) msg, nullptr, nullptr);
-#elif defined __linux__ || __linux
+#elif defined(__linux__) || defined(_linux)
std::cerr << "Error: " << error_text << std::endl;
std::string msg = "xmessage \"Error happend. "
"Please see log file for more information.\"";
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index a53e0b63f..1d2289600 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -106,7 +106,7 @@ bool sendBuffer(std::string& text)
MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, out, wCharsLen);
- if (!OpenClipboard(0))
+ if (!OpenClipboard(nullptr))
{
GlobalUnlock(h);
GlobalFree(h);
@@ -284,7 +284,7 @@ bool sendBuffer(std::string& text)
return false;
}
-#elif USE_X11
+#elif defined USE_X11
#include <unistd.h>
diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp
index 5eb1b0388..4632bec84 100644
--- a/src/utils/mkdir.cpp
+++ b/src/utils/mkdir.cpp
@@ -90,7 +90,7 @@ int mkdir_r(const char *pathname)
return -1;
}
- if (!CreateDirectory(tmp2, 0))
+ if (!CreateDirectory(tmp2, nullptr))
{
// hack, hack. just assume that x: might be a drive
// letter, and try again
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index 7cb600a1a..1a2ec1b5c 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -145,7 +145,7 @@ std::string getDesktopDir()
if (dir.empty())
dir = getSpecialFolderLocation(CSIDL_DESKTOP);
return dir;
-#elif USE_X11
+#elif defined USE_X11
char *xdg = getenv("XDG_CONFIG_HOME");
std::string file;
if (!xdg)
diff --git a/src/utils/process.cpp b/src/utils/process.cpp
index 0106c597d..2d64f3a37 100644
--- a/src/utils/process.cpp
+++ b/src/utils/process.cpp
@@ -37,7 +37,7 @@ const int timeOut = 10;
#include <windows.h>
-int execFile(std::string pathName, std::string name,
+int execFile(std::string pathName, std::string name A_UNUSED,
std::string arg1, std::string arg2, int waitTime)
{
if (!waitTime)
@@ -53,8 +53,8 @@ int execFile(std::string pathName, std::string name,
if (!arg2.empty())
args += " " + arg2;
- if (CreateProcess(pathName.c_str(), (char*)args.c_str(), 0, 0, false,
- CREATE_DEFAULT_ERROR_MODE, 0, 0, &siStartupInfo,
+ if (CreateProcess(pathName.c_str(), (char*)args.c_str(), nullptr, nullptr,
+ false, CREATE_DEFAULT_ERROR_MODE, nullptr, nullptr, &siStartupInfo,
&piProcessInfo) != false)
{
if (!WaitForSingleObject(piProcessInfo.hProcess, timeOut * 1000))