summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2013-01-22 23:41:49 +0100
committerJose <jose@zeroc.com>2013-01-22 23:41:49 +0100
commit19f0c17162b6039ecacbb8b1d53c7eb5992ce153 (patch)
treee4ffb69a99fda90c33f9e2d7437870d73d2a64b0
parentICE-5091 - IceGrid/secure demo needs admin key (diff)
downloadice-19f0c17162b6039ecacbb8b1d53c7eb5992ce153.tar.bz2
ice-19f0c17162b6039ecacbb8b1d53c7eb5992ce153.tar.xz
ice-19f0c17162b6039ecacbb8b1d53c7eb5992ce153.zip
Minor code style fixes
-rw-r--r--cpp/config/Make.rules.Darwin2
-rw-r--r--cpp/include/Ice/Buffer.h4
-rw-r--r--cpp/include/IceUtil/MutexPtrLock.h4
-rw-r--r--cpp/include/IceUtil/MutexPtrTryLock.h4
-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
11 files changed, 16 insertions, 25 deletions
diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin
index 5616cbba8fe..2bddfd9e689 100644
--- a/cpp/config/Make.rules.Darwin
+++ b/cpp/config/Make.rules.Darwin
@@ -11,7 +11,7 @@
# This file is included by Make.rules when uname is Darwin.
#
-CXX = xcrun clang++
+CXX ?= xcrun clang++
CXXFLAGS = -Wall -Werror -D_REENTRANT
diff --git a/cpp/include/Ice/Buffer.h b/cpp/include/Ice/Buffer.h
index 37f69eb3725..7801cd33b2c 100644
--- a/cpp/include/Ice/Buffer.h
+++ b/cpp/include/Ice/Buffer.h
@@ -7,8 +7,8 @@
//
// **********************************************************************
-#ifndef ICEE_BUFFER_H
-#define ICEE_BUFFER_H
+#ifndef ICE_BUFFER_H
+#define ICE_BUFFER_H
#include <Ice/Config.h>
diff --git a/cpp/include/IceUtil/MutexPtrLock.h b/cpp/include/IceUtil/MutexPtrLock.h
index 3574a95a442..fda5aa460f0 100644
--- a/cpp/include/IceUtil/MutexPtrLock.h
+++ b/cpp/include/IceUtil/MutexPtrLock.h
@@ -2,8 +2,8 @@
//
// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
//
-// This copy of Ice-E is licensed to you under the terms described in the
-// ICEE_LICENSE file included in this distribution.
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
diff --git a/cpp/include/IceUtil/MutexPtrTryLock.h b/cpp/include/IceUtil/MutexPtrTryLock.h
index 7eb64d242c8..e3a3441375b 100644
--- a/cpp/include/IceUtil/MutexPtrTryLock.h
+++ b/cpp/include/IceUtil/MutexPtrTryLock.h
@@ -2,8 +2,8 @@
//
// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
//
-// This copy of Ice-E is licensed to you under the terms described in the
-// ICEE_LICENSE file included in this distribution.
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
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);