summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-10 18:58:26 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-10 18:58:26 +0000
commit3c84e3836b3abfab542a7be40203dfdb2b6a1b8d (patch)
treebb9f565d02cf35dba707c8976e89ba97749e5b0c
parentc6f8c1fb06c57e454694764a7005c68ce47b3a65 (diff)
downloadATCD-3c84e3836b3abfab542a7be40203dfdb2b6a1b8d.tar.gz
Hi David ;-)
-rw-r--r--ChangeLog-96b86
-rw-r--r--README126
-rw-r--r--ace/Malloc.h2
-rw-r--r--ace/Pipe.h4
-rw-r--r--ace/Pipe.i4
-rw-r--r--ace/Synch.i2
-rw-r--r--ace/Thread_Manager.i2
-rw-r--r--ace/config-win32-msvc4.0.h2
-rw-r--r--examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp5
-rw-r--r--examples/Reactor/Misc/Makefile3
-rw-r--r--examples/Reactor/Misc/pingpong.cpp6
-rw-r--r--examples/Reactor/Misc/signal_tester.cpp4
-rw-r--r--examples/Reactor/Misc/test_timer_queue.cpp5
-rw-r--r--examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i11
-rw-r--r--examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i58
-rw-r--r--examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i2
-rw-r--r--examples/Service_Configurator/Misc/Timer_Service.cpp10
-rw-r--r--examples/Shared_Malloc/test_persistence.cpp2
-rw-r--r--netsvcs/lib/Server_Logging_Handler.cpp11
-rw-r--r--netsvcs/lib/TS_Server_Handler.cpp2
-rw-r--r--tests/CPP_Test.cpp4
-rw-r--r--tests/Mem_Map_Test.cpp2
-rw-r--r--tests/SPIPE_Test.cpp4
-rw-r--r--tests/Shared_Memory_MM_Test.cpp13
-rw-r--r--tests/TSS_Test.cpp8
-rw-r--r--tests/Time_Service_Test.cpp2
-rw-r--r--tests/Timer_Queue_Test.cpp5
-rw-r--r--tests/test_config.h1
28 files changed, 275 insertions, 111 deletions
diff --git a/ChangeLog-96b b/ChangeLog-96b
index 47f64065ee0..976eb4cddf8 100644
--- a/ChangeLog-96b
+++ b/ChangeLog-96b
@@ -1,3 +1,66 @@
+<<<<<<< ChangeLog-96b
+Sat Nov 9 11:23:13 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Synch.i: Fixed a bug in ACE_Thread_Mutex_Guard.
+ The call:
+
+ this->owner_ == block ? this->lock_.acquire () : this->lock_.tryacquire ();
+
+ should be
+
+ this->owner_ = block ? this->lock_.acquire () : this->lock_.tryacquire ();
+
+ Thanks to Alexander Smundak <sasha@migration.com> for reporting
+ this.
+
+Fri Nov 8 20:04:26 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Malloc.h: Fixed a typo on line 176 that reads:
+
+ #include "ace/Sync_T.h"
+
+ It should read:
+
+ #include "ace/Synch_T.h"
+
+ Thanks to Todd Barkalow <todd_barkalow@stortek.com> for
+ reporting this.
+
+Wed Nov 6 00:38:02 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Pipe: Added the const qualifier to the following methods:
+
+ ACE_HANDLE ACE_Pipe::read_handle (void) const;
+ ACE_HANDLE ACE_Pipe::write_handle (void) const;
+
+ Thanks to Luca for reporting this.
+
+ * ace/config-win32-msvc4.0.h: Redefined
+ ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES since it looks like
+ MSVC++ 4.0 still doesn't work. Maybe this is fixed in 4.2?
+
+Tue Nov 5 03:09:44 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Strategies.cpp: I'd forgotten to update one of the
+ accept(*svc_handler) calls to use the new
+ accept(svc_handler->peer()) syntax.
+
+ * netsvcs/lib/Server_Logging_Handler.cpp: Added a cast to
+ (COUNTER) 0 when initializing ::request_count_ to avoid problems
+ on Win32. Thanks to Luca for pointing this out.
+
+ * ace/Thread_Manager: Added a new thr_self() method that return
+ the unique ID of the thread. This is not strictly necessary
+ (because a thread can always just call <ACE_Thread::thr_self>).
+ However, we put it here to be complete. Thanks to Hamutal Yanay
+ <Hamutal_Yanay@mail.icomverse.com> for suggesting this.
+
+ * ace/OS.cpp (thr_create): I was accidentally closing down
+ ::CloseHandle (thr_handle) (where thr_handle is a HANDLE *) when
+ I should have been doing a ::CloseHandle (handle) instead.
+ Thanks to Luca for finding this!
+
+=======
Sat Nov 9 01:44:15 1996 Irfan Pyarali <irfan@flamenco.cs.wustl.edu>
* ace/Message_Queue: Added forward and reverse iterators to
@@ -34,8 +97,31 @@ Fri Nov 1 03:53:39 1996 Irfan Pyarali <irfan@flamenco.cs.wustl.edu>
available implementation of STL from HP. Currently,
ACE_Registry uses these STL classes.
+>>>>>>> 4.14
Fri Nov 1 00:25:01 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+ * ace/CORBA_Handler.cpp (process_events): There was a very subtle
+ race condition in the ACE_MT_CORBA_Handler. process_events()
+ accessed the singleton directly without taking the mutex. At
+ startup the process_event thread is kicked off from the
+ constructor and the instance_ is set. Hence the race. The
+ solution is to attempt to take the mutex before accessing the
+ instance. Thanks to David Artus <david.artus@sbil.co.uk> for
+ reporting the problem and providing the fix.
+
+ * ace/Log_Msg.cpp (log): Improved the performance of the Log_Msg
+ mechanism by not doing any parsing of the format string if the
+ user has disabled this priority.
+
+ * ace/Reactor.cpp: Added a chance for the open() method of the
+ Notification_Pipe failing. Thanks to Luca for pointing this
+ out.
+
+ * ace/Reactor.cpp (handle_events): Added a change to the semantics
+ of the ACE_Reactor so that it doesn't fall out of the event loop
+ when signals arrive that it handles. Thanks to Stuart Powell
+ <stuartp@in.ot.com.au> for this fix.
+
* ace/Service_Repository.cpp (remove): Fixed a bug with
Service_Record::remove() that was failing if there were only two
records and we are removing the first one. Thanks to Alex
diff --git a/README b/README
index dc2336f045f..95a6c8db734 100644
--- a/README
+++ b/README
@@ -9,71 +9,118 @@ THE ADAPTIVE COMMUNICATION ENVIRONMENT (ACE)
An Object-Oriented Network Programming Toolkit
-OVERVIEW OF ACE
-
-The ADAPTIVE Communication Environment (ACE) is a freely available
-object-oriented network programming toolkit targeted for developers of
-high-performance concurrent network applications and services. ACE
-encapsulates the following user-level UNIX and Win32 (Windows NT and
-Windows '95) OS facilities via portable, type-secure, C++ interfaces:
+Overview of ACE
+
+The ADAPTIVE Communication Environment (ACE) is an object-oriented
+toolkit that implements strategic and tactical design patterns to
+simplify the development of concurrent, event-driven communication
+software. ACE provides a rich set of reusable C++ wrappers, class
+categories, and frameworks that perform common communication software
+tasks across a range of operating system platforms. The communication
+software tasks provided by ACE include event demultiplexing and event
+handler dispatching, connection establishment, interprocess
+communication, shared memory management, message routing, dynamic
+(re)configuration of distributed services, multi-threading, and
+concurrency control.
+
+ACE is targeted for developers of high-performance concurrent network
+applications and services. The primary goal of ACE is to simplify the
+development of concurrent OO communication software that utilizes
+interprocess communication, event demultiplexing, explicit dynamic
+linking, and concurrency. In addition, ACE automates communication
+software configuration and reconfiguration by dynamically linking
+services into applications at run-time and executing these services on
+one or more processes or threads.
+
+ACE has been ported to a wide range of uni-processor and multi-process
+OS platforms including Win32 (i.e., WinNT and Win95), most versions of
+UNIX (e.g., SunOS 4.x and 5.x, SGI IRIX, HP-UX, OSF/1, AIX, Linux, and
+SCO), VxWorks, and MVS OpenEdition. It is currently used in
+commercial products by dozens of companies including Ericsson,
+Bellcore, Siemens, Motorola, and Kodak.
+
+The remainder of this document outlines the structure and participants
+of the layers in this diagram.
+
+C++ Wrappers for OS Interfaces
+
+The lower-level portions of ACE provide a set of portable and
+type-secure C++ wrappers that encapsulate the following C language OS
+interfaces:
. IPC mechanisms
- -- Internet- and UNIX-domain sockets, TLI, Named Pipes
- (for UNIX and Win32) and STREAM pipes
+ -- e.g., Internet- and UNIX-domain sockets, TLI, Named
+ Pipes (for UNIX and Win32) and STREAM pipes;
- . Event multiplexing
- -- select(), poll(), and Win32 WaitForMultipleObjects
- and I/O completion ports
+ . Event demultiplexing
+ -- e.g., select(), poll(), and Win32
+ WaitForMultipleObjects and I/O completion ports;
. Multi-threading and synchronization
- -- Solaris threads, POSIX Pthreads, and Win32 threads
+ -- e.g., Solaris threads, POSIX Pthreads, and Win32
+ threads;
. Explicit dynamic linking
- -- dlopen/dlsym on UNIX and LoadLibrary/GetProc on Win32
+ -- e.g., dlopen/dlsym on UNIX and LoadLibrary/GetProc
+ on Win32;
. Memory-mapped files and shared memory management
- -- BSD mmap(), SYSV shared memory, and Win32 shared memory.
+ -- e.g., BSD mmap(), SYSV shared memory, and Win32
+ shared memory;
. System V IPC
- -- shared memory, semaphores, message queues
+ -- e.g., shared memory, semaphores, message queues.
+
+The OS Adaptation Layer shields the upper levels of ACE from platform
+dependencies associated with the underlying OS interfaces.
- . Sun RPC
- -- GNU rpc++, written by Michael Lipp
+Frameworks and Class Categories
-In addition, ACE contains a higher-level network programming framework
-that integrates and enhances the lower-level C++ wrappers. This
-framework supports the dynamic configuration of concurrent network
-daemons composed of application services. This framework contains the
+ACE also contains a higher-level network programming framework that
+integrates and enhances the lower-level C++ wrappers. This framework
+supports the dynamic configuration of concurrent distributed services
+into applications. The framework portion of ACE contains the
following class categories:
. The Reactor
- -- Supports both Reactive and Proactive I/O
+ -- Supports both Reactive and Proactive I/O;
. The Service Configurator
- -- Support dynamic configuration of objects
+ -- Support dynamic (re)configuration of objects;
. The ADAPTIVE Service Executive
-- A user-level implementation of System V STREAMS,
- which supports modular integration of
- hierarchically-related communicaion services.
-
- . Shared malloc
- -- A component for managing dynamically allocation
- shared and local memory
+ that supports modular integration of
+ hierarchically-related communicaion services;
- . Concurrency services
- -- e.g., various forms of higher-level concurrency control
- and synchronization mechanisms
+ . Concurrency
+ -- Various types of higher-level concurrency
+ control and synchronization patterns (such as
+ Polymorphic Futures and Active Objects);
- . Network services
- -- e.g., distributed lock service, distributed naming
- service, distributed logging service, distributed
- routing service, and distributed time service
+ . Shared Malloc
+ -- Components for managing dynamically allocation
+ of shared and local memory;
. CORBA integration
-- Integrates ACE with CORBA implementations
- (such as single-threaded and multi-threaded Orbix)
+ (such as single-threaded and multi-threaded
+ Orbix and Visibroker for C++).
+
+Distributed Services and Components
+
+Finally, ACE provides a standard library of distributed services that
+are packaged as components. These service components play two roles
+in ACE:
+
+ 1. They provide reusable components for common distributed
+ system tasks such as logging, naming, locking, and time
+ synchronization.
+ 2. They illustrate how to utilize ACE features such as the
+ Reactor, Service Configurator, Service Initialization,
+ Concurrency, and IPC components.
+
ACE is currently being used in many commercial products including the
Bellcore Q.port ATM signaling software product, the Ericsson EOS
family of telecom switch monitoring applications, the Motorola Iridium
@@ -605,6 +652,9 @@ Ari Erev <Ari_Erev@comverse.com>
Hamutal Yanay <Hamutal_Yanay@hub.comverse.com>
Vital Aza <va3@cs.wustl.edu>
Alex Villazon <villazon@cui.unige.ch>
+David Artus <david.artus@sbil.co.uk>
+Todd Barkalow <todd_barkalow@stortek.com>
+Alexander Smundak <sasha@migration.com>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson and is now at ObjectSpace. Paul devised the recursive
diff --git a/ace/Malloc.h b/ace/Malloc.h
index d5c73e99bba..0036b4ee7cb 100644
--- a/ace/Malloc.h
+++ b/ace/Malloc.h
@@ -175,7 +175,7 @@ public:
};
#if defined (ACE_MALLOC_STATS)
-#include "ace/Sync_T.h"
+#include "ace/Synch_T.h"
#if defined (ACE_HAS_THREADS)
#define ACE_PROCESS_MUTEX ACE_Process_Mutex
#else
diff --git a/ace/Pipe.h b/ace/Pipe.h
index 485e1133f87..ae42112d542 100644
--- a/ace/Pipe.h
+++ b/ace/Pipe.h
@@ -51,12 +51,12 @@ public:
// = Accessors.
- ACE_HANDLE read_handle (void);
+ ACE_HANDLE read_handle (void) const;
// This is the "read" side of the pipe. Note, however, that
// processes can also write to this handle as well since pipes are
// bi-directional.
- ACE_HANDLE write_handle (void);
+ ACE_HANDLE write_handle (void) const;
// This is the "write" side of the pipe. Note, however, that
// processes can also read to this handle as well since pipes are
// bi-directional.
diff --git a/ace/Pipe.i b/ace/Pipe.i
index 3808263eb18..fd748ada175 100644
--- a/ace/Pipe.i
+++ b/ace/Pipe.i
@@ -4,14 +4,14 @@
// Pipe.i
inline ACE_HANDLE
-ACE_Pipe::read_handle (void)
+ACE_Pipe::read_handle (void) const
{
ACE_TRACE ("ACE_Pipe::read_handle");
return this->handles_[0];
}
inline ACE_HANDLE
-ACE_Pipe::write_handle (void)
+ACE_Pipe::write_handle (void) const
{
ACE_TRACE ("ACE_Pipe::write_handle");
return this->handles_[1];
diff --git a/ace/Synch.i b/ace/Synch.i
index 02544228354..461fbbe32b2 100644
--- a/ace/Synch.i
+++ b/ace/Synch.i
@@ -245,7 +245,7 @@ ACE_Thread_Mutex_Guard::ACE_Thread_Mutex_Guard (ACE_Thread_Mutex &m,
: lock_ (m)
{
// ACE_TRACE ("ACE_Thread_Mutex_Guard::ACE_Thread_Mutex_Guard");
- this->owner_ == block ? this->lock_.acquire () : this->lock_.tryacquire ();
+ this->owner_ = block ? this->lock_.acquire () : this->lock_.tryacquire ();
}
// Implicitly release the lock.
diff --git a/ace/Thread_Manager.i b/ace/Thread_Manager.i
index 1aa9341a0e0..a2cbc04b53c 100644
--- a/ace/Thread_Manager.i
+++ b/ace/Thread_Manager.i
@@ -80,7 +80,7 @@ ACE_Thread_Control::thr_mgr (ACE_Thread_Manager *tm)
// Return the unique ID of the thread.
-ACE_INLINE ACE_hthread_t
+ACE_INLINE ACE_thread_t
ACE_Thread_Manager::thr_self (void)
{
ACE_TRACE ("ACE_Thread_Manager::thr_self");
diff --git a/ace/config-win32-msvc4.0.h b/ace/config-win32-msvc4.0.h
index fb529512dc5..eb617af26a8 100644
--- a/ace/config-win32-msvc4.0.h
+++ b/ace/config-win32-msvc4.0.h
@@ -68,7 +68,7 @@
//define ACE_HAS_AUTOMATIC_INIT_FINI
// Compiler doesn't support static data member templates.
-// #define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
+#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
// Version 1.1 of WinSock
#define ACE_WSOCK_VERSION 1, 1
diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp
index d4ffacd1171..6ad9575cdee 100644
--- a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp
+++ b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp
@@ -20,9 +20,10 @@ main (int, char *[])
if (msg.len == 0)
break;
else
- ACE_DEBUG (("%4d (%4d): %*s", msg.len, band, msg.len, msg.buf));
+ ACE_DEBUG ((LM_DEBUG, "%4d (%4d): %*s",
+ msg.len, band, msg.len, msg.buf));
flags = MSG_ANY;
- band = 0;
+ band = 0;
}
if (n == -1)
diff --git a/examples/Reactor/Misc/Makefile b/examples/Reactor/Misc/Makefile
index 31d49795de7..581e4b89505 100644
--- a/examples/Reactor/Misc/Makefile
+++ b/examples/Reactor/Misc/Makefile
@@ -14,7 +14,8 @@ BIN = pingpong \
test_event_handler_t \
test_handle_set \
test_reactors \
- test_signals \
+ test_signals_1 \
+ test_signals_2 \
test_time_value \
test_timer_queue
diff --git a/examples/Reactor/Misc/pingpong.cpp b/examples/Reactor/Misc/pingpong.cpp
index 27c0784e160..42c7012c4c9 100644
--- a/examples/Reactor/Misc/pingpong.cpp
+++ b/examples/Reactor/Misc/pingpong.cpp
@@ -64,9 +64,9 @@ private:
};
Ping_Pong::Ping_Pong (char b[], ACE_HANDLE f)
- : handle_ (f),
- buflen_ (ACE_OS::strlen (b) + 1 + (2 * sizeof (int))),
- pid_ (ACE_OS::getpid ())
+ : buflen_ (ACE_OS::strlen (b) + 1 + (2 * sizeof (int))),
+ pid_ (ACE_OS::getpid ()),
+ handle_ (f)
{
*((int *) this->buf_) = (int) this->pid_;
*((int *) (this->buf_ + sizeof (int))) = 0;
diff --git a/examples/Reactor/Misc/signal_tester.cpp b/examples/Reactor/Misc/signal_tester.cpp
index b5c14e4d641..a210b3241f8 100644
--- a/examples/Reactor/Misc/signal_tester.cpp
+++ b/examples/Reactor/Misc/signal_tester.cpp
@@ -157,8 +157,8 @@ STDIN_Handler::STDIN_Handler (void)
}
int
-STDIN_Handler::handle_timeout (const ACE_Time_Value &tv,
- const void *arg)
+STDIN_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void *)
{
ACE_DEBUG ((LM_DEBUG, "timeout occurred at %d sec, %d usec\n",
tv.sec (), tv.usec ()));
diff --git a/examples/Reactor/Misc/test_timer_queue.cpp b/examples/Reactor/Misc/test_timer_queue.cpp
index 88d7c32b79a..7256bfb54c5 100644
--- a/examples/Reactor/Misc/test_timer_queue.cpp
+++ b/examples/Reactor/Misc/test_timer_queue.cpp
@@ -10,9 +10,10 @@ public:
: count_ (0)
{}
- virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg)
+ virtual int handle_timeout (const ACE_Time_Value &, const void *arg)
{
- ACE_DEBUG ((LM_DEBUG, "yow, the time has come and gone %d times %d, Horatio!\n",
+ ACE_DEBUG ((LM_DEBUG,
+ "yow, the time has come and gone %d times %d, Horatio!\n",
this->count_++, int (arg)));
return 0;
}
diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i b/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i
index cec9f308c7b..8b631a6f252 100644
--- a/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i
+++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i
@@ -94,8 +94,15 @@ Handle_L_CODgram::handle_input (ACE_HANDLE)
ACE_OS::puts ("----------------------------------------");
- for (ssize_t n; n = ACE_OS::read (handle, buf, sizeof buf); )
- ACE_OS::write (ACE_STDOUT, buf, n);
+ for (;;)
+ {
+ ssize_t n = ACE_OS::read (handle, buf, sizeof buf);
+
+ if (n <= 0)
+ break;
+
+ ACE_OS::write (ACE_STDOUT, buf, n);
+ }
ACE_OS::puts ("----------------------------------------");
diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i b/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i
index e426697033d..60dbe34fb47 100644
--- a/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i
+++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
#include "ace/Get_Opt.h"
ACE_INLINE
@@ -17,7 +16,8 @@ Handle_L_Stream::Handle_L_Stream (void)
}
ACE_INLINE int
-Handle_L_Stream::open (const ACE_UNIX_Addr &suas, int async)
+Handle_L_Stream::open (const ACE_UNIX_Addr &suas,
+ int async)
{
if (this->ACE_LSOCK_Acceptor::open (suas) == -1)
return -1;
@@ -28,9 +28,10 @@ Handle_L_Stream::open (const ACE_UNIX_Addr &suas, int async)
}
ACE_INLINE int
-Handle_L_Stream::info (char **strp, size_t length) const
+Handle_L_Stream::info (char **strp,
+ size_t length) const
{
- char buf[BUFSIZ];
+ char buf[BUFSIZ];
ACE_UNIX_Addr sa;
if (this->get_local_addr (sa) == -1)
@@ -49,9 +50,9 @@ Handle_L_Stream::info (char **strp, size_t length) const
ACE_INLINE int
Handle_L_Stream::init (int argc, char *argv[])
{
- ACE_UNIX_Addr sus;
+ ACE_UNIX_Addr sus;
const char *r = Handle_L_Stream::DEFAULT_RENDEZVOUS;
- ACE_Get_Opt get_opt (argc, argv, "r:", 0);
+ ACE_Get_Opt get_opt (argc, argv, "r:", 0);
for (int c; (c = get_opt ()) != -1; )
switch (c)
@@ -66,18 +67,21 @@ Handle_L_Stream::init (int argc, char *argv[])
ACE_OS::strncpy (this->rendezvous, r, MAXPATHLEN);
ACE_OS::unlink (this->rendezvous);
sus.set (this->rendezvous);
+
if (this->open (sus) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
- else if (ACE_Service_Config::reactor ()->register_handler (this,
- ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "registering service with ACE_Reactor\n"), -1);
+ else if (ACE_Service_Config::reactor ()->register_handler
+ (this, ACE_Event_Handler::READ_MASK) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "registering service with ACE_Reactor\n"), -1);
return 0;
}
ACE_INLINE int
Handle_L_Stream::fini (void)
{
- return ACE_Service_Config::reactor ()->remove_handler (this, ACE_Event_Handler::READ_MASK);
+ return ACE_Service_Config::reactor ()->remove_handler
+ (this, ACE_Event_Handler::READ_MASK);
}
ACE_INLINE ACE_HANDLE
@@ -91,39 +95,47 @@ Handle_L_Stream::handle_input (ACE_HANDLE)
{
ACE_LSOCK_Stream new_local_stream;
ACE_UNIX_Addr sa;
- int fd = ACE_INVALID_HANDLE;
+ ACE_HANDLE handle = ACE_INVALID_HANDLE;
char buf[BUFSIZ];
if (this->accept (new_local_stream, &sa) == -1)
return -1;
-
- if (new_local_stream.recv_handle (fd) == -1)
+ else if (new_local_stream.recv_handle (handle) == -1)
return -1;
else
ACE_DEBUG ((LM_INFO,
"received file descriptor %d on ACE_Stream %s\n",
- fd, sa.get_path_name ()));
+ handle, sa.get_path_name ()));
ACE_OS::puts ("----------------------------------------");
- for (ssize_t n; n = ACE_OS::read (fd, buf, sizeof buf); )
- ACE_OS::write (ACE_STDOUT, buf, n);
+ for (;;)
+ {
+ ssize_t n = ACE_OS::read (handle, buf, sizeof buf);
+
+ if (n <= 0)
+ break;
+
+ ACE_OS::write (ACE_STDOUT, buf, n);
+ }
ACE_OS::puts ("----------------------------------------");
- time_t t = ACE_OS::time (0L);
+ time_t t = ACE_OS::time (0L);
char *cs = ACE_OS::ctime (&t);
if (new_local_stream.send (4,
- Handle_L_Stream::login_name, ACE_OS::strlen (Handle_L_Stream::login_name),
- cs, ACE_OS::strlen (cs)) == -1)
+ Handle_L_Stream::login_name,
+ ACE_OS::strlen (Handle_L_Stream::login_name),
+ cs,
+ ACE_OS::strlen (cs)) == -1)
return -1;
-
- if (ACE_OS::close (fd) == -1)
+ else if (ACE_OS::close (handle) == -1)
return -1;
- if (new_local_stream.close () == -1)
+ else if (new_local_stream.close () == -1)
return -1;
- return 0;
+ else
+ return 0;
}
ACE_INLINE int
diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i b/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i
index 21664f105a2..c683f7bbab6 100644
--- a/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i
+++ b/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i
@@ -9,7 +9,7 @@ Handle_R_Dgram::Handle_R_Dgram (void)
{
}
-ACE_INLINE
+ACE_INLINE int
Handle_R_Dgram::open (const ACE_INET_Addr &r, int async)
{
if (this->ACE_SOCK_Dgram::open (r) == -1)
diff --git a/examples/Service_Configurator/Misc/Timer_Service.cpp b/examples/Service_Configurator/Misc/Timer_Service.cpp
index 4d1201b069a..8852df4b78c 100644
--- a/examples/Service_Configurator/Misc/Timer_Service.cpp
+++ b/examples/Service_Configurator/Misc/Timer_Service.cpp
@@ -1,21 +1,20 @@
#include "Timer_Service.h"
// $Id$
-
int
Timer_Service::init (int argc, char *argv[])
{
- char *prog = argc > 0 ? argv[0] : "Timer_Service";
int interval = argc > 1 ? ACE_OS::atoi (argv[1]) : 4;
+
if (argc > 2)
ACE_Trace::start_tracing ();
else
ACE_Trace::stop_tracing ();
- ACE_DEBUG ((LM_DEBUG, "in Timer_Service::init, argv[0] = %s, argc == %d\n",
+ ACE_DEBUG ((LM_DEBUG,
+ "in Timer_Service::init, argv[0] = %s, argc == %d\n",
argv[0], argc));
-
ACE_Service_Config::reactor ()->schedule_timer
(this, 0, ACE_Time_Value (1), ACE_Time_Value (interval));
return 0;
@@ -25,7 +24,8 @@ int
Timer_Service::handle_timeout (const ACE_Time_Value &tv,
const void *)
{
- ACE_DEBUG ((LM_DEBUG, "in Timer_Service::handle_timeout sec = %d, usec = %d\n",
+ ACE_DEBUG ((LM_DEBUG,
+ "in Timer_Service::handle_timeout sec = %d, usec = %d\n",
tv.sec (), tv.usec ()));
return 0;
}
diff --git a/examples/Shared_Malloc/test_persistence.cpp b/examples/Shared_Malloc/test_persistence.cpp
index d534aeefa46..76770815026 100644
--- a/examples/Shared_Malloc/test_persistence.cpp
+++ b/examples/Shared_Malloc/test_persistence.cpp
@@ -51,7 +51,7 @@ public:
return stream;
}
- void *operator new (size_t size)
+ void *operator new (size_t)
{
return shmem_manager->malloc (sizeof (Employee));
}
diff --git a/netsvcs/lib/Server_Logging_Handler.cpp b/netsvcs/lib/Server_Logging_Handler.cpp
index a6a812452f0..a1271655b40 100644
--- a/netsvcs/lib/Server_Logging_Handler.cpp
+++ b/netsvcs/lib/Server_Logging_Handler.cpp
@@ -55,7 +55,7 @@ protected:
#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES)
// Track number of requests.
template <ACE_PEER_STREAM_1, class COUNTER, ACE_SYNCH_1>
-COUNTER ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::request_count_ = 0L;
+COUNTER ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::request_count_ = (COUNTER) 0;
#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */
typedef ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH>
@@ -163,8 +163,7 @@ ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::ACE_Server_
template <ACE_PEER_STREAM_1, class COUNTER, ACE_SYNCH_1> int
ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::handle_logging_record (void)
{
- ssize_t n;
- size_t len;
+ size_t len;
// Lock used to serialize access to std output
// (this should be in the class, but the SunC++ compiler is broken...)
static ACE_SYNCH_MUTEX lock;
@@ -176,7 +175,9 @@ ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::handle_logg
// handle this is painful, and we leave it as an exercise
// for the reader ;-).
- switch (n = this->peer ().recv (&len, sizeof len))
+ ssize_t n = this->peer ().recv (&len, sizeof len);
+
+ switch (n)
{
case -1:
ACE_ERROR_RETURN ((LM_ERROR, "%p at host %s\n",
@@ -207,7 +208,7 @@ ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::handle_logg
{
// Serialize output, if necessary (i.e., if we are running
// in separate threads).
- ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, lock, -1);
+ // ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, lock, -1);
lp.print (this->host_name_, 0, stderr);
}
diff --git a/netsvcs/lib/TS_Server_Handler.cpp b/netsvcs/lib/TS_Server_Handler.cpp
index 848a18016bf..d02bea36267 100644
--- a/netsvcs/lib/TS_Server_Handler.cpp
+++ b/netsvcs/lib/TS_Server_Handler.cpp
@@ -144,7 +144,7 @@ ACE_TS_Server_Acceptor::init (int argc, char *argv[])
// Ignore SIGPIPE so that each <SVC_HANDLER> can handle this on its
// own.
- ACE_Sig_Action sig (ACE_SignalHandler (SIG_IGN), SIGPIPE);
+ ACE_Sig_Action sig ((ACE_SignalHandler) SIG_IGN, SIGPIPE);
ACE_INET_Addr server_addr;
diff --git a/tests/CPP_Test.cpp b/tests/CPP_Test.cpp
index 2696e045b3d..b12d696c861 100644
--- a/tests/CPP_Test.cpp
+++ b/tests/CPP_Test.cpp
@@ -38,7 +38,7 @@ static int timeout = ACE_DEFAULT_TIMEOUT;
static ACE_Thread_Manager thr_mgr;
static void *
-client (void *dummy)
+client (void *)
{
#if defined (ACE_WIN32)
// Insert thread into thr_mgr
@@ -104,7 +104,7 @@ client (void *dummy)
}
static void *
-server (void *dummy)
+server (void *)
{
#if defined (ACE_WIN32)
// Insert thread into thr_mgr
diff --git a/tests/Mem_Map_Test.cpp b/tests/Mem_Map_Test.cpp
index ec630a4905a..387f3e3da63 100644
--- a/tests/Mem_Map_Test.cpp
+++ b/tests/Mem_Map_Test.cpp
@@ -85,7 +85,7 @@ create_test_file ()
}
int
-main (int argc, char **argv)
+main (int, char **argv)
{
ACE_START_TEST;
diff --git a/tests/SPIPE_Test.cpp b/tests/SPIPE_Test.cpp
index 7710bcc3564..ef7fb564f67 100644
--- a/tests/SPIPE_Test.cpp
+++ b/tests/SPIPE_Test.cpp
@@ -37,7 +37,7 @@ static char *pipe_name = "acepipe";
static ACE_Thread_Manager thr_mgr;
static void *
-client (void *dummy)
+client (void *)
{
#if defined (ACE_WIN32)
ACE_Thread_Control thread_control (&thr_mgr); // Insert thread into thr_mgr
@@ -66,7 +66,7 @@ client (void *dummy)
}
static void *
-server (void *dummy)
+server (void *)
{
#if defined (ACE_WIN32)
ACE_Thread_Control thread_control (&thr_mgr); // Insert thread into thr_mgr
diff --git a/tests/Shared_Memory_MM_Test.cpp b/tests/Shared_Memory_MM_Test.cpp
index 54b585c1458..9634e421a5c 100644
--- a/tests/Shared_Memory_MM_Test.cpp
+++ b/tests/Shared_Memory_MM_Test.cpp
@@ -33,7 +33,7 @@ static char shm_key[] = "/tmp/fooXXXXXX";
static ACE_Thread_Manager thr_mgr;
static void *
-client (void *dummy)
+client (void *)
{
#if defined (ACE_WIN32)
// Insert thread into thr_mgr
@@ -43,7 +43,8 @@ client (void *dummy)
ACE_OS::sleep (3);
char t = 'a';
- ACE_Shared_Memory *shm_client = new ACE_Shared_Memory_MM (shm_key);
+ ACE_Shared_Memory *shm_client;
+ ACE_NEW_RETURN (shm_client, ACE_Shared_Memory_MM (shm_key), 0);
char *shm = (char *) shm_client->malloc ();
for (char *s = shm; *s != '\0'; s++)
@@ -59,7 +60,7 @@ client (void *dummy)
}
static void *
-server (void *dummy)
+server (void *)
{
#if defined (ACE_WIN32)
// Insert thread into thr_mgr
@@ -67,9 +68,11 @@ server (void *dummy)
ACE_NEW_THREAD;
#endif
- ACE_Shared_Memory *shm_server = new ACE_Shared_Memory_MM (shm_key, SHMSZ);
+ ACE_Shared_Memory *shm_server;
+ ACE_NEW_RETURN (shm_server, ACE_Shared_Memory_MM (shm_key, SHMSZ), 0);
+
char *shm = (char *) shm_server->malloc ();
- char *s = shm;
+ char *s = shm;
for (char c = 'a'; c <= 'z'; c++)
*s++ = c;
diff --git a/tests/TSS_Test.cpp b/tests/TSS_Test.cpp
index 81e527de54b..37a6d1428c0 100644
--- a/tests/TSS_Test.cpp
+++ b/tests/TSS_Test.cpp
@@ -188,16 +188,16 @@ handler (int signum)
}
int
-main (int argc, char *argv[])
+main (int, char *argv[])
{
ACE_START_TEST;
ACE_Thread_Control tc (ACE_Service_Config::thr_mgr ());
- int threads = ACE_MAX_THREADS;
-
- signal (SIGINT, ACE_SignalHandler (handler));
+ ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT);
#if defined (ACE_HAS_THREADS)
+ int threads = ACE_MAX_THREADS;
+
if (ACE_Service_Config::thr_mgr ()->spawn_n (threads,
ACE_THR_FUNC (&worker),
(void *) iterations,
diff --git a/tests/Time_Service_Test.cpp b/tests/Time_Service_Test.cpp
index e6c24a8b068..5f54f9401f8 100644
--- a/tests/Time_Service_Test.cpp
+++ b/tests/Time_Service_Test.cpp
@@ -27,7 +27,7 @@
#include "ace/Process.h"
int
-main (int argc, char *argv[])
+main (int, char *argv[])
{
ACE_START_TEST;
diff --git a/tests/Timer_Queue_Test.cpp b/tests/Timer_Queue_Test.cpp
index fc6391f959a..956e4f38faa 100644
--- a/tests/Timer_Queue_Test.cpp
+++ b/tests/Timer_Queue_Test.cpp
@@ -26,7 +26,8 @@
class Example_Handler : public ACE_Event_Handler
{
public:
- virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg)
+ virtual int handle_timeout (const ACE_Time_Value &,
+ const void *arg)
{
ACE_ASSERT ((int) arg == 42);
return 0;
@@ -34,7 +35,7 @@ public:
};
int
-main (int argc, char *argv[])
+main (int, char *argv[])
{
ACE_START_TEST;
diff --git a/tests/test_config.h b/tests/test_config.h
index 808a5e9d1bd..44d11017577 100644
--- a/tests/test_config.h
+++ b/tests/test_config.h
@@ -62,6 +62,7 @@ public:
ACE_Log_Msg::instance()->msg_ostream (this->output_file_);
ACE_Log_Msg::instance()->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER);
ACE_Log_Msg::instance()->set_flags (ACE_Log_Msg::OSTREAM);
+ return 0;
}
ofstream *output_file (void)