summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-07 17:43:26 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-07 17:43:26 +0000
commitc0ad6610dbeb3228095336941ba51621638c8043 (patch)
tree0f9bcbe925f5ddd15d3f13c547e47b3a3d9b64c3
parent8f68ea5e4243e72bf62a413857236745bfd3b612 (diff)
downloadATCD-c0ad6610dbeb3228095336941ba51621638c8043.tar.gz
.
-rw-r--r--ChangeLog-99b6
-rw-r--r--TAO/ChangeLog-99c7
-rw-r--r--TAO/examples/Event_Comm/Consumer_Handler.cpp2
-rw-r--r--TAO/examples/Simple/bank/Bank_Client_i.cpp2
-rw-r--r--TAO/examples/Simple/bank/Bank_Client_i.h2
-rw-r--r--TAO/examples/Simple/echo/Echo_Client_i.cpp2
-rw-r--r--TAO/examples/Simple/time-date/Time_Date_Client_i.cpp2
-rw-r--r--TAO/examples/Simple/time-date/Time_Date_Client_i.h2
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp42
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp2
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp65
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp65
12 files changed, 133 insertions, 66 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b
index ecf27fbae2f..e55e3a6c2a1 100644
--- a/ChangeLog-99b
+++ b/ChangeLog-99b
@@ -3,7 +3,11 @@ Mon Jun 07 10:55:12 1999 David L. Levine <levine@cs.wustl.edu>
* ace/config-osf1-4.0.h: added #define ACE_HAS_BROKEN_T_ERROR
to permit building again. Thanks to Doug for this fix.
-Mon Jun 7 00:11:00 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+Mon Jun 7 12:35:17 1999 Douglas C. Schmidt <schmidt@danzon.cs.wustl.edu>
+
+ * examples/Service_Configurator/IPC-tests/client: Fixed some more
+ warnings related to const-correctness. I believe that ACE is
+ now just about completely const-correct.
* examples/Service_Configurator/Misc/main.cpp (main): Cast to
(ASYS_TCHAR **) rather than (ASYS_THCAR *[]). Thanks to David
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c
index 1dc9c7458fa..b06d3f55c9f 100644
--- a/TAO/ChangeLog-99c
+++ b/TAO/ChangeLog-99c
@@ -1,3 +1,10 @@
+Mon Jun 7 12:39:14 1999 Douglas C. Schmidt <schmidt@danzon.cs.wustl.edu>
+
+ * examples/Simple/bank/Bank_Client_i.h,
+ examples/Event_Comm/Consumer_Handler.cpp,
+ examples/Simple/time-date/client.cpp (main): Fixed
+ const-correctness problems.
+
Mon Jun 07 11:51:52 1999 David L. Levine <levine@cs.wustl.edu>
* performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
diff --git a/TAO/examples/Event_Comm/Consumer_Handler.cpp b/TAO/examples/Event_Comm/Consumer_Handler.cpp
index 0b5037afaa7..4c8db13e479 100644
--- a/TAO/examples/Event_Comm/Consumer_Handler.cpp
+++ b/TAO/examples/Event_Comm/Consumer_Handler.cpp
@@ -22,7 +22,7 @@ Consumer_Handler::init (int argc,
char *argv[],
ShutdownCallback *_shutdowncallback)
{
- char *filtering_criteria = "";
+ const char *filtering_criteria = "";
// First see if we have any environment variables.
filtering_criteria =
diff --git a/TAO/examples/Simple/bank/Bank_Client_i.cpp b/TAO/examples/Simple/bank/Bank_Client_i.cpp
index 4f9dbc36f68..9dd30909273 100644
--- a/TAO/examples/Simple/bank/Bank_Client_i.cpp
+++ b/TAO/examples/Simple/bank/Bank_Client_i.cpp
@@ -20,7 +20,7 @@ Bank_Client_i::~Bank_Client_i (void)
int
-Bank_Client_i::run (char *name,
+Bank_Client_i::run (const char *name,
int argc,
char *argv[])
{
diff --git a/TAO/examples/Simple/bank/Bank_Client_i.h b/TAO/examples/Simple/bank/Bank_Client_i.h
index d1a99b7c99f..b8b6526bc27 100644
--- a/TAO/examples/Simple/bank/Bank_Client_i.h
+++ b/TAO/examples/Simple/bank/Bank_Client_i.h
@@ -40,7 +40,7 @@ public:
virtual ~Bank_Client_i (void);
// Destructor
- virtual int run (char *,int, char *[]);
+ virtual int run (const char *, int, char *[]);
// Execute the methods.
private:
diff --git a/TAO/examples/Simple/echo/Echo_Client_i.cpp b/TAO/examples/Simple/echo/Echo_Client_i.cpp
index b931e85fdfd..53bbad62394 100644
--- a/TAO/examples/Simple/echo/Echo_Client_i.cpp
+++ b/TAO/examples/Simple/echo/Echo_Client_i.cpp
@@ -19,7 +19,7 @@ Echo_Client_i::~Echo_Client_i (void)
}
int
-Echo_Client_i::run (char *name,
+Echo_Client_i::run (const char *name,
int argc,
char *argv[])
{
diff --git a/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp b/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp
index 1355fc47156..c4e5eae31c1 100644
--- a/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp
+++ b/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp
@@ -26,7 +26,7 @@ Time_Date_Client_i::parse_args (int argc,
}
int
-Time_Date_Client_i::run (char *name,
+Time_Date_Client_i::run (const char *name,
int argc,
char *argv[])
{
diff --git a/TAO/examples/Simple/time-date/Time_Date_Client_i.h b/TAO/examples/Simple/time-date/Time_Date_Client_i.h
index cad2c3bfaeb..98d8858d38a 100644
--- a/TAO/examples/Simple/time-date/Time_Date_Client_i.h
+++ b/TAO/examples/Simple/time-date/Time_Date_Client_i.h
@@ -39,7 +39,7 @@ public:
virtual ~Time_Date_Client_i (void);
// Destructor
- virtual int run (char *, int, char *[]);
+ virtual int run (const char *, int, char *[]);
// Execute the methods.
virtual int parse_args (int argc, char *argv[]);
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp
index d433bdc938b..124e7d37a4d 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp
@@ -9,22 +9,24 @@
ACE_RCSID(client, remote_dgram_client_test, "$Id$")
-/* Name of the program. */
-static char *program_name;
+// Name of the program.
+static const char *program_name;
-/* Port number to use. */
-static unsigned short port_number = ACE_DEFAULT_SERVER_PORT;
+// Port number to use.
+static u_short port_number = ACE_DEFAULT_SERVER_PORT;
-/* Name of remote host. */
-static char *host_name = ACE_DEFAULT_SERVER_HOST;
+// Name of remote host.
+static const char *host_name = ACE_DEFAULT_SERVER_HOST;
-/* Name of file to send. */
-static char *file_name = "./remote_data";
+// Name of file to send.
+static const char *file_name = "./remote_data";
static void print_usage_and_die (void)
{
- ACE_ERROR ((LM_ERROR, "usage: %s [-p portnum] [-h host_name] [-f file]\n%a",
- program_name, -1));
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s [-p portnum] [-h host_name] [-f file]\n%a",
+ program_name,
+ -1));
}
void
@@ -59,21 +61,29 @@ main (int argc, char *argv[])
ACE_SOCK_Dgram sd (ACE_Addr::sap_any);
void *cp;
- ACE_INET_Addr sa (port_number, host_name);
+ ACE_INET_Addr sa (port_number, host_name);
ACE_Mem_Map mmap (file_name);
if (mmap (cp) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "mmap"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "mmap"),
+ -1);
- /* Next, send the file's contents. */
+ // Next, send the file's contents.
ssize_t cc = sd.send (cp, mmap.size (), sa);
if (cc == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "send"),
+ -1);
else if (cc != (ssize_t) mmap.size ())
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n",
- "Not all the contents of mmap file are sent."), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "Not all the contents of mmap file are sent."),
+ -1);
return 0;
}
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp
index b9af737a42d..ddc2ce3e585 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp
@@ -12,7 +12,7 @@ ACE_RCSID(client, remote_service_directory_test, "$Id$")
static unsigned short port_number = ACE_DEFAULT_SERVICE_PORT;
// Name of remote host.
-static char *host_name = ACE_DEFAULT_SERVER_HOST;
+static const char *host_name = ACE_DEFAULT_SERVER_HOST;
// Trigger a remote reconfiguration.
static int remote_reconfigure = 0;
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp
index 8a7b2be7fcd..bc7d11a033a 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp
@@ -10,23 +10,25 @@
ACE_RCSID(client, remote_stream_client_test, "$Id$")
-/* Name of the program. */
-static char *program_name;
+// Name of the program.
+static const char *program_name;
-/* Port number to use. */
-static unsigned short port_number = ACE_DEFAULT_SERVER_PORT;
+// Port number to use.
+static u_short port_number = ACE_DEFAULT_SERVER_PORT;
-/* Name of remote host. */
-static char *host_name = ACE_DEFAULT_SERVER_HOST;
+// Name of remote host.
+static const char *host_name = ACE_DEFAULT_SERVER_HOST;
-/* Name of file to send. */
-static char *file_name = "./remote_data";
+// Name of file to send.
+static const char *file_name = "./remote_data";
static void
print_usage_and_die (void)
{
- ACE_ERROR ((LM_ERROR, "usage: %s [-p portnum] [-h host_name] [-f file]\n%a",
- program_name, -1));
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s [-p portnum] [-h host_name] [-f file]\n%a",
+ program_name,
+ -1));
}
void
@@ -64,41 +66,62 @@ main (int argc, char *argv[])
ACE_SOCK_CODgram dc;
if (dc.open (sa, ACE_Addr::sap_any) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "open"),
+ -1);
- /* First send the name of the file as a datagram. */
+ // First send the name of the file as a datagram.
iovec iov[2];
- iov[0].iov_base = "filename: ";
+ iov[0].iov_base = (char *) "filename: ";
iov[0].iov_len = 11;
- iov[1].iov_base = file_name;
+ iov[1].iov_base = (char *) file_name;
iov[1].iov_len = ACE_OS::strlen (file_name);
if (dc.send (iov, 2) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "send"),
+ -1);
ACE_SOCK_Stream sc;
ACE_SOCK_Connector con;
if (con.connect (sc, sa) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connect"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "connect"),
+ -1);
ACE_Mem_Map mmap (file_name);
if (mmap (cp) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "mmap"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "mmap"),
+ -1);
- /* Next, send the file's contents. */
+ // Next, send the file's contents.
if (sc.send_n (cp, mmap.size ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send_urg"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "send_urg"),
+ -1);
if (sc.close_writer () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close_writer"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "close_writer"),
+ -1);
if ((n = sc.recv_n (buf, sizeof buf)) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "recv"),
+ -1);
else
ACE_OS::write (ACE_STDOUT, buf, n);
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp
index 62c1b522cf7..8589c7bef0d 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp
@@ -11,22 +11,24 @@ ACE_RCSID(client, remote_thr_stream_client_test, "$Id$")
#if defined (ACE_HAS_TLI)
-/* Name of the program. */
-static char *program_name;
+// Name of the program.
+static const char *program_name;
-/* Port number to use. */
-static unsigned short port_number = ACE_DEFAULT_THR_PORT;
+// Port number to use.
+static u_short port_number = ACE_DEFAULT_THR_PORT;
-/* Name of remote host. */
-static char *host_name = ACE_DEFAULT_SERVER_HOST;
+// Name of remote host.
+static const char *host_name = ACE_DEFAULT_SERVER_HOST;
-/* Name of file to send. */
-static char *file_name = "./remote_data";
+// Name of file to send.
+static const char *file_name = "./remote_data";
static void print_usage_and_die (void)
{
- ACE_ERROR ((LM_ERROR, "usage: %s [-p portnum] [-h host_name] [-f file]\n%a",
- program_name, -1));
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s [-p portnum] [-h host_name] [-f file]\n%a",
+ program_name,
+ -1));
}
void
@@ -59,38 +61,59 @@ main (int argc, char *argv[])
parse_args (argc, argv);
void *cp;
char buf[BUFSIZ];
- ACE_TLI_Stream sc;
+ ACE_TLI_Stream sc;
ACE_TLI_Connector con;
- if (con.connect (sc, ACE_INET_Addr (port_number, host_name)) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
+ if (con.connect (sc,
+ ACE_INET_Addr (port_number,
+ host_name)) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "open"),
+ -1);
ACE_Mem_Map mmap (file_name, PROT_READ);
if (mmap (cp) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "mmap"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
- /* Next, send the file's contents. */
+ "mmap"), -1);
+
+ // Next, send the file's contents.
if (sc.send_n (cp, mmap.size ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send_n"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+
+ "send_n"), -1);
if (sc.sndrel () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close_writer"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "close_writer"),
+ -1);
for (int n; (n = sc.recv (buf, sizeof buf)) > 0; )
if (ACE_OS::write (ACE_STDOUT, buf, n) != n)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "write"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "write"),
+ -1);
if (sc.close () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1);
-
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "close"),
+ -1);
return 0;
}
#else
int
main (int, char *[])
{
- ACE_ERROR_RETURN ((LM_ERROR, "you must have TLI to run this test\n"), 1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "you must have TLI to run this test\n"),
+ 1);
}
#endif /* ACE_HAS_TLI */