summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2011-05-17 21:05:49 +0000
committerTed Ross <tross@apache.org>2011-05-17 21:05:49 +0000
commit017ff4c3c785c4ad9432c6f4bc1b9281ca18d5e9 (patch)
treeedda40245bd0f94089e59107d9141cd660825c09
parent2d0338895a2d3629b674f4a3aabea58c77f76504 (diff)
downloadqpid-python-017ff4c3c785c4ad9432c6f4bc1b9281ca18d5e9.tar.gz
QPID-2905 - Misc. code cleanup to allow compilation on a wider set of compilers.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1104560 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp7
-rw-r--r--qpid/cpp/src/qpid/client/windows/SaslFactory.cpp4
-rw-r--r--qpid/cpp/src/qpid/log/windows/SinkOptions.cpp4
-rwxr-xr-xqpid/cpp/src/qpid/sys/windows/AsynchIoResult.h2
-rwxr-xr-xqpid/cpp/src/qpid/sys/windows/IocpPoller.cpp6
-rw-r--r--qpid/cpp/src/qpid/sys/windows/Shlib.cpp3
-rw-r--r--qpid/cpp/src/qpid/types/Variant.cpp10
-rw-r--r--qpid/cpp/src/windows/QpiddBroker.cpp4
8 files changed, 22 insertions, 18 deletions
diff --git a/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp b/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp
index 608a8f7dae..962877a471 100644
--- a/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp
+++ b/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp
@@ -159,8 +159,11 @@ void SspiAuthenticator::start(const string& mechanism, const string& response)
string::size_type j = response.find((char)0, i+1);
string uid = response.substr(i+1, j-1);
string pwd = response.substr(j+1);
+ string dot(".");
int error = 0;
- if (!LogonUser(uid.c_str(), ".", pwd.c_str(),
+ if (!LogonUser(const_cast<char*>(uid.c_str()),
+ const_cast<char*>(dot.c_str()),
+ const_cast<char*>(pwd.c_str()),
LOGON32_LOGON_NETWORK,
LOGON32_PROVIDER_DEFAULT,
&userToken))
@@ -176,7 +179,7 @@ void SspiAuthenticator::start(const string& mechanism, const string& response)
client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0);
}
-void SspiAuthenticator::step(const string& response)
+void SspiAuthenticator::step(const string& /*response*/)
{
QPID_LOG(info, "SASL: Need another step!!!");
}
diff --git a/qpid/cpp/src/qpid/client/windows/SaslFactory.cpp b/qpid/cpp/src/qpid/client/windows/SaslFactory.cpp
index 63c7fa3d1f..d1ae762f1b 100644
--- a/qpid/cpp/src/qpid/client/windows/SaslFactory.cpp
+++ b/qpid/cpp/src/qpid/client/windows/SaslFactory.cpp
@@ -153,7 +153,7 @@ std::string WindowsSasl::start(const std::string& mechanisms,
return resp;
}
-std::string WindowsSasl::step(const std::string& challenge)
+std::string WindowsSasl::step(const std::string& /*challenge*/)
{
// Shouldn't get this for PLAIN...
throw InternalErrorException(QPID_MSG("Sasl step error"));
@@ -169,7 +169,7 @@ std::string WindowsSasl::getUserId()
return std::string(); // TODO - when GSSAPI is supported, return userId for connection.
}
-std::auto_ptr<SecurityLayer> WindowsSasl::getSecurityLayer(uint16_t maxFrameSize)
+std::auto_ptr<SecurityLayer> WindowsSasl::getSecurityLayer(uint16_t /*maxFrameSize*/)
{
return std::auto_ptr<SecurityLayer>(0);
}
diff --git a/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp b/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp
index 28f4b267e0..0c74bea64e 100644
--- a/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp
+++ b/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp
@@ -53,7 +53,7 @@ static int eventTypes[qpid::log::LevelTraits::COUNT] = {
class EventLogOutput : public qpid::log::Logger::Output {
public:
- EventLogOutput(const std::string& sourceName) : logHandle(0)
+ EventLogOutput(const std::string& /*sourceName*/) : logHandle(0)
{
logHandle = OpenEventLog(0, "Application");
}
@@ -83,7 +83,7 @@ private:
HANDLE logHandle;
};
-SinkOptions::SinkOptions(const std::string& argv0)
+SinkOptions::SinkOptions(const std::string& /*argv0*/)
: qpid::log::SinkOptions(),
logToStderr(true),
logToStdout(false),
diff --git a/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h b/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h
index 66c89efc11..b11324918b 100755
--- a/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h
+++ b/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h
@@ -98,7 +98,7 @@ private:
// AcceptEx needs a place to write the local and remote addresses
// when accepting the connection. Place those here; get enough for
// IPv6 addresses, even if the socket is IPv4.
- enum { SOCKADDRMAXLEN = sizeof sockaddr_in6 + 16,
+ enum { SOCKADDRMAXLEN = sizeof(sockaddr_in6) + 16,
SOCKADDRBUFLEN = 2 * SOCKADDRMAXLEN };
char addressBuffer[SOCKADDRBUFLEN];
};
diff --git a/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp b/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp
index d326ab02ac..1805dd2cd8 100755
--- a/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp
+++ b/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp
@@ -152,9 +152,9 @@ void Poller::monitorHandle(PollerHandle& handle, Direction dir) {
}
// All no-ops...
-void Poller::unmonitorHandle(PollerHandle& handle, Direction dir) {}
-void Poller::registerHandle(PollerHandle& handle) {}
-void Poller::unregisterHandle(PollerHandle& handle) {}
+void Poller::unmonitorHandle(PollerHandle& /*handle*/, Direction /*dir*/) {}
+void Poller::registerHandle(PollerHandle& /*handle*/) {}
+void Poller::unregisterHandle(PollerHandle& /*handle*/) {}
Poller::Event Poller::wait(Duration timeout) {
DWORD timeoutMs = 0;
diff --git a/qpid/cpp/src/qpid/sys/windows/Shlib.cpp b/qpid/cpp/src/qpid/sys/windows/Shlib.cpp
index 38027de93f..ba18747eb4 100644
--- a/qpid/cpp/src/qpid/sys/windows/Shlib.cpp
+++ b/qpid/cpp/src/qpid/sys/windows/Shlib.cpp
@@ -44,7 +44,8 @@ void Shlib::unload() {
}
void* Shlib::getSymbol(const char* name) {
- void* sym = GetProcAddress(static_cast<HMODULE>(handle), name);
+ // Double cast avoids warning about casting function pointer to object
+ void *sym = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(GetProcAddress(static_cast<HMODULE>(handle), name)));
if (sym == NULL)
throw QPID_WINDOWS_ERROR(GetLastError());
return sym;
diff --git a/qpid/cpp/src/qpid/types/Variant.cpp b/qpid/cpp/src/qpid/types/Variant.cpp
index 8d1a439631..0b28234025 100644
--- a/qpid/cpp/src/qpid/types/Variant.cpp
+++ b/qpid/cpp/src/qpid/types/Variant.cpp
@@ -382,11 +382,11 @@ int8_t VariantImpl::asInt8() const
return int8_t(value.ui16);
break;
case VAR_UINT32:
- if (value.ui32 <= (uint) std::numeric_limits<int8_t>::max())
+ if (value.ui32 <= (uint32_t) std::numeric_limits<int8_t>::max())
return int8_t(value.ui32);
break;
case VAR_UINT64:
- if (value.ui64 <= (uint) std::numeric_limits<int8_t>::max())
+ if (value.ui64 <= (uint64_t) std::numeric_limits<int8_t>::max())
return int8_t(value.ui64);
break;
case VAR_STRING: return convertFromString<int8_t>();
@@ -413,11 +413,11 @@ int16_t VariantImpl::asInt16() const
return int16_t(value.ui16);
break;
case VAR_UINT32:
- if (value.ui32 <= (uint) std::numeric_limits<int16_t>::max())
+ if (value.ui32 <= (uint32_t) std::numeric_limits<int16_t>::max())
return int16_t(value.ui32);
break;
case VAR_UINT64:
- if (value.ui64 <= (uint) std::numeric_limits<int16_t>::max())
+ if (value.ui64 <= (uint64_t) std::numeric_limits<int16_t>::max())
return int16_t(value.ui64);
break;
case VAR_STRING: return convertFromString<int16_t>();
@@ -442,7 +442,7 @@ int32_t VariantImpl::asInt32() const
return int32_t(value.ui32);
break;
case VAR_UINT64:
- if (value.ui64 <= (uint32_t) std::numeric_limits<int32_t>::max())
+ if (value.ui64 <= (uint64_t) std::numeric_limits<int32_t>::max())
return int32_t(value.ui64);
break;
case VAR_STRING: return convertFromString<int32_t>();
diff --git a/qpid/cpp/src/windows/QpiddBroker.cpp b/qpid/cpp/src/windows/QpiddBroker.cpp
index e221551575..50bb45979c 100644
--- a/qpid/cpp/src/windows/QpiddBroker.cpp
+++ b/qpid/cpp/src/windows/QpiddBroker.cpp
@@ -155,7 +155,7 @@ NamedSharedMemory<T>::NamedSharedMemory(const std::string& n) :
name(n),
memory(NULL),
data(0)
-{};
+{}
template <typename T>
NamedSharedMemory<T>::~NamedSharedMemory() {
@@ -163,7 +163,7 @@ NamedSharedMemory<T>::~NamedSharedMemory() {
::UnmapViewOfFile(data);
if (memory != NULL)
::CloseHandle(memory);
-};
+}
template <typename T>
T& NamedSharedMemory<T>::create() {