summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog23
-rw-r--r--ace/ARGV.cpp2
-rw-r--r--ace/Condition_Recursive_Thread_Mutex.cpp2
-rw-r--r--ace/Condition_Thread_Mutex.cpp2
-rw-r--r--ace/Dump.cpp4
-rw-r--r--ace/Event.cpp2
-rw-r--r--ace/Filecache.cpp2
-rw-r--r--ace/Message_Block.cpp2
-rw-r--r--ace/Name_Proxy.cpp6
-rw-r--r--ace/Name_Proxy.h5
-rw-r--r--ace/Name_Request_Reply.h5
-rw-r--r--ace/Naming_Context.cpp3
-rw-r--r--ace/OS_NS_sys_socket.cpp2
-rw-r--r--ace/Service_Object.cpp2
-rw-r--r--ace/Service_Types.cpp8
15 files changed, 53 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index ded56064981..a1a751aa7aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+Thu Jan 27 18:48:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/ARGV.cpp:
+ * ace/Condition_Recursive_Thread_Mutex.cpp:
+ * ace/Condition_Thread_Mutex.cpp:
+ * ace/Dump.cpp:
+ * ace/Event.cpp:
+ * ace/Filecache.cpp:
+ * ace/Message_Block.cpp:
+ * ace/OS_NS_sys_socket.cpp:
+ * ace/Service_Object.cpp:
+ * ace/Service_Types.cpp:
+ Replaced c-style cast with C++ casts
+
+ * ace/Name_Proxy.cpp:
+ * ace/Naming_Context.cpp:
+ Added missing members to initialisation list
+
+ * ace/Name_Proxy.h:
+ * ace/Name_Request_Reply.h:
+ Added private assignment operator and copy constructor
+ to prevent copying.
+
Wed Jan 26 12:57:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/ICMP_Socket.{h,cpp}:
diff --git a/ace/ARGV.cpp b/ace/ARGV.cpp
index 7e7b323fbdc..8109c3c215c 100644
--- a/ace/ARGV.cpp
+++ b/ace/ARGV.cpp
@@ -183,7 +183,7 @@ ACE_ARGV::add (const ACE_TCHAR *next_arg)
}
// Put the new argument at the end of the queue.
- if (this->queue_.enqueue_tail ((ACE_TCHAR *) next_arg) == -1)
+ if (this->queue_.enqueue_tail (const_cast <ACE_TCHAR *> (next_arg)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_LIB_TEXT ("Can't add more to ARGV queue")),
-1);
diff --git a/ace/Condition_Recursive_Thread_Mutex.cpp b/ace/Condition_Recursive_Thread_Mutex.cpp
index 72270ff44d6..509b0a1c2be 100644
--- a/ace/Condition_Recursive_Thread_Mutex.cpp
+++ b/ace/Condition_Recursive_Thread_Mutex.cpp
@@ -80,7 +80,7 @@ ACE_Condition<ACE_Recursive_Thread_Mutex>::wait (ACE_Recursive_Thread_Mutex &mut
&mutex.get_nesting_mutex ())
: ACE_OS::cond_timedwait (&this->cond_,
&mutex.get_nesting_mutex (),
- (ACE_Time_Value *) abstime);
+ const_cast <ACE_Time_Value *> (abstime));
// We are holding the mutex, whether the wait succeeded or failed.
// Stash errno (in case it failed) and then we need to reset the
// recursive mutex state to what it was on entry to this method.
diff --git a/ace/Condition_Thread_Mutex.cpp b/ace/Condition_Thread_Mutex.cpp
index 0c50c0c0373..a04e2b30847 100644
--- a/ace/Condition_Thread_Mutex.cpp
+++ b/ace/Condition_Thread_Mutex.cpp
@@ -109,7 +109,7 @@ ACE_Condition_Thread_Mutex::wait (ACE_Thread_Mutex &mutex,
// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait");
return ACE_OS::cond_timedwait (&this->cond_,
&mutex.lock_,
- (ACE_Time_Value *) abstime);
+ const_cast <ACE_Time_Value *> (abstime));
}
int
diff --git a/ace/Dump.cpp b/ace/Dump.cpp
index e0f98640593..380be07f857 100644
--- a/ace/Dump.cpp
+++ b/ace/Dump.cpp
@@ -40,8 +40,8 @@ ACE_Dumpable_Ptr::operator= (const ACE_Dumpable *dumper) const
ACE_TRACE ("ACE_Dumpable_Ptr::operator=");
if (this->dumper_ != dumper)
{
- delete (ACE_Dumpable *) this->dumper_;
- ((ACE_Dumpable_Ptr *) this)->dumper_ = dumper;
+ delete const_cast <ACE_Dumpable *> (this->dumper_);
+ (const_cast<ACE_Dumpable_Ptr *> (this))->dumper_ = dumper;
}
}
diff --git a/ace/Event.cpp b/ace/Event.cpp
index 06c14937acd..fde6f78840c 100644
--- a/ace/Event.cpp
+++ b/ace/Event.cpp
@@ -55,7 +55,7 @@ int
ACE_Event::wait (const ACE_Time_Value *abstime, int use_absolute_time)
{
return ACE_OS::event_timedwait (&this->handle_,
- (ACE_Time_Value *) abstime,
+ const_cast <ACE_Time_Value *> (abstime),
use_absolute_time);
}
diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp
index 8d3ded1a4b6..a3aabc700c3 100644
--- a/ace/Filecache.cpp
+++ b/ace/Filecache.cpp
@@ -111,7 +111,7 @@ ACE_Filecache_Handle::handle (void) const
if (this->handle_ == ACE_INVALID_HANDLE && this->file_ != 0)
{
ACE_Filecache_Handle *mutable_this =
- (ACE_Filecache_Handle *) this;
+ const_cast<ACE_Filecache_Handle *> (this);
mutable_this->handle_ = ACE_OS::dup (this->file_->handle ());
}
return this->handle_;
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp
index b15838a8791..09b12e2b91c 100644
--- a/ace/Message_Block.cpp
+++ b/ace/Message_Block.cpp
@@ -322,7 +322,7 @@ ACE_Data_Block::ACE_Data_Block (size_t size,
cur_size_ (0), // Reset later if memory alloc'd ok
max_size_ (0),
flags_ (flags),
- base_ ((char *) msg_data),
+ base_ (const_cast <char *> (msg_data)),
allocator_strategy_ (allocator_strategy),
locking_strategy_ (locking_strategy),
reference_count_ (1),
diff --git a/ace/Name_Proxy.cpp b/ace/Name_Proxy.cpp
index a5157d5d9ac..5a3e61cbb16 100644
--- a/ace/Name_Proxy.cpp
+++ b/ace/Name_Proxy.cpp
@@ -49,8 +49,10 @@ ACE_Name_Proxy::open (const ACE_INET_Addr &remote_addr,
// Establish binding with the ACE_Name Server at remote_addr.
-ACE_Name_Proxy::ACE_Name_Proxy (const ACE_INET_Addr &remote_addr,
- ACE_Synch_Options& options)
+ACE_Name_Proxy::ACE_Name_Proxy (
+ const ACE_INET_Addr &remote_addr,
+ ACE_Synch_Options& options)
+ : reactor_ (0)
{
ACE_TRACE ("ACE_Name_Proxy::ACE_Name_Proxy");
if (this->open (remote_addr, options) == -1
diff --git a/ace/Name_Proxy.h b/ace/Name_Proxy.h
index a10dac70b29..d4d0c5cda3a 100644
--- a/ace/Name_Proxy.h
+++ b/ace/Name_Proxy.h
@@ -85,6 +85,11 @@ private:
/// Pointer to ACE_Reactor (used if we are run in "reactive-mode").
ACE_Reactor *reactor_;
+
+private:
+ // Prevent copying
+ ACE_Name_Proxy (const ACE_Name_Proxy &);
+ ACE_Name_Proxy &operator= (const ACE_Name_Proxy &);
};
#include /**/ "ace/post.h"
diff --git a/ace/Name_Request_Reply.h b/ace/Name_Request_Reply.h
index 130099a55cc..b9afb72818c 100644
--- a/ace/Name_Request_Reply.h
+++ b/ace/Name_Request_Reply.h
@@ -181,6 +181,11 @@ private:
/// Pointer to the beginning of the type in this->data_;
char *type_;
+
+private:
+ // Prevent copying
+ ACE_Name_Request (const ACE_Name_Request &);
+ ACE_Name_Request &operator= (const ACE_Name_Request &);
};
/**
diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp
index 220ad5a9e17..871f4ee0ce7 100644
--- a/ace/Naming_Context.cpp
+++ b/ace/Naming_Context.cpp
@@ -156,7 +156,8 @@ ACE_Naming_Context::ACE_Naming_Context (void)
ACE_Naming_Context::ACE_Naming_Context (Context_Scope_Type scope_in,
int lite)
: name_options_ (0),
- name_space_ (0)
+ name_space_ (0),
+ netnameserver_host_ (0)
{
ACE_TRACE ("ACE_Naming_Context::ACE_Naming_Context");
diff --git a/ace/OS_NS_sys_socket.cpp b/ace/OS_NS_sys_socket.cpp
index 1eb0500ad5f..cd4ae2d469f 100644
--- a/ace/OS_NS_sys_socket.cpp
+++ b/ace/OS_NS_sys_socket.cpp
@@ -55,7 +55,7 @@ ACE_OS::connect (ACE_HANDLE handle,
# else
ACE_UNUSED_ARG (qos_params);
return ACE_OS::connect (handle,
- (sockaddr *) addr,
+ const_cast <sockaddr *> (addr),
addrlen);
# endif /* ACE_HAS_WINSOCK2 */
}
diff --git a/ace/Service_Object.cpp b/ace/Service_Object.cpp
index 3db9dc257c7..5faf5cd09ca 100644
--- a/ace/Service_Object.cpp
+++ b/ace/Service_Object.cpp
@@ -121,6 +121,6 @@ ACE_Service_Type::name (const ACE_TCHAR *n)
{
ACE_TRACE ("ACE_Service_Type::name");
- delete [] (ACE_TCHAR *) this->name_;
+ delete [] const_cast <ACE_TCHAR *> (this->name_);
this->name_ = ACE::strnew (n);
}
diff --git a/ace/Service_Types.cpp b/ace/Service_Types.cpp
index fb0b13c1837..e941bf4a610 100644
--- a/ace/Service_Types.cpp
+++ b/ace/Service_Types.cpp
@@ -46,7 +46,7 @@ ACE_Service_Type_Impl::~ACE_Service_Type_Impl (void)
// It's ok to call this, even though we may have already deleted it
// in the fini() method since it would then be NULL.
- delete [] (ACE_TCHAR *) this->name_;
+ delete [] const_cast <ACE_TCHAR *> (this->name_);
}
int
@@ -59,8 +59,8 @@ ACE_Service_Type_Impl::fini (void) const
this->name_,
this->flags_));
- delete [] (ACE_TCHAR *) this->name_;
- ((ACE_Service_Type_Impl *) this)->name_ = 0;
+ delete [] const_cast <ACE_TCHAR *> (this->name_);
+ (const_cast <ACE_Service_Type_Impl *> (this))->name_ = 0;
if (ACE_BIT_ENABLED (this->flags_,
ACE_Service_Type::DELETE_OBJ))
@@ -74,7 +74,7 @@ ACE_Service_Type_Impl::fini (void) const
if (ACE_BIT_ENABLED (this->flags_,
ACE_Service_Type::DELETE_THIS))
- delete (ACE_Service_Type_Impl *) this;
+ delete const_cast <ACE_Service_Type_Impl *> (this);
return 0;
}