summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-12-26 19:45:20 -0500
committerBernard Normier <bernard@zeroc.com>2012-12-26 19:45:20 -0500
commit4e404c3bc3e148f056459dd02ebb811c5f37abac (patch)
treedfdc221b8bee33b556d17c09814591bcc95db7ef /cpp
parentcompact ID support for scripting languages (diff)
downloadice-4e404c3bc3e148f056459dd02ebb811c5f37abac.tar.bz2
ice-4e404c3bc3e148f056459dd02ebb811c5f37abac.tar.xz
ice-4e404c3bc3e148f056459dd02ebb811c5f37abac.zip
Fixed mingw warnings and added -Werror to mingw build
Diffstat (limited to 'cpp')
-rw-r--r--cpp/config/Make.rules.MINGW2
-rw-r--r--cpp/src/Ice/EventHandler.cpp2
-rw-r--r--cpp/src/Ice/Selector.cpp2
-rw-r--r--cpp/src/Ice/Service.cpp2
-rw-r--r--cpp/src/IceSSL/TransceiverI.cpp16
5 files changed, 17 insertions, 7 deletions
diff --git a/cpp/config/Make.rules.MINGW b/cpp/config/Make.rules.MINGW
index 332384e88f3..ad8fb270bc6 100644
--- a/cpp/config/Make.rules.MINGW
+++ b/cpp/config/Make.rules.MINGW
@@ -18,7 +18,7 @@ ifeq ($(CXX),)
CXX = c++
endif
-CXXFLAGS = $(CXXARCHFLAGS) -fexceptions -mthreads -Wall -DWIN32_LEAN_AND_MEAN
+CXXFLAGS = $(CXXARCHFLAGS) -fexceptions -mthreads -Wall -Werror -DWIN32_LEAN_AND_MEAN
LDFLAGS = -Wl,-no-undefined
ifeq ($(CXX), i686-pc-mingw32-c++)
diff --git a/cpp/src/Ice/EventHandler.cpp b/cpp/src/Ice/EventHandler.cpp
index 12c796843c4..d0037e1593e 100644
--- a/cpp/src/Ice/EventHandler.cpp
+++ b/cpp/src/Ice/EventHandler.cpp
@@ -18,8 +18,8 @@ IceUtil::Shared* IceInternal::upCast(EventHandler* p) { return p; }
IceInternal::EventHandler::EventHandler() :
#if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT)
- _pending(SocketOperationNone),
_ready(SocketOperationNone),
+ _pending(SocketOperationNone),
_started(SocketOperationNone),
_finish(false),
#else
diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp
index d6921c5a54d..8fece9557b0 100644
--- a/cpp/src/Ice/Selector.cpp
+++ b/cpp/src/Ice/Selector.cpp
@@ -114,7 +114,7 @@ Selector::~Selector()
void
Selector::setup(int sizeIO)
{
- _handle = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, NULL, sizeIO);
+ _handle = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, sizeIO);
if(_handle == NULL)
{
Ice::SocketException ex(__FILE__, __LINE__);
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index 140eb8759f4..df2681fb02b 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -230,7 +230,7 @@ public:
DWORD d;
LONG err = RegCreateKeyExW(HKEY_LOCAL_MACHINE,
IceUtil::stringToWstring(nativeToUTF8(stringConverter, createKey(source))).c_str(),
- 0, L"REG_SZ", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, &d);
+ 0, const_cast<wchar_t*>(L"REG_SZ"), REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, &d);
if(err != ERROR_SUCCESS)
{
diff --git a/cpp/src/IceSSL/TransceiverI.cpp b/cpp/src/IceSSL/TransceiverI.cpp
index db134aa1d2a..a4e21e73ceb 100644
--- a/cpp/src/IceSSL/TransceiverI.cpp
+++ b/cpp/src/IceSSL/TransceiverI.cpp
@@ -722,7 +722,10 @@ IceSSL::TransceiverI::startRead(IceInternal::Buffer& buf)
assert(!BIO_ctrl_get_read_request(_iocpBio));
ERR_clear_error(); // Clear any spurious errors.
- int ret = SSL_read(_ssl, reinterpret_cast<void*>(&*buf.i), static_cast<int>(buf.b.end() - buf.i));
+#ifndef NDEBUG
+ int ret =
+#endif
+ SSL_read(_ssl, reinterpret_cast<void*>(&*buf.i), static_cast<int>(buf.b.end() - buf.i));
assert(ret <= 0 && SSL_get_error(_ssl, ret) == SSL_ERROR_WANT_READ);
assert(BIO_ctrl_get_read_request(_iocpBio));
@@ -1001,7 +1004,11 @@ IceSSL::TransceiverI::receive()
}
assert(_readI == _readBuffer.end());
- int n = BIO_write(_iocpBio, &_readBuffer[0], static_cast<int>(_readBuffer.size()));
+#ifndef NDEBUG
+ int n =
+#endif
+ BIO_write(_iocpBio, &_readBuffer[0], static_cast<int>(_readBuffer.size()));
+
assert(n == static_cast<int>(_readBuffer.size()));
return true;
}
@@ -1013,7 +1020,10 @@ IceSSL::TransceiverI::send()
{
assert(BIO_ctrl_pending(_iocpBio));
_writeBuffer.resize(BIO_ctrl_pending(_iocpBio));
- int n = BIO_read(_iocpBio, &_writeBuffer[0], static_cast<int>(_writeBuffer.size()));
+#ifndef NDEBUG
+ int n =
+#endif
+ BIO_read(_iocpBio, &_writeBuffer[0], static_cast<int>(_writeBuffer.size()));
assert(n == static_cast<int>(_writeBuffer.size()));
_writeI = _writeBuffer.begin();
}