summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Freeze/MapDb.cpp2
-rw-r--r--cpp/src/Freeze/MapI.cpp6
-rw-r--r--cpp/src/Freeze/SharedDbEnv.cpp3
-rw-r--r--cpp/src/Ice/Service.cpp3
-rw-r--r--cpp/src/IceUtil/Cond.cpp7
-rw-r--r--cpp/src/IceUtil/CountDownLatch.cpp3
-rw-r--r--cpp/src/IceUtil/RecMutex.cpp3
7 files changed, 9 insertions, 18 deletions
diff --git a/cpp/src/Freeze/MapDb.cpp b/cpp/src/Freeze/MapDb.cpp
index 1453ab4fcc4..7d7117b324f 100644
--- a/cpp/src/Freeze/MapDb.cpp
+++ b/cpp/src/Freeze/MapDb.cpp
@@ -229,7 +229,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection,
}
#ifdef NDEBUG
- _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get()));
+ _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get()));
#else
bool inserted =
_indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())).second;
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
index 13e1db66950..c8f329fd5a2 100644
--- a/cpp/src/Freeze/MapI.cpp
+++ b/cpp/src/Freeze/MapI.cpp
@@ -760,8 +760,7 @@ Freeze::IteratorHelperI::set(const Value& value)
try
{
#ifndef NDEBUG
- int err;
- err = _dbc->put(&dbKey, &dbValue, DB_CURRENT);
+ int err = _dbc->put(&dbKey, &dbValue, DB_CURRENT);
assert(err == 0);
#else
_dbc->put(&dbKey, &dbValue, DB_CURRENT);
@@ -1386,8 +1385,7 @@ Freeze::MapHelperI::clear()
{
u_int32_t count;
#ifndef NDEBUG
- int err;
- err = _db->truncate(txn, &count, txn != 0 ? 0 : DB_AUTO_COMMIT);
+ int err = _db->truncate(txn, &count, txn != 0 ? 0 : DB_AUTO_COMMIT);
assert(err == 0);
#else
_db->truncate(txn, &count, txn != 0 ? 0 : DB_AUTO_COMMIT);
diff --git a/cpp/src/Freeze/SharedDbEnv.cpp b/cpp/src/Freeze/SharedDbEnv.cpp
index 1a5f7dd6d12..f288dce366f 100644
--- a/cpp/src/Freeze/SharedDbEnv.cpp
+++ b/cpp/src/Freeze/SharedDbEnv.cpp
@@ -331,8 +331,7 @@ void Freeze::SharedDbEnv::__decRef()
// Remove from map
//
#ifndef NDEBUG
- size_t one;
- one = sharedDbEnvMap->erase(key);
+ size_t one = sharedDbEnvMap->erase(key);
assert(one == 1);
#else
sharedDbEnvMap->erase(key);
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index d5f77ada648..92fb99ca528 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -1706,8 +1706,7 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
//
// Associate stdin, stdout and stderr with /dev/null.
//
- int fd;
- fd = open("/dev/null", O_RDWR);
+ int fd = open("/dev/null", O_RDWR);
assert(fd == 0);
if(fd != 0)
{
diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp
index c515e36f53b..1aa8cc85a82 100644
--- a/cpp/src/IceUtil/Cond.cpp
+++ b/cpp/src/IceUtil/Cond.cpp
@@ -324,11 +324,9 @@ IceUtil::Cond::timedDowait(const Time& timeout) const
IceUtil::Cond::Cond()
{
- int rc;
-
pthread_condattr_t attr;
- rc = pthread_condattr_init(&attr);
+ int rc = pthread_condattr_init(&attr);
if(rc != 0)
{
throw ThreadSyscallException(__FILE__, __LINE__, rc);
@@ -358,8 +356,7 @@ IceUtil::Cond::Cond()
IceUtil::Cond::~Cond()
{
#ifndef NDEBUG
- int rc = 0;
- rc = pthread_cond_destroy(&_cond);
+ int rc = pthread_cond_destroy(&_cond);
assert(rc == 0);
#else
pthread_cond_destroy(&_cond);
diff --git a/cpp/src/IceUtil/CountDownLatch.cpp b/cpp/src/IceUtil/CountDownLatch.cpp
index 6102df82663..88f234b6f8d 100644
--- a/cpp/src/IceUtil/CountDownLatch.cpp
+++ b/cpp/src/IceUtil/CountDownLatch.cpp
@@ -49,8 +49,7 @@ IceUtilInternal::CountDownLatch::~CountDownLatch()
CloseHandle(_event);
#else
# ifndef NDEBUG
- int rc = 0;
- rc = pthread_mutex_destroy(&_mutex);
+ int rc = pthread_mutex_destroy(&_mutex);
assert(rc == 0);
rc = pthread_cond_destroy(&_cond);
assert(rc == 0);
diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp
index 6a3f54a55eb..277898dcf63 100644
--- a/cpp/src/IceUtil/RecMutex.cpp
+++ b/cpp/src/IceUtil/RecMutex.cpp
@@ -169,8 +169,7 @@ IceUtil::RecMutex::~RecMutex()
{
assert(_count == 0);
#ifndef NDEBUG
- int rc = 0;
- rc = pthread_mutex_destroy(&_mutex);
+ int rc = pthread_mutex_destroy(&_mutex);
assert(rc == 0);
#else
pthread_mutex_destroy(&_mutex);