diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-08-12 19:46:36 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-08-12 19:46:36 +0000 |
commit | 43e29f98d3731193b14070a553b2c898fd539b9f (patch) | |
tree | 5e6f2b638380443bdf143e92ef03d0064518d611 /ACE/examples/ASX | |
parent | 7b25d9551a46ca7563fef0a1bd30ead65022e1ff (diff) | |
download | ATCD-43e29f98d3731193b14070a553b2c898fd539b9f.tar.gz |
ChangeLogTag: Tue Aug 12 19:45:16 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'ACE/examples/ASX')
10 files changed, 30 insertions, 15 deletions
diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp index 9c5a1f9ca6e..e7dadb5d68c 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp @@ -3,6 +3,7 @@ #include "ace/os_include/os_assert.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" +#include "ace/Truncate.h" #include "Consumer_Router.h" #include "Options.h" @@ -154,5 +155,5 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const else ACE_OS::strncpy (*strp, mod_name, length); - return ACE_OS::strlen (mod_name); + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); } diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp index eeb7060833f..a70961a9eaa 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ace/OS_NS_string.h" +#include "ace/Truncate.h" #include "Options.h" #include "Event_Analyzer.h" @@ -76,5 +77,6 @@ Event_Analyzer::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strncpy (*strp, mod_name, length); - return ACE_OS::strlen (mod_name); + + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); } diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp index cbca9cbe037..de00bba7346 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp @@ -3,6 +3,7 @@ #include "ace/os_include/os_assert.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" +#include "ace/Truncate.h" #include "Supplier_Router.h" #include "Options.h" @@ -161,5 +162,5 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const else ACE_OS::strncpy (*strp, mod_name, length); - return ACE_OS::strlen (mod_name); + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); } diff --git a/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp b/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp index d549d755916..a3b7abbf13a 100644 --- a/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp +++ b/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp @@ -6,6 +6,7 @@ #include "ace/Message_Queue.h" #include "ace/Thread_Manager.h" +#include "ace/Truncate.h" #include "ace/OS_NS_time.h" #include "ace/OS_NS_unistd.h" @@ -81,7 +82,7 @@ static void *consumer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) if (result == -1) break; - int length = mb->length (); + int length = ACE_Utils::truncate_cast<int> (mb->length ()); if (length > 0) ACE_OS::write (ACE_STDOUT, mb->rd_ptr (), length); diff --git a/ACE/examples/ASX/Message_Queue/buffer_stream.cpp b/ACE/examples/ASX/Message_Queue/buffer_stream.cpp index 12f2a0303a1..a9c528bf409 100644 --- a/ACE/examples/ASX/Message_Queue/buffer_stream.cpp +++ b/ACE/examples/ASX/Message_Queue/buffer_stream.cpp @@ -17,6 +17,7 @@ #include "ace/Stream.h" #include "ace/Module.h" #include "ace/Task.h" +#include "ace/Truncate.h" ACE_RCSID(Message_Queue, buffer_stream, "$Id$") @@ -203,7 +204,7 @@ Consumer::svc (void) if (result == -1) break; - int length = mb->length (); + int length = ACE_Utils::truncate_cast<int> (mb->length ()); if (length > 0) ACE_OS::write (ACE_STDOUT, diff --git a/ACE/examples/ASX/Message_Queue/priority_buffer.cpp b/ACE/examples/ASX/Message_Queue/priority_buffer.cpp index 517025919d2..a71e8653ab9 100644 --- a/ACE/examples/ASX/Message_Queue/priority_buffer.cpp +++ b/ACE/examples/ASX/Message_Queue/priority_buffer.cpp @@ -10,6 +10,7 @@ #include "ace/Read_Buffer.h" #include "ace/Thread_Manager.h" #include "ace/Service_Config.h" +#include "ace/Truncate.h" ACE_RCSID(Message_Queue, priority_buffer, "$Id$") @@ -40,7 +41,7 @@ consumer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) if (msg_queue->dequeue_head (mb) == -1) break; - int length = mb->length (); + int length = ACE_Utils::truncate_cast<int> (mb->length ()); if (length > 0) ACE_OS::puts (mb->rd_ptr ()); @@ -99,7 +100,7 @@ producer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) 0, buffer), 0); - mb->msg_priority (rb.size ()); + mb->msg_priority (ACE_Utils::truncate_cast<unsigned long> (rb.size ())); mb->wr_ptr (rb.size ()); ACE_DEBUG ((LM_DEBUG, diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp index b9c9c0cf2bd..5b1faec011a 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp @@ -2,6 +2,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" +#include "ace/Truncate.h" #include "Consumer_Router.h" #include "Options.h" @@ -132,7 +133,8 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strncpy (*strp, mod_name, length); - return ACE_OS::strlen (mod_name); + + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); } #endif /* ACE_HAS_THREADS */ diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Event_Analyzer.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Event_Analyzer.cpp index 689a9280766..915f9e79cce 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Event_Analyzer.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Event_Analyzer.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ace/OS_NS_string.h" +#include "ace/Truncate.h" #include "Event_Analyzer.h" ACE_RCSID(UPIPE_Event_Server, Event_Analyzer, "$Id$") @@ -67,7 +68,8 @@ Event_Analyzer::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strncpy (*strp, mod_name, length); - return ACE_OS::strlen (mod_name); + + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); } #endif /* ACE_HAS_THREADS */ diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp index 8b4a53d6331..823253d8c06 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp @@ -2,6 +2,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" +#include "ace/Truncate.h" #include "Options.h" #include "Supplier_Router.h" @@ -131,7 +132,8 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strncpy (*strp, mod_name, length); - return ACE_OS::strlen (mod_name); + + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); } #endif /* ACE_HAS_THREADS */ diff --git a/ACE/examples/ASX/UPIPE_Event_Server/event_server.cpp b/ACE/examples/ASX/UPIPE_Event_Server/event_server.cpp index 91ae382fac1..99c8e80fd81 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/event_server.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/event_server.cpp @@ -7,6 +7,7 @@ #include "ace/Service_Config.h" #include "ace/UPIPE_Acceptor.h" #include "ace/UPIPE_Connector.h" +#include "ace/Truncate.h" // FUZZ: disable check_for_streams_include #include "ace/streams.h" @@ -68,7 +69,7 @@ consumer (void *) ACE_UPIPE_Addr c_addr (ACE_TEXT ("/tmp/conupipe")); int verb = options.verbose (); - int msiz = options.message_size (); + int msiz = ACE_Utils::truncate_cast<int> (options.message_size ()); time_t secs, par1, par2; time_t currsec; @@ -133,9 +134,9 @@ supplier (void *dummy) ACE_UPIPE_Addr serv_addr (ACE_TEXT ("/tmp/supupipe")); ACE_UPIPE_Connector con; - int iter = options.iterations (); + int iter = ACE_Utils::truncate_cast<int> (options.iterations ()); int verb = options.verbose (); - int msiz = options.message_size (); + int msiz = ACE_Utils::truncate_cast<int> (options.message_size ()); cout << "supplier starting connect" << endl; if (con.connect (s_stream, serv_addr) == -1) @@ -230,13 +231,14 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Set the high and low water marks appropriately. - int wm = options.low_water_mark (); + int wm = ACE_Utils::truncate_cast<int> (options.low_water_mark ()); if (event_server.control (ACE_IO_Cntl_Msg::SET_LWM, &wm) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("push (setting low watermark)")), -1); - wm = options.high_water_mark (); + wm = ACE_Utils::truncate_cast<int> (options.high_water_mark ()); + if (event_server.control (ACE_IO_Cntl_Msg::SET_HWM, &wm) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("push (setting high watermark)")), -1); |