summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-26 21:24:36 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-26 21:24:36 +0000
commit8ca6de9cf3d1334a6fa9be37f6b82dca518064a9 (patch)
tree256844a2fd1c58ba713dc4a6e8fc8c7f2842658e
parent4176b4fe63e3a132eef9f25f41020be80bea02cb (diff)
downloadATCD-8ca6de9cf3d1334a6fa9be37f6b82dca518064a9.tar.gz
Minor changes:wq
-rw-r--r--TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp b/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp
index b5087be6554..e299de7e251 100644
--- a/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp
+++ b/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp
@@ -35,10 +35,10 @@
const int SOURCE_ID = 1001;
static const char usage [] =
-"[-? |\n"
-" [-O[RBport] ORB port number]"
-" [-m <count> of messages to send [100]"
-" [-f name of schedler input data file]]";
+"[[-?]\n"
+" [-O[RBport] ORB port number]\n"
+" [-m <count> of messages to send [100]\n"
+" [-f name of schedler input data file]]\n";
static u_int total_messages = 100;
@@ -551,38 +551,34 @@ get_options (int argc,
{
// We need the 'O' in get_opt() because we also want to have ORB
// parameters, they all start with 'O'.
- ACE_Get_Opt get_opt (argc, argv, "O:?m:f:");
+ ACE_Get_Opt get_opt (argc, argv, "m:f:");
int opt;
int temp;
- while ((opt = get_opt ()) != EOF)
+ while ((opt = get_opt ()) != -1)
{
switch (opt)
{
- case '?':
- ACE_DEBUG ((LM_DEBUG,
- "Usage: %s %s\n",
- argv[0], usage));
- ACE_OS::exit (0);
- break;
case 'm':
temp = ACE_OS::atoi (get_opt.optarg);
if (temp > 0)
{
total_messages = (u_int) temp;
- cout << "Messages to send:" << total_messages << endl;
+ ACE_DEBUG ((LM_DEBUG,
+ "Messages to send: %d\n",
+ total_messages));
}
else
ACE_ERROR_RETURN ((LM_ERROR,
"%s: count must be > 0",
argv[0]),
- 1);
+ 1);
break;
case 'f':
input_file_name = get_opt.optarg;
if (!input_file_name || ACE_OS::strlen (input_file_name) > 0)
- cout << "Reading file!<< endl;
+ ACE_DEBUG ((LM_DEBUG,"Reading file!\n"));
else
{
input_file_name = 0;
@@ -592,17 +588,13 @@ get_options (int argc,
1);
}
break;
- case 'O': // This is kind of tricky, it is actually read by the
- // ORB later.
- break;
default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "%s: unknown arg, -%c\n"
- "Usage: %s %s\n",
- argv[0], char(opt),
- argv[0],
- usage),
- 1);
+ case '?':
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s %s\n",
+ argv[0], usage));
+ ACE_OS::exit (0);
+ break;
}
}
@@ -634,6 +626,7 @@ main (int argc, char *argv [])
TAO_TRY_ENV);
TAO_CHECK_ENV;
+
// Connect to the RootPOA.
CORBA::Object_var poa_object =
orb->resolve_initial_references("RootPOA");
@@ -656,7 +649,7 @@ main (int argc, char *argv [])
if (CORBA::is_nil (naming_obj.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable get the Naming Service.\n"),
+ " (%P|%t) Unable to get the Naming Service.\n"),
1);
CosNaming::NamingContext_var naming_context =