summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-17 02:33:12 +0000
committercdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-17 02:33:12 +0000
commit25fed67cccb91808846a26deb63e53b284937fc5 (patch)
tree61d30eeeca1b5a4dbc69927b1e235811b9026274
parent6332e26c88fe2c705ba5590e25805f53bc1c0e57 (diff)
downloadATCD-25fed67cccb91808846a26deb63e53b284937fc5.tar.gz
pSOSim port
-rw-r--r--ace/Containers.cpp18
-rw-r--r--ace/Map_Manager.cpp14
-rw-r--r--ace/Mem_Map.cpp6
-rw-r--r--ace/Message_Block.cpp4
-rw-r--r--tests/Conn_Test.cpp16
-rw-r--r--tests/Handle_Set_Test.cpp2
-rw-r--r--tests/MM_Shared_Memory_Test.cpp2
-rw-r--r--tests/Priority_Reactor_Test.cpp4
-rw-r--r--tests/SOCK_Connector_Test.cpp5
9 files changed, 37 insertions, 34 deletions
diff --git a/ace/Containers.cpp b/ace/Containers.cpp
index a7cf8a35a39..89971faa51d 100644
--- a/ace/Containers.cpp
+++ b/ace/Containers.cpp
@@ -1095,12 +1095,12 @@ ACE_Fixed_Set_Iterator<T, SIZE>::advance (void)
ACE_TRACE ("ACE_Fixed_Set_Iterator<T, SIZE>::advance");
for (++this->next_;
- size_t (this->next_) < this->s_.cur_size_
+ ACE_static_cast(size_t, this->next_) < this->s_.cur_size_
&& this->s_.search_structure_[this->next_].is_free_;
++this->next_)
continue;
- return size_t (this->next_) < this->s_.cur_size_;
+ return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_;
}
template <class T, size_t SIZE> int
@@ -1108,14 +1108,14 @@ ACE_Fixed_Set_Iterator<T, SIZE>::done (void) const
{
ACE_TRACE ("ACE_Fixed_Set_Iterator<T, SIZE>::done");
- return size_t (this->next_) >= this->s_.cur_size_;
+ return ACE_static_cast(size_t, this->next_) >= this->s_.cur_size_;
}
template <class T, size_t SIZE> int
ACE_Fixed_Set_Iterator<T, SIZE>::next (T *&item)
{
ACE_TRACE ("ACE_Fixed_Set_Iterator<T, SIZE>::next");
- if (size_t (this->next_) < this->s_.cur_size_)
+ if (ACE_static_cast(size_t, this->next_) < this->s_.cur_size_)
{
item = &this->s_.search_structure_[this->next_].item_;
return 1;
@@ -1142,7 +1142,7 @@ ACE_Bounded_Set<T>::~ACE_Bounded_Set (void)
template <class T>
ACE_Bounded_Set<T>::ACE_Bounded_Set (void)
: cur_size_ (0),
- max_size_ (size_t (ACE_Bounded_Set<T>::DEFAULT_SIZE))
+ max_size_ (ACE_static_cast(size_t, ACE_Bounded_Set<T>::DEFAULT_SIZE))
{
ACE_TRACE ("ACE_Bounded_Set<T>::ACE_Bounded_Set");
@@ -1299,12 +1299,12 @@ ACE_Bounded_Set_Iterator<T>::advance (void)
ACE_TRACE ("ACE_Bounded_Set_Iterator<T>::advance");
for (++this->next_;
- size_t (this->next_) < this->s_.cur_size_
+ ACE_static_cast(size_t, this->next_) < this->s_.cur_size_
&& this->s_.search_structure_[this->next_].is_free_;
++this->next_)
continue;
- return size_t (this->next_) < this->s_.cur_size_;
+ return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_;
}
template <class T> int
@@ -1312,14 +1312,14 @@ ACE_Bounded_Set_Iterator<T>::done (void) const
{
ACE_TRACE ("ACE_Bounded_Set_Iterator<T>::done");
- return size_t (this->next_) >= this->s_.cur_size_;
+ return ACE_static_cast(size_t, this->next_) >= this->s_.cur_size_;
}
template <class T> int
ACE_Bounded_Set_Iterator<T>::next (T *&item)
{
ACE_TRACE ("ACE_Bounded_Set_Iterator<T>::next");
- if (size_t (this->next_) < this->s_.cur_size_)
+ if (ACE_static_cast(size_t, this->next_) < this->s_.cur_size_)
{
item = &this->s_.search_structure_[this->next_].item_;
return 1;
diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp
index a188659556b..debb7d7de62 100644
--- a/ace/Map_Manager.cpp
+++ b/ace/Map_Manager.cpp
@@ -536,7 +536,8 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> size_t
ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::current_size (void)
{
ACE_TRACE ("ACE_Map_Manager::current_size");
- ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, (size_t) -1);
+ ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_,
+ ACE_static_cast(size_t, -1));
return this->cur_size_;
}
@@ -544,7 +545,8 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> size_t
ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::total_size (void)
{
ACE_TRACE ("ACE_Map_Manager::total_size");
- ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, (size_t) -1);
+ ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_,
+ ACE_static_cast(size_t, -1));
return this->total_size_;
}
@@ -578,7 +580,7 @@ ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::next (ACE_Map_Entry<EXT_ID, INT_ID>
if (this->map_man_.search_structure_ != 0
// Note that this->next_ is never negative at this point...
- && size_t (this->next_) < this->map_man_.cur_size_)
+ && ACE_static_cast(size_t, this->next_) < this->map_man_.cur_size_)
{
mm = &this->map_man_.search_structure_[this->next_];
return 1;
@@ -595,7 +597,7 @@ ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::done (void) const
return this->map_man_.search_structure_ == 0
// Note that this->next_ is never negative at this point...
- || size_t (this->next_) >= this->map_man_.cur_size_;
+ || ACE_static_cast(size_t, this->next_) >= this->map_man_.cur_size_;
}
template <class EXT_ID, class INT_ID, class ACE_LOCK> int
@@ -605,11 +607,11 @@ ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::advance (void)
ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_.lock_, -1);
for (++this->next_;
- size_t (this->next_) < this->map_man_.cur_size_
+ ACE_static_cast(size_t, this->next_) < this->map_man_.cur_size_
&& this->map_man_.search_structure_[this->next_].is_free_;
this->next_++)
continue;
- return size_t (this->next_) < this->map_man_.cur_size_;
+ return ACE_static_cast(size_t, this->next_) < this->map_man_.cur_size_;
}
ACE_ALLOC_HOOK_DEFINE(ACE_Map_Reverse_Iterator)
diff --git a/ace/Mem_Map.cpp b/ace/Mem_Map.cpp
index e412eb956fd..5f482ab33e8 100644
--- a/ace/Mem_Map.cpp
+++ b/ace/Mem_Map.cpp
@@ -65,7 +65,7 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle,
if (file_len == -1)
return -1;
- if (this->length_ < size_t (file_len))
+ if (this->length_ < ACE_static_cast(size_t, file_len))
{
// If the length of the mapped region is less than the length of
// the file then we force a complete new remapping by setting
@@ -75,13 +75,13 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle,
}
// At this point we know <file_len> is not negative...
- this->length_ = size_t (file_len);
+ this->length_ = ACE_static_cast(size_t, file_len);
if (len_request == -1)
len_request = 0;
if ((this->length_ == 0 && len_request > 0)
- || this->length_ < size_t (len_request))
+ || this->length_ < ACE_static_cast(size_t, len_request))
{
this->length_ = len_request;
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp
index 22338005ee4..31d86595042 100644
--- a/ace/Message_Block.cpp
+++ b/ace/Message_Block.cpp
@@ -31,7 +31,7 @@ ACE_Message_Block::copy (const char *buf, size_t n)
{
ACE_TRACE ("ACE_Message_Block::copy");
// Note that for this to work correct, end() *must* be >= wr_ptr().
- size_t len = size_t (this->end () - this->wr_ptr ());
+ size_t len = ACE_static_cast(size_t, this->end () - this->wr_ptr ());
if (len < n)
return -1;
@@ -48,7 +48,7 @@ ACE_Message_Block::copy (const char *buf)
{
ACE_TRACE ("ACE_Message_Block::copy");
// Note that for this to work correct, end() *must* be >= wr_ptr().
- size_t len = size_t (this->end () - this->wr_ptr ());
+ size_t len = ACE_static_cast(size_t, (this->end () - this->wr_ptr ()));
size_t buflen = ACE_OS::strlen (buf) + 1;
if (len < buflen)
diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp
index a397fa9d0aa..13077161c08 100644
--- a/tests/Conn_Test.cpp
+++ b/tests/Conn_Test.cpp
@@ -160,7 +160,7 @@ ACE_Hash_Addr<ACE_INET_Addr>::hash_i (const ACE_INET_Addr &addr) const
// listen-mode port/socket.
#if defined (ACE_HAS_THREAD_SAFE_ACCEPT)
typedef ACE_Null_Mutex ACCEPTOR_LOCKING;
-#elif (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
+#elif (defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_PSOS)) && defined (ACE_HAS_THREADS)
typedef ACE_Thread_Mutex ACCEPTOR_LOCKING;
#else
typedef ACE_Process_Mutex ACCEPTOR_LOCKING;
@@ -398,9 +398,9 @@ server (void *arg)
&cli_addr
// Timing out is the only way for threads to stop accepting, since we
// don't have signals
-#if defined (ACE_WIN32) || defined (VXWORKS)
+#if defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_PSOS)
, options
-#endif /* ACE_WIN32 || VXWORKS */
+#endif /* ACE_WIN32 || VXWORKS || ACE_PSOS */
);
if (result == -1)
@@ -421,7 +421,7 @@ server (void *arg)
return 0;
}
-#if !defined (ACE_WIN32) && !defined (VXWORKS)
+#if !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_PSOS)
static void
handler (int signum)
{
@@ -487,9 +487,9 @@ spawn_processes (ACCEPTOR *acceptor,
// Remove the lock so we don't have process semaphores lying around.
return acceptor->acceptor ().lock ().remove ();
}
-#endif /* ! ACE_WIN32 ! VXWORKS */
+#endif /* ! ACE_WIN32 ! VXWORKS ! ACE_PSOS */
-#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
+#if (defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_PSOS)) && defined (ACE_HAS_THREADS)
// Spawn threads and run the client and server.
static void
@@ -512,7 +512,7 @@ spawn_threads (ACCEPTOR *acceptor,
// Wait for the threads to exit.
ACE_Thread_Manager::instance ()->wait ();
}
-#endif /* (ACE_WIN32 || VXWORKS) && ACE_HAS_THREADS */
+#endif /* (ACE_WIN32 || VXWORKS || ACE_PSOS) && ACE_HAS_THREADS */
int
main (int argc, char *argv[])
@@ -547,7 +547,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting server at port %d\n",
server_addr.get_port_number ()));
-#if !defined (ACE_WIN32) && !defined (VXWORKS)
+#if !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_PSOS)
if (spawn_processes (&acceptor, &server_addr) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "(%P|%r) %p\n", "spawn_processes"), 1);
#elif defined (ACE_HAS_THREADS)
diff --git a/tests/Handle_Set_Test.cpp b/tests/Handle_Set_Test.cpp
index 87f22c169ce..bf92b5c9b3c 100644
--- a/tests/Handle_Set_Test.cpp
+++ b/tests/Handle_Set_Test.cpp
@@ -36,7 +36,7 @@ test_duplicates (size_t count)
for (size_t i = 0; i < count; i++)
{
- size_t handle = size_t (ACE_OS::rand () % ACE_Handle_Set::MAXSIZE);
+ size_t handle = ACE_static_cast(size_t, ACE_OS::rand () % ACE_Handle_Set::MAXSIZE);
if (ACE_ODD (handle))
{
diff --git a/tests/MM_Shared_Memory_Test.cpp b/tests/MM_Shared_Memory_Test.cpp
index a3ab253691c..5bf0d755e0c 100644
--- a/tests/MM_Shared_Memory_Test.cpp
+++ b/tests/MM_Shared_Memory_Test.cpp
@@ -75,7 +75,7 @@ server (void *)
static void
spawn (void)
{
-#if !defined (ACE_WIN32) && !defined (VXWORKS)
+#if !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_PSOS)
switch (ACE_OS::fork ())
{
case -1:
diff --git a/tests/Priority_Reactor_Test.cpp b/tests/Priority_Reactor_Test.cpp
index 40e79841469..1af6f149d0a 100644
--- a/tests/Priority_Reactor_Test.cpp
+++ b/tests/Priority_Reactor_Test.cpp
@@ -299,7 +299,7 @@ main (int argc, char *argv[])
THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n%a", "thread create failed"));
}
-#elif !defined (ACE_WIN32) && !defined (VXWORKS)
+#elif !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_PSOS)
for (i = 0; i < opt_nchildren; ++i)
{
switch (ACE_OS::fork ("child"))
@@ -340,7 +340,7 @@ main (int argc, char *argv[])
#if defined (ACE_HAS_THREADS)
ACE_Thread_Manager::instance ()->wait ();
-#elif !defined (ACE_WIN32) && !defined (VXWORKS)
+#elif !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_PSOS)
for (i = 0; i < opt_nchildren; ++i)
{
pid_t pid = ACE_OS::wait();
diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp
index 941bef2c410..2472ccf98c6 100644
--- a/tests/SOCK_Connector_Test.cpp
+++ b/tests/SOCK_Connector_Test.cpp
@@ -23,7 +23,7 @@
#include "ace/SOCK_Stream.h"
#include "test_config.h"
-#if !defined (ACE_WIN32) && !defined (VXWORKS)
+#if !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_PSOS)
#include <sys/utsname.h>
#endif /* !defined (ACE_WIN32) && !defined (VXWORKS) */
@@ -39,7 +39,7 @@ find_another_host (char other_host[])
ACE_OS::strcpy (other_host, ACE_DEFAULT_SERVER_HOST); // If all else fails
// These gethost-type things don't work everywhere.
-#if !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_NETBSD)
+#if !defined (ACE_WIN32) && !defined (VXWORKS) && !defined (ACE_NETBSD) && !defined (ACE_PSOS)
struct hostent *h;
struct utsname un;
@@ -95,6 +95,7 @@ fail_no_listener_nonblocking (void)
// On some systems, a failed connect to localhost will return
// ECONNREFUSED or ENETUNREACH directly, instead of
// EWOULDBLOCK. That is also fine.
+
if (errno == EWOULDBLOCK || errno == ECONNREFUSED || errno == ENETUNREACH)
{
if (sock.get_handle () != ACE_INVALID_HANDLE)