summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp8
-rw-r--r--cpp/include/Ice/IconvStringConverter.h8
-rw-r--r--cpp/src/Ice/ConnectionI.cpp4
-rw-r--r--cpp/src/IceGrid/Database.cpp2
-rw-r--r--cpp/test/IceUtil/condvar/WorkQueue.cpp2
-rw-r--r--cpp/test/Slice/keyword/Client.cpp5
6 files changed, 23 insertions, 6 deletions
diff --git a/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp b/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
index ce841070525..b2c4cb31ecf 100644
--- a/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
+++ b/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
@@ -47,9 +47,13 @@ CurrentDatabase::CurrentDatabase(const Ice::CommunicatorPtr& comm, const string&
_dbName(dbName)
{
#ifdef USE_PTHREAD_KEY
+#ifdef NDEBUG
+ pthread_key_create(&dbKey, 0);
+#else
int rs = pthread_key_create(&dbKey, 0);
assert(rs == 0);
#endif
+#endif
}
CurrentDatabase::~CurrentDatabase()
@@ -75,9 +79,13 @@ CurrentDatabase::get()
Mutex::Lock sync(_dbListMutex);
_dbList.push_back(db);
#ifdef USE_PTHREAD_KEY
+#ifdef NDEBUG
+ pthread_setspecific(dbKey, db);
+#else
int rs = pthread_setspecific(dbKey, db);
assert(rs == 0);
#endif
+#endif
}
return *db;
}
diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h
index 7e12263c27a..09b5e89f7b6 100644
--- a/cpp/include/Ice/IconvStringConverter.h
+++ b/cpp/include/Ice/IconvStringConverter.h
@@ -239,8 +239,12 @@ IconvStringConverter<charT>::toUTF8(const charT* sourceStart, const charT* sourc
//
// Reset cd
//
+#ifdef NDEBUG
+ iconv(cd, 0, 0, 0, 0);
+#else
int rs = iconv(cd, 0, 0, 0, 0);
assert(rs == 0);
+#endif
#ifdef ICE_CONST_ICONV_INBUF
const char* inbuf = reinterpret_cast<const char*>(sourceStart);
@@ -281,8 +285,12 @@ IconvStringConverter<charT>::fromUTF8(const Ice::Byte* sourceStart, const Ice::B
//
// Reset cd
//
+#ifdef NDEBUG
+ iconv(cd, 0, 0, 0, 0);
+#else
int rs = iconv(cd, 0, 0, 0, 0);
assert(rs == 0);
+#endif
#ifdef ICE_CONST_ICONV_INBUF
const char* inbuf = reinterpret_cast<const char*>(sourceStart);
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index 381eccd8a9c..01141e72b26 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -565,7 +565,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncPtr& out, bool compress, b
#endif
}
- bool sent;
+ bool sent = false;
try
{
OutgoingMessage message(out, os, compress, response);
@@ -875,7 +875,7 @@ Ice::ConnectionI::flushAsyncBatchRequests(const BatchOutgoingAsyncPtr& outAsync)
//
// Send the batch stream.
//
- bool sent;
+ bool sent = false;
try
{
OutgoingMessage message(outAsync, outAsync->__getOs(), _batchRequestCompress, false);
diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp
index f6ec1d0f58c..5e5ff949aef 100644
--- a/cpp/src/IceGrid/Database.cpp
+++ b/cpp/src/IceGrid/Database.cpp
@@ -630,7 +630,7 @@ Database::getAllocatableObject(const Ice::Identity& id) const
void
Database::setAdapterDirectProxy(const string& adapterId, const string& replicaGroupId, const Ice::ObjectPrx& proxy)
{
- int serial;
+ int serial = 0;
{
Lock sync(*this);
if(_adapterCache.has(adapterId))
diff --git a/cpp/test/IceUtil/condvar/WorkQueue.cpp b/cpp/test/IceUtil/condvar/WorkQueue.cpp
index 917f4bdcd63..98f64f8fffe 100644
--- a/cpp/test/IceUtil/condvar/WorkQueue.cpp
+++ b/cpp/test/IceUtil/condvar/WorkQueue.cpp
@@ -183,7 +183,7 @@ public:
{
while(true)
{
- int res;
+ int res = 0;
// This is a poll.
bool tout = _q->timedGet(res, Time::seconds(0));
_dog->touch(!tout);
diff --git a/cpp/test/Slice/keyword/Client.cpp b/cpp/test/Slice/keyword/Client.cpp
index 9b283edf767..56163a422c5 100644
--- a/cpp/test/Slice/keyword/Client.cpp
+++ b/cpp/test/Slice/keyword/Client.cpp
@@ -8,6 +8,7 @@
// **********************************************************************
#include <Ice/Ice.h>
+#include <TestCommon.h>
#include <Key.h>
using namespace std;
@@ -81,7 +82,7 @@ void
testtypes()
{
_cpp_and::_cpp_continue a = _cpp_and::_cpp_asm;
- assert(a);
+ test(a);
_cpp_and::_cpp_auto b;
b._cpp_default = 0;
@@ -119,7 +120,7 @@ testtypes()
_cpp_and::friendPtr l = new friendI();
const int m = _cpp_and::_cpp_template;
- assert(m == _cpp_and::_cpp_template);
+ test(m == _cpp_and::_cpp_template);
}
int