diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-12-11 00:25:35 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-12-11 00:25:35 +0000 |
commit | 7786679837dbf18f8f2f2292b1a4d69f2a4cc837 (patch) | |
tree | d252969bc911b62d8f9a8260738ce06cbdee5f61 | |
parent | cfee5d9d3f5c7510e909a91559668565566fa5cd (diff) | |
download | ATCD-7786679837dbf18f8f2f2292b1a4d69f2a4cc837.tar.gz |
foo
-rw-r--r-- | ChangeLog-96b | 19 | ||||
-rw-r--r-- | ace/Memory_Pool.cpp | 4 | ||||
-rw-r--r-- | ace/Memory_Pool.h | 4 | ||||
-rw-r--r-- | ace/OS.h | 16 | ||||
-rw-r--r-- | ace/OS.i | 2 | ||||
-rw-r--r-- | ace/Reactor.cpp | 8 | ||||
-rw-r--r-- | examples/Shared_Malloc/test_multiple_mallocs.cpp | 4 | ||||
-rw-r--r-- | performance-tests/Synch-Benchmarks/Options.cpp | 3 | ||||
-rw-r--r-- | performance-tests/Synch-Benchmarks/pipe_proc_test.cpp | 26 | ||||
-rw-r--r-- | performance-tests/Synch-Benchmarks/pipe_thr_test.cpp | 2 | ||||
-rw-r--r-- | tests/Process_Mutex_Test.cpp | 4 | ||||
-rw-r--r-- | tests/Reader_Writer_Test.cpp | 36 | ||||
-rw-r--r-- | tests/Thread_Manager_Test.cpp | 6 | ||||
-rw-r--r-- | tests/Thread_Pool_Test.cpp | 6 | ||||
-rw-r--r-- | tests/Tokens_Test.cpp | 2 |
15 files changed, 64 insertions, 78 deletions
diff --git a/ChangeLog-96b b/ChangeLog-96b index f89a4192626..eb35ac6fa87 100644 --- a/ChangeLog-96b +++ b/ChangeLog-96b @@ -1,5 +1,24 @@ Tue Dec 10 00:33:08 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * ace/OS.i (inet_aton): We need to cast -1 to (ACE_UINT32). + + * tests/Process_Mutex_Test.cpp (main): Added a minor change to + make gcc happy by moving the definition of int i *outside* the + loop. Thanks to Thilo Kielmann + <kielmann@informatik.uni-siegen.de> for reporting this. + + * ace/OS.h: gcc complains about memcmp, memcpy, strcmp, and strcpy + (from ACE_OS::) being used before defined inline. This is due + to the include of SString.h at the end of OS.h. So I reordered + things in accordance to the changes from Thilo Kielmann + <kielmann@informatik.uni-siegen.de>. + + * build/SunOS5.5/examples/Shared_Malloc/test_multiple_mallocs.cpp: + Changed the definition of char *base_addr to void *base_addr. + + * ace/Memory_Pool.cpp (ACE_MMAP_Memory_Pool_Options): Changed the + definition of char *base_addr to void *base_addr. + * Put out what is hopefully the final beta release of 4.0.33. * ace/Message_Queue: Added the enqueue() method again to maintain diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp index 45508fc8d21..b6de3c10c00 100644 --- a/ace/Memory_Pool.cpp +++ b/ace/Memory_Pool.cpp @@ -114,7 +114,7 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool (LPCTSTR backing_store_name, { if (options->use_fixed_addr_) { - this->base_addr_ = (void *) options->base_addr_; + this->base_addr_ = options->base_addr_; ACE_SET_BITS (flags_, MAP_FIXED); } this->write_each_page_ = options->write_each_page_; @@ -275,7 +275,7 @@ ACE_MMAP_Memory_Pool::remap (void *addr) return this->map_file (current_file_offset); } -ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options (char *base_addr, +ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options (void *base_addr, int use_fixed_addr, int write_each_page) : base_addr_ (base_addr), diff --git a/ace/Memory_Pool.h b/ace/Memory_Pool.h index 537afd220f7..f76a0fa7459 100644 --- a/ace/Memory_Pool.h +++ b/ace/Memory_Pool.h @@ -295,11 +295,11 @@ class ACE_Export ACE_MMAP_Memory_Pool_Options { public: // = Initialization method. - ACE_MMAP_Memory_Pool_Options (char *base_addr = ACE_DEFAULT_BASE_ADDR, + ACE_MMAP_Memory_Pool_Options (void *base_addr = ACE_DEFAULT_BASE_ADDR, int use_fixed_addr = 1, int write_each_page = 1); - char *base_addr_; + void *base_addr_; // Base address of the memory-mapped backing store. int use_fixed_addr_; @@ -2399,6 +2399,14 @@ private: if (POINTER == 0) { errno = ENOMEM; return; } \ } while (0) +#if defined (ACE_HAS_INLINED_OSCALLS) +#if defined (ACE_INLINE) +#undef ACE_INLINE +#endif /* ACE_INLINE */ +#define ACE_INLINE inline +#include "ace/OS.i" +#endif /* ACE_HAS_INLINED_OSCALLS */ + #include "ace/SString.h" #if defined (UNICODE) @@ -2408,12 +2416,4 @@ ACE_WString (ASCII).fast_rep () #define ACE_WIDE_STRING(ASCII) ASCII #endif /* UNICODE */ -#if defined (ACE_HAS_INLINED_OSCALLS) -#if defined (ACE_INLINE) -#undef ACE_INLINE -#endif /* ACE_INLINE */ -#define ACE_INLINE inline -#include "ace/OS.i" -#endif /* ACE_HAS_INLINED_OSCALLS */ - #endif /* ACE_OS_H */ @@ -2589,7 +2589,7 @@ ACE_INLINE int ACE_OS::inet_aton (const char *host_name, struct in_addr *addr) { long ip_addr = ACE_OS::inet_addr (host_name); - if (ip_addr == htonl (-1) + if (ip_addr == htonl ((ACE_UINT32) -1) // Broadcast addresses are weird... && ACE_OS::strcmp (host_name, "255.255.255.255") != 0) return 0; diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp index 90c31d832e0..affb3423b21 100644 --- a/ace/Reactor.cpp +++ b/ace/Reactor.cpp @@ -878,9 +878,9 @@ ACE_Reactor::ACE_Reactor (ACE_Sig_Handler *sh, : timer_queue_ (0), delete_timer_queue_ (0), requeue_position_ (-1), // Requeue at end of waiters by default. - initialized_ (0), + initialized_ (0) #if defined (ACE_MT_SAFE) - token_ (*this) + , token_ (*this) #endif /* ACE_MT_SAFE */ { ACE_TRACE ("ACE_Reactor::ACE_Reactor"); @@ -897,9 +897,9 @@ ACE_Reactor::ACE_Reactor (size_t size, : timer_queue_ (0), delete_timer_queue_ (0), requeue_position_ (-1), // Requeue at end of waiters by default. - initialized_ (0), + initialized_ (0) #if defined (ACE_MT_SAFE) - token_ (*this) + , token_ (*this) #endif /* ACE_MT_SAFE */ { ACE_TRACE ("ACE_Reactor::ACE_Reactor"); diff --git a/examples/Shared_Malloc/test_multiple_mallocs.cpp b/examples/Shared_Malloc/test_multiple_mallocs.cpp index ebedd12ae49..e4d769a93e6 100644 --- a/examples/Shared_Malloc/test_multiple_mallocs.cpp +++ b/examples/Shared_Malloc/test_multiple_mallocs.cpp @@ -11,12 +11,12 @@ typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC; // Default address for shared memory mapped files and SYSV shared // memory (defaults to 64 M). -const char *REQUEST_BASE_ADDR = ((char *) (64 * 1024 * 1024)); +void *REQUEST_BASE_ADDR = ((void *) (64 * 1024 * 1024)); const char *REQUEST_STRING = "hello from request repository"; // Default address for shared memory mapped files and SYSV shared // memory (defaults to 64 M). -const char *RESPONSE_BASE_ADDR = ((char *) (128 * 1024 * 1024)); +void *RESPONSE_BASE_ADDR = ((void *) (128 * 1024 * 1024)); const char *RESPONSE_STRING = "hello from response repository"; int diff --git a/performance-tests/Synch-Benchmarks/Options.cpp b/performance-tests/Synch-Benchmarks/Options.cpp index a2ac88454c7..9a1afc55e0f 100644 --- a/performance-tests/Synch-Benchmarks/Options.cpp +++ b/performance-tests/Synch-Benchmarks/Options.cpp @@ -1,7 +1,6 @@ #include "Options.h" // $Id$ - #if defined (ACE_HAS_THREADS) // Manages the options. Options options; @@ -11,7 +10,7 @@ Options::count (void) { size_t total = 0; - for (size_t i = 0; i < options.thr_wc_size; i++) + for (int i = 0; i < options.thr_wc_size; i++) { if (options.thr_work_count[i] != 0) { diff --git a/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp b/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp index 45d8df5af58..7d9c74d190d 100644 --- a/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp +++ b/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp @@ -15,9 +15,9 @@ public: virtual int svc (void); private: - int pipe_fds[2]; + int pipe_handles[2]; - void reader (int fd); + void reader (ACE_HANDLE handle); }; int @@ -25,7 +25,7 @@ Pipe_Proc_Test::init (int, char **) { synch_count = 1; - if (ACE_OS::pipe (this->pipe_fds) == -1) + if (ACE_OS::pipe (this->pipe_handles) == -1) ACE_OS::perror ("pipe"), ACE_OS::exit (1); switch (ACE_OS::fork ()) @@ -33,7 +33,7 @@ Pipe_Proc_Test::init (int, char **) case -1: ACE_OS::perror ("fork"), ACE_OS::exit (1); case 0: - this->reader (pipe_fds[0]); + this->reader (pipe_handles[0]); /* NOTREACHED */ break; default: @@ -43,14 +43,14 @@ Pipe_Proc_Test::init (int, char **) } void -Pipe_Proc_Test::reader (int fd) +Pipe_Proc_Test::reader (ACE_HANDLE handle) { int ni = this->thr_id (); int length = options.msg_size (); char *to = new char[length]; int n; - while ((n = ACE_OS::read (fd, to, length)) > 0) + while ((n = ACE_OS::read (handle, to, length)) > 0) options.thr_work_count[ni]++; } @@ -58,19 +58,19 @@ Pipe_Proc_Test::reader (int fd) int Pipe_Proc_Test::svc (void) { - size_t length = options.msg_size (); - char *from = new char[length]; - int ni = this->thr_id (); - int fd = this->pipe_fds[1]; + ssize_t length = options.msg_size (); + char *from = new char[length]; + int ni = this->thr_id (); + ACE_HANDLE handle = this->pipe_handles[1]; while (!this->done ()) - if (ACE_OS::write (fd, from, length) == length) + if (ACE_OS::write (handle, from, length) == length) options.thr_work_count[ni]++; else ACE_OS::perror ("write"); - ACE_OS::close (this->pipe_fds[0]); - ACE_OS::close (this->pipe_fds[1]); + ACE_OS::close (this->pipe_handles[0]); + ACE_OS::close (this->pipe_handles[1]); return 0; } diff --git a/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp b/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp index 5bcc0712643..c0a693fdc5a 100644 --- a/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp +++ b/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp @@ -57,7 +57,7 @@ Pipe_Thr_Test::init (int, char **) int Pipe_Thr_Test::svc (void) { - size_t length = options.msg_size (); + ssize_t length = options.msg_size (); ACE_HANDLE handle = this->pipe_handles[1]; char *from; ACE_NEW_RETURN (from, char[length], -1); diff --git a/tests/Process_Mutex_Test.cpp b/tests/Process_Mutex_Test.cpp index cfbec7bf50d..3739420c497 100644 --- a/tests/Process_Mutex_Test.cpp +++ b/tests/Process_Mutex_Test.cpp @@ -110,7 +110,9 @@ main (int argc, char *argv[]) // Spawn ACE_MAX_ITERATIONS processes which will contend for the lock ACE_Process servers[ACE_MAX_ITERATIONS]; - for (int i = 0; i < ACE_MAX_ITERATIONS; i++) + int i; + + for (i = 0; i < ACE_MAX_ITERATIONS; i++) { ACE_ASSERT (servers[i].start (s_argv) != -1); diff --git a/tests/Reader_Writer_Test.cpp b/tests/Reader_Writer_Test.cpp index 3b4dfbead1d..ce3797e2fd6 100644 --- a/tests/Reader_Writer_Test.cpp +++ b/tests/Reader_Writer_Test.cpp @@ -1,6 +1,6 @@ -// ============================================================================ // $Id$ +// ============================================================================ // // = LIBRARY // tests @@ -40,7 +40,7 @@ static size_t n_readers = 6; static size_t n_writers = 4; // Thread id of last writer. -volatile static int shared_data; +static volatile int shared_data; // Lock for shared_data. static ACE_RW_Mutex rw_mutex; @@ -57,36 +57,6 @@ print_usage_and_die (void) ACE_OS::exit (1); } -// Parse the command-line arguments and set options. - -static void -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opt (argc, argv, "r:w:n:l:"); - - int c; - - while ((c = get_opt ()) != -1) - switch (c) - { - case 'r': - n_readers = ACE_OS::atoi (get_opt.optarg); - break; - case 'w': - n_writers = ACE_OS::atoi (get_opt.optarg); - break; - case 'n': - n_iterations = ACE_OS::atoi (get_opt.optarg); - break; - case 'l': - n_loops = ACE_OS::atoi (get_opt.optarg); - break; - default: - print_usage_and_die (); - break; - } -} - // Iterate <n_iterations> each time checking that nobody modifies the data // while we have a read lock. @@ -176,7 +146,7 @@ template class ACE_Atomic_Op<ACE_Thread_Mutex, int>; // Spawn off threads. -int main (int, char *argv[]) +int main (int, char *[]) { ACE_START_TEST ("Reader_Writer_Test"); diff --git a/tests/Thread_Manager_Test.cpp b/tests/Thread_Manager_Test.cpp index b20e2cd5b6e..b40c4cc2973 100644 --- a/tests/Thread_Manager_Test.cpp +++ b/tests/Thread_Manager_Test.cpp @@ -62,7 +62,7 @@ static const int DEFAULT_ITERATIONS = 100000; #endif /* ACE_HAS_THREADS */ int -main (int argc, char *argv[]) +main (int, char *[]) { ACE_START_TEST ("Thread_Manager_Test"); @@ -72,8 +72,8 @@ main (int argc, char *argv[]) // Register a signal handler. ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT); - int n_threads = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_THREADS; - int n_iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_ITERATIONS; + int n_threads = DEFAULT_THREADS; + int n_iterations = DEFAULT_ITERATIONS; ACE_Thread_Manager *thr_mgr = ACE_Service_Config::thr_mgr (); diff --git a/tests/Thread_Pool_Test.cpp b/tests/Thread_Pool_Test.cpp index 8d7c654c4a3..cb7d9069b9a 100644 --- a/tests/Thread_Pool_Test.cpp +++ b/tests/Thread_Pool_Test.cpp @@ -85,7 +85,6 @@ Thread_Pool::svc (void) // Note that the ACE_Task::svc_run () method automatically adds us to // the Thread_Manager when the thread begins. - int result = 0; int count = 1; // Keep looping, reading a message out of the queue, until we get a @@ -190,14 +189,13 @@ produce (Thread_Pool &thread_pool) #endif /* ACE_HAS_THREADS */ int -main (int argc, char *[]) +main (int, char *[]) { ACE_START_TEST ("Thread_Pool_Test"); #if defined (ACE_HAS_THREADS) int n_threads = ACE_MAX_THREADS; - ACE_DEBUG ((LM_DEBUG, "(%t) argc = %d, threads = %d\n", - argc, n_threads)); + ACE_DEBUG ((LM_DEBUG, "(%t) threads = %d\n", n_threads)); // Create the worker tasks. Thread_Pool thread_pool (ACE_Service_Config::thr_mgr (), diff --git a/tests/Tokens_Test.cpp b/tests/Tokens_Test.cpp index 5e22c657c1f..6e40ddf498f 100644 --- a/tests/Tokens_Test.cpp +++ b/tests/Tokens_Test.cpp @@ -58,8 +58,6 @@ run_thread (void *vp) ACE_Thread_Control tc (ACE_Service_Config::thr_mgr ()); ACE_NEW_THREAD; Test_Params *tp = (Test_Params *) vp; - const char *name1 = tp->token1_->name (); - const char *name2 = tp->token2_->name (); ACE_Token_Collection collection (1, tp->collection_name_); collection.insert (*(tp->token1_)); collection.insert (*(tp->token2_)); |