summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ace/CDR_Stream.cpp2
-rw-r--r--ace/Pipe.inl22
-rw-r--r--ace/Svc_Handler.h2
-rw-r--r--examples/DLL/Newsweek.cpp11
-rw-r--r--examples/DLL/Newsweek.h3
-rw-r--r--examples/DLL/Today.cpp11
-rw-r--r--examples/DLL/Today.h3
-rw-r--r--examples/Shared_Malloc/test_persistence.cpp15
-rw-r--r--tests/Thread_Pool_Test.cpp2
9 files changed, 50 insertions, 21 deletions
diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp
index c04b8210a4e..5ffa276a3b5 100644
--- a/ace/CDR_Stream.cpp
+++ b/ace/CDR_Stream.cpp
@@ -361,7 +361,7 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb)
continue;
}
- ACE_Message_Block* cont;
+ ACE_Message_Block* cont = 0;
this->good_bit_ = false;
ACE_NEW_RETURN (cont,
ACE_Message_Block (i->data_block ()->duplicate ()),
diff --git a/ace/Pipe.inl b/ace/Pipe.inl
index 15328c22a75..17b532ed632 100644
--- a/ace/Pipe.inl
+++ b/ace/Pipe.inl
@@ -45,17 +45,17 @@ ACE_Pipe::sendv_n (const iovec iov[], int n) const
ACE_INLINE ssize_t
ACE_Pipe::send_n (const ACE_Message_Block *message_block,
- const ACE_Time_Value *timeout,
- size_t *bytes_transferred)
+ const ACE_Time_Value *timeout,
+ size_t *bytes_transferred)
{
ACE_TRACE ("ACE_Pipe::send_n");
- ACE_UNUSED_ARG (timeout);
#if defined (ACE_WIN32)
return ACE::send_n (this->write_handle (),
message_block,
timeout,
bytes_transferred);
#else
+ ACE_UNUSED_ARG (timeout);
return ACE::write_n (this->write_handle (),
message_block,
bytes_transferred);
@@ -127,9 +127,9 @@ ACE_Pipe::send (const void *buf, size_t n) const
{
ACE_TRACE ("ACE_Pipe::send");
#if defined (ACE_WIN32)
- return ACE_OS::send (this->write_handle (), (const char *) buf, n);
+ return ACE_OS::send (this->write_handle (), static_cast <const char *> (buf), n);
#else
- return ACE_OS::write (this->write_handle (), (const char *) buf, n);
+ return ACE_OS::write (this->write_handle (), static_cast <const char *> (buf), n);
#endif /* ACE_WIN32 */
}
@@ -138,9 +138,9 @@ ACE_Pipe::recv (void *buf, size_t n) const
{
ACE_TRACE ("ACE_Pipe::recv");
#if defined (ACE_WIN32)
- return ACE_OS::recv (this->read_handle (), (char *) buf, n);
+ return ACE_OS::recv (this->read_handle (), static_cast <char *> (buf), n);
#else
- return ACE_OS::read (this->read_handle (), (char *) buf, n);
+ return ACE_OS::read (this->read_handle (), static_cast <char *> (buf), n);
#endif /* ACE_WIN32 */
}
@@ -168,20 +168,20 @@ ACE_Pipe::recv (iovec iov[], int n) const
ACE_INLINE ssize_t
ACE_Pipe::send (const void *buf, size_t n,
- ACE_OVERLAPPED *overlapped) const
+ ACE_OVERLAPPED *overlapped) const
{
ACE_TRACE ("ACE_Pipe::send");
return ACE_OS::write (this->write_handle (),
- (const char *) buf, n,
+ static_cast <const char *> (buf), n,
overlapped);
}
ACE_INLINE ssize_t
ACE_Pipe::recv (void *buf, size_t n,
- ACE_OVERLAPPED *overlapped) const
+ ACE_OVERLAPPED *overlapped) const
{
ACE_TRACE ("ACE_Pipe::recv");
- return ACE_OS::read (this->read_handle (), (char *) buf, n,
+ return ACE_OS::read (this->read_handle (), static_cast <char *> (buf), n,
overlapped);
}
diff --git a/ace/Svc_Handler.h b/ace/Svc_Handler.h
index 8a633aaeef2..76027b9e409 100644
--- a/ace/Svc_Handler.h
+++ b/ace/Svc_Handler.h
@@ -236,7 +236,7 @@ protected:
/// Keeps track of whether we are in the process of closing (required
/// to avoid circular calls to <handle_close>).
- char closing_;
+ int closing_;
/// Pointer to the connection recycler.
ACE_Connection_Recycling_Strategy *recycler_;
diff --git a/examples/DLL/Newsweek.cpp b/examples/DLL/Newsweek.cpp
index 5bb26def20e..9d6d1f0b4c6 100644
--- a/examples/DLL/Newsweek.cpp
+++ b/examples/DLL/Newsweek.cpp
@@ -27,11 +27,18 @@ Newsweek::operator new (size_t bytes, const ACE_nothrow_t&)
{
return ::new (ACE_nothrow) char[bytes];
}
+#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE)
+void
+Newsweek::operator delete (void *p, const ACE_nothrow_t&) throw ();
+{
+ delete [] static_cast <char *> (ptr);
+}
+#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */
#endif
void
Newsweek::operator delete (void *ptr)
{
- delete [] ((char *) ptr);
+ delete [] static_cast <char *> (ptr);
}
// Returns the Newsweek class pointer.
@@ -42,7 +49,7 @@ extern "C" ACE_Svc_Export Magazine *create_magazine (void);
Magazine *
create_magazine (void)
{
- Magazine *mag;
+ Magazine *mag = 0;
ACE_NEW_RETURN (mag, Newsweek, 0);
return mag;
}
diff --git a/examples/DLL/Newsweek.h b/examples/DLL/Newsweek.h
index 9f53b8c190a..79355e74cbd 100644
--- a/examples/DLL/Newsweek.h
+++ b/examples/DLL/Newsweek.h
@@ -49,6 +49,9 @@ public:
#if defined (ACE_HAS_NEW_NOTHROW)
// Overloaded new operator, nothrow_t variant.
void *operator new (size_t bytes, const ACE_nothrow_t&);
+#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE)
+ void operator delete (void *p, const ACE_nothrow_t&) throw ();
+#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */
#endif
void operator delete (void *ptr);
};
diff --git a/examples/DLL/Today.cpp b/examples/DLL/Today.cpp
index 036a7c82ccc..cebf94ec724 100644
--- a/examples/DLL/Today.cpp
+++ b/examples/DLL/Today.cpp
@@ -28,11 +28,18 @@ Today::operator new (size_t bytes, const ACE_nothrow_t&)
{
return ::new (ACE_nothrow) char[bytes];
}
+#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE)
+void
+Today::operator delete (void *p, const ACE_nothrow_t&) throw ();
+{
+ delete [] static_cast <char *> (ptr);
+}
+#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */
#endif
void
Today::operator delete (void *ptr)
{
- delete [] ((char *) ptr);
+ delete [] static_cast <char *> (ptr);
}
// Returns the pointer to the Today class.
@@ -42,7 +49,7 @@ extern "C" ACE_Svc_Export Magazine *create_magazine (void);
Magazine *create_magazine (void)
{
- Magazine *mag;
+ Magazine *mag = 0;
ACE_NEW_RETURN (mag, Today, 0);
return mag;
}
diff --git a/examples/DLL/Today.h b/examples/DLL/Today.h
index 19cce2317b5..00c2d4b9c04 100644
--- a/examples/DLL/Today.h
+++ b/examples/DLL/Today.h
@@ -50,6 +50,9 @@ public:
#if defined (ACE_HAS_NEW_NOTHROW)
// Overloaded new operator, nothrow_t variant.
void *operator new (size_t bytes, const ACE_nothrow_t&);
+#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE)
+ void operator delete (void *p, const ACE_nothrow_t&) throw ();
+#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */
#endif
void operator delete (void *ptr);
};
diff --git a/examples/Shared_Malloc/test_persistence.cpp b/examples/Shared_Malloc/test_persistence.cpp
index 682ed8a5943..740faa17efb 100644
--- a/examples/Shared_Malloc/test_persistence.cpp
+++ b/examples/Shared_Malloc/test_persistence.cpp
@@ -69,9 +69,18 @@ public:
{
return shmem_allocator->malloc (sizeof (Employee));
}
+#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE)
+ void operator delete (void *p, const ACE_nothrow_t&) throw ()
+ {
+ shmem_allocator->free (pointer);
+ }
+#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */
#endif
- void operator delete (void *pointer) { shmem_allocator->free (pointer); }
+ void operator delete (void *pointer)
+ {
+ shmem_allocator->free (pointer);
+ }
private:
char *name_;
@@ -199,7 +208,7 @@ GUI_Handler::insert_employee (const char *name,
int
GUI_Handler::find_employee (const char *name)
{
- void *temp;
+ void *temp = 0;
if (shmem_allocator->find (name,
temp) == 0)
@@ -263,7 +272,7 @@ GUI_Handler::list_employees (void)
int
GUI_Handler::delete_employee (const char *name)
{
- void *temp;
+ void *temp = 0;
if (shmem_allocator->unbind (name,
temp) == 0)
diff --git a/tests/Thread_Pool_Test.cpp b/tests/Thread_Pool_Test.cpp
index a201efaf3ee..f6a649aa8ab 100644
--- a/tests/Thread_Pool_Test.cpp
+++ b/tests/Thread_Pool_Test.cpp
@@ -123,7 +123,7 @@ Thread_Pool::svc (void)
for (int count = 1; ; count++)
{
- ACE_Message_Block *mb;
+ ACE_Message_Block *mb = 0;
int result = this->getq (mb);