diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-12-26 15:46:44 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-12-26 15:46:44 +0000 |
commit | 0bc80fab4dc53994efbd511b22b0c86d59baff8c (patch) | |
tree | 3e074e160a2e59a236f10781cfcb0e071b49fac8 | |
parent | cde21c2507ace716fc833231662ff0f85ff13f5a (diff) | |
download | ATCD-0bc80fab4dc53994efbd511b22b0c86d59baff8c.tar.gz |
ChangeLogTag:Wed Dec 26 09:07:45 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
97 files changed, 469 insertions, 449 deletions
diff --git a/ace/Get_Opt.cpp b/ace/Get_Opt.cpp index 3cbe8f29406..3c4238e7bd5 100644 --- a/ace/Get_Opt.cpp +++ b/ace/Get_Opt.cpp @@ -91,15 +91,15 @@ ACE_Get_Opt::ACE_Get_Opt (int argc, : argc_ (argc), argv_ (argv), optstring_ (optstring), - opt_ind_ (skip), - opt_err_ (report_errors), + optind (skip), + opterr (report_errors), long_only_ (long_only), has_colon_ (0), - opt_arg_ (0), + optarg (0), nextchar_ (0), ordering_ (ordering), - nonopt_start_ (opt_ind_), - nonopt_end_ (opt_ind_), + nonopt_start_ (optind), + nonopt_end_ (optind), long_option_ (0) { ACE_TRACE ("ACE_Get_Opt::ACE_Get_Opt"); @@ -171,13 +171,13 @@ ACE_Get_Opt::nextchar_i (void) return EOF; // Update scanning pointer. - if (this->opt_ind_ >= this->argc_) + if (this->optind >= this->argc_) { // We're done... this->nextchar_ = 0; return EOF; } - else if (*(this->nextchar_ = this->argv_[this->opt_ind_]) != '-' + else if (*(this->nextchar_ = this->argv_[this->optind]) != '-' || this->nextchar_[1] == '\0') { // We didn't get an option. @@ -188,7 +188,7 @@ ACE_Get_Opt::nextchar_i (void) return EOF; // It must be RETURN_IN_ORDER... - this->opt_arg_ = this->argv_[this->opt_ind_++]; + this->optarg = this->argv_[this->optind++]; this->nextchar_ = 0; return 1; } @@ -197,7 +197,7 @@ ACE_Get_Opt::nextchar_i (void) && this->nextchar_[1] == 0) { // Found "--" so we're done... - ++this->opt_ind_; + ++this->optind; this->nextchar_ = 0; return EOF; } @@ -253,12 +253,12 @@ ACE_Get_Opt::long_option_i (void) { // Great, we found a match, but unfortunately we found more than // one and it wasn't exact. - if (this->opt_err_) + if (this->opterr) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%s: option `%s' is ambiguous\n"), - this->argv_[0], this->argv_[this->opt_ind_])); + this->argv_[0], this->argv_[this->optind])); this->nextchar_ = 0; - this->opt_ind_++; + this->optind++; return '?'; } @@ -266,17 +266,17 @@ ACE_Get_Opt::long_option_i (void) { // Okay, we found a good one (either a single hit or an exact match). option_index = indfound; - this->opt_ind_++; + this->optind++; if (*s) { // s must point to '=' which means there's an argument (well close enougth). if (pfound->has_arg_ != NO_ARG) // Good, we want an argument and here it is. - this->opt_arg_ = ++s; + this->optarg = ++s; else { // Whoops, we've got what looks like an argument, but we don't want one. - if (this->opt_err_) + if (this->opterr) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%s: long option `--%s' doesn't allow an argument\n"), this->argv_[0], pfound->name_.c_str ())); @@ -289,13 +289,13 @@ ACE_Get_Opt::long_option_i (void) // s didn't help us, but we need an argument. Note that optional arguments // for long options must use the "=" syntax, so we won't get here // in that case. - if (this->opt_ind_ < this->argc_) + if (this->optind < this->argc_) // We still have some elements left, so use the next one. - this->opt_arg_ = this->argv_[this->opt_ind_++]; + this->optarg = this->argv_[this->optind++]; else { // All out of elements, so we have to punt... - if (this->opt_err_) + if (this->opterr) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%s: long option '--%s' requires an argument\n"), this->argv_[0], pfound->name_.c_str ())); @@ -309,19 +309,19 @@ ACE_Get_Opt::long_option_i (void) // great. If the user really wants to know if a long option was passed. return pfound->val_; } - if (!this->long_only_ || this->argv_[this->opt_ind_][1] == '-' + if (!this->long_only_ || this->argv_[this->optind][1] == '-' || this->optstring_.find (*this->nextchar_) == ACE_TString::npos) { // Okay, we couldn't find a long option. If it isn't long_only (which // means try the long first, and if not found try the short) or a long // signature was passed, e.g. "--", or it's not a short (not sure when // this could happen) it's an error. - if (this->opt_err_) + if (this->opterr) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%s: illegal long option '--%s'\n"), this->argv_[0], this->nextchar_)); this->nextchar_ = 0; - this->opt_ind_++; + this->optind++; return '?'; } return this->short_option_i (); @@ -339,11 +339,11 @@ ACE_Get_Opt::short_option_i (void) /* Increment `optind' when we start to process its last character. */ if (*this->nextchar_ == '\0') - ++this->opt_ind_; + ++this->optind; if (oli == 0 || opt == ':') { - if (this->opt_err_) + if (this->opterr) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%s: illegal short option -- %c\n"), this->argv_[0], opt)); @@ -352,7 +352,7 @@ ACE_Get_Opt::short_option_i (void) if (opt == 'W' && oli[1] == ';') { if (this->nextchar_[0] == 0) - this->nextchar_ = this->argv_[this->opt_ind_]; + this->nextchar_ = this->argv_[this->optind]; return long_option_i (); } if (oli[1] == ':') @@ -364,11 +364,11 @@ ACE_Get_Opt::short_option_i (void) // means we didn't get one. if (*this->nextchar_ != '\0') { - this->opt_arg_ = this->nextchar_; - this->opt_ind_++; + this->optarg = this->nextchar_; + this->optind++; } else - this->opt_arg_ = 0; + this->optarg = 0; this->nextchar_ = 0; } else @@ -377,13 +377,13 @@ ACE_Get_Opt::short_option_i (void) if (*this->nextchar_ != '\0') { // Found argument in same argv-element. - this->opt_arg_ = this->nextchar_; - this->opt_ind_++; + this->optarg = this->nextchar_; + this->optind++; } - else if (this->opt_ind_ == this->argc_) + else if (this->optind == this->argc_) { // Ran out of arguments before finding required argument. - if (this->opt_err_) + if (this->opterr) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%s: short option requires an argument -- %c\n"), this->argv_[0], opt)); @@ -391,7 +391,7 @@ ACE_Get_Opt::short_option_i (void) } else // Use the next argv-element as the argument. - this->opt_arg_ = this->argv_[this->opt_ind_++]; + this->optarg = this->argv_[this->optind++]; this->nextchar_ = 0; } } @@ -404,14 +404,14 @@ ACE_Get_Opt::operator () (void) ACE_TRACE ("ACE_Get_Opt_Long::operator"); // First of all, make sure we reinitialize any pointers.. - this->opt_arg_ = 0; + this->optarg = 0; this->long_option_ = 0; - this->opt_arg_ = 0; + this->optarg = 0; if (this->argv_ == 0) { // It can happen, e.g., on VxWorks. - this->opt_ind_ = 0; + this->optind = 0; return -1; } @@ -424,8 +424,8 @@ ACE_Get_Opt::operator () (void) return retval; } - if (((this->argv_[this->opt_ind_][0] == '-') - && (this->argv_[this->opt_ind_][1] == '-')) || this->long_only_) + if (((this->argv_[this->optind][0] == '-') + && (this->argv_[this->optind][1] == '-')) || this->long_only_) return this->long_option_i (); return this->short_option_i (); @@ -538,14 +538,14 @@ ACE_Get_Opt::permute_args (void) int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; ACE_TCHAR *swap; - int opt_end = this->opt_ind_; + int opt_end = this->optind; nnonopts = this->nonopt_end_ - this->nonopt_start_; nopts = opt_end - this->nonopt_end_; ncycle = ACE::gcd (nnonopts, nopts); cyclelen = (opt_end - this->nonopt_start_) / ncycle; - this->opt_ind_ = this->opt_ind_ - nnonopts; + this->optind = this->optind - nnonopts; for (i = 0; i < ncycle; i++) { @@ -572,35 +572,35 @@ ACE_Get_Opt::permute (void) ACE_TRACE ("ACE_Get_Opt::permute"); if (this->nonopt_start_ != this->nonopt_end_ - && this->nonopt_start_ != this->opt_ind_) + && this->nonopt_start_ != this->optind) this->permute_args (); - this->nonopt_start_ = this->opt_ind_; + this->nonopt_start_ = this->optind; // Skip over args untill we find the next option. - while (this->opt_ind_ < this->argc_ - && (this->argv_[this->opt_ind_][0] != '-' - || this->argv_[this->opt_ind_][1] == '\0')) - this->opt_ind_++; + while (this->optind < this->argc_ + && (this->argv_[this->optind][0] != '-' + || this->argv_[this->optind][1] == '\0')) + this->optind++; // Got an option, so mark this as the end of the non options. - this->nonopt_end_ = this->opt_ind_; + this->nonopt_end_ = this->optind; - if (this->opt_ind_ != this->argc_ - && ACE_OS::strcmp (this->argv_[this->opt_ind_], "--") == 0) + if (this->optind != this->argc_ + && ACE_OS::strcmp (this->argv_[this->optind], "--") == 0) { // We found the marker for the end of the options. - this->opt_ind_++; + this->optind++; if (this->nonopt_start_ != this->nonopt_end_ - && this->nonopt_end_ != this->opt_ind_) + && this->nonopt_end_ != this->optind) this->permute_args (); } - if (this->opt_ind_ == this->argc_) + if (this->optind == this->argc_) { if (this->nonopt_start_ != this->nonopt_end_) - this->opt_ind_ = this->nonopt_start_; + this->optind = this->nonopt_start_; return EOF; } return 0; diff --git a/ace/Get_Opt.h b/ace/Get_Opt.h index ef3fa544b59..64ead6a360f 100644 --- a/ace/Get_Opt.h +++ b/ace/Get_Opt.h @@ -31,8 +31,6 @@ * These definitions are for backward compatibility with previous versions. * of ACE_Get_Opt. */ -#define optarg opt_arg () -#define optind opt_ind () /** * @class ACE_Get_Opt @@ -223,6 +221,9 @@ public: /// <operator()> or 0 if none was found. const ACE_TCHAR *long_option (void) const; + /// Accessor for the <argv_> pointer. + ACE_TCHAR **argv (void) const; + /// Dump the state of an object. void dump (void) const; @@ -230,6 +231,30 @@ public: /// long_option added short options as expected. const ACE_TCHAR *optstring (void) const; +public: + /** + * The following five data members should be private, but that + * would break backwards compatibility. However, we recommend not + * writing code that uses these fields directly. + */ + + /// Index in argv_ of the next element to be scanned. + int optind; + + /// Callers store zero here to inhibit the error message for + /// unrecognized options. + int opterr; + + /// Points to the option argument when one is found on last call to + /// <operator()>. + ACE_TCHAR *optarg; + + /// Holds the <argc> count. + int argc_; + + /// Holds the <argv> pointer. + ACE_TCHAR **argv_; + private: class ACE_Get_Opt_Long_Option { @@ -279,22 +304,9 @@ private: /// Handles reordering <argv>-elements. int permute (void); - /// Holds the <argc> count. - int argc_; - - /// Holds the <argv> pointer. - ACE_TCHAR **argv_; - /// Holds the option string. ACE_TString optstring_; - /// Index in argv_ of the next element to be scanned. - int opt_ind_; - - /// Callers store zero here to inhibit the error message for - /// unrecognized options. - int opt_err_; - /// Treat all options as long options. int long_only_; @@ -303,10 +315,6 @@ private: /// arguments are missing. int has_colon_; - /// Points to the option argument when one is found on last call to - /// <operator()>. - ACE_TCHAR *opt_arg_; - /** * The next char to be scanned in the option-element in which the * last option character we returned was found. This allows us to diff --git a/ace/Get_Opt.i b/ace/Get_Opt.i index 63aa4bb4bad..f89190a954e 100644 --- a/ace/Get_Opt.i +++ b/ace/Get_Opt.i @@ -9,16 +9,22 @@ ACE_Get_Opt::ACE_Get_Opt_Long_Option::operator < (const ACE_Get_Opt_Long_Option return this->name_ < rhs.name_; } +ACE_INLINE ACE_TCHAR ** +ACE_Get_Opt::argv (void) const +{ + return this->argv_; +} + ACE_INLINE ACE_TCHAR* ACE_Get_Opt::opt_arg (void) const { - return this->opt_arg_; + return this->optarg; } ACE_INLINE int & ACE_Get_Opt::opt_ind (void) { - return this->opt_ind_; + return this->optind; } ACE_INLINE const ACE_TCHAR * diff --git a/apps/Gateway/Gateway/Options.cpp b/apps/Gateway/Gateway/Options.cpp index a5edd01fdb9..d13848835bf 100644 --- a/apps/Gateway/Gateway/Options.cpp +++ b/apps/Gateway/Gateway/Options.cpp @@ -183,7 +183,7 @@ Options::parse_args (int argc, char *argv[]) { // Become an Acceptor. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -210,7 +210,7 @@ Options::parse_args (int argc, char *argv[]) break; case 'C': // Use a different proxy config filename. ACE_OS::strncpy (this->consumer_config_file_, - get_opt.optarg, + get_opt.opt_arg (), sizeof this->consumer_config_file_ / sizeof (ACE_TCHAR)); break; @@ -218,7 +218,7 @@ Options::parse_args (int argc, char *argv[]) { // Become a Connector. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -246,15 +246,15 @@ Options::parse_args (int argc, char *argv[]) break; case 'P': // Use a different connection config filename. ACE_OS::strncpy (this->connection_config_file_, - get_opt.optarg, + get_opt.opt_arg (), sizeof this->connection_config_file_); break; case 'q': // Use a different socket queue size. - this->socket_queue_size_ = ACE_OS::atoi (get_opt.optarg); + this->socket_queue_size_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': // Use a different threading strategy. { - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strcmp (flag, "OUTPUT_MT") == 0) @@ -270,7 +270,7 @@ Options::parse_args (int argc, char *argv[]) Options::VERBOSE); break; case 'w': // Time performance for a designated amount of time. - this->performance_window_ = ACE_OS::atoi (get_opt.optarg); + this->performance_window_ = ACE_OS::atoi (get_opt.opt_arg ()); // Use blocking connection semantics so that we get accurate // timings (since all connections start at once). this->blocking_semantics_ = 0; diff --git a/apps/Gateway/Peer/Options.cpp b/apps/Gateway/Peer/Options.cpp index 80c0256b619..e4c5842c696 100644 --- a/apps/Gateway/Peer/Options.cpp +++ b/apps/Gateway/Peer/Options.cpp @@ -114,7 +114,7 @@ Options::parse_args (int argc, char *argv[]) { // Become an Acceptor. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -140,7 +140,7 @@ Options::parse_args (int argc, char *argv[]) { // Become a Connector. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -163,22 +163,22 @@ Options::parse_args (int argc, char *argv[]) break; /* NOTREACHED */ case 'C': - this->connection_id_ = ACE_OS::atoi (get_opt.optarg); + this->connection_id_ = ACE_OS::atoi (get_opt.opt_arg ()); break; /* NOTREACHED */ case 'h': // connector host - this->connector_host_ = get_opt.optarg; + this->connector_host_ = get_opt.opt_arg (); break; /* NOTREACHED */ case 'm': // max queue size. - this->max_queue_size_ = ACE_OS::atoi (get_opt.optarg); + this->max_queue_size_ = ACE_OS::atoi (get_opt.opt_arg ()); break; /* NOTREACHED */ case 't': // Timeout - this->timeout_ = ACE_OS::atoi (get_opt.optarg); + this->timeout_ = ACE_OS::atoi (get_opt.opt_arg ()); break; /* NOTREACHED */ case 'v': diff --git a/apps/JAWS/ChangeLog b/apps/JAWS/ChangeLog index e75cc59c33e..140e3ad1b07 100644 --- a/apps/JAWS/ChangeLog +++ b/apps/JAWS/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 26 09:35:35 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * clients/Blobby/Options.cpp + server/HTTP_Server.cpp + stress_testing/benchd.cpp + JAWS2/JAWS/Server.cpp: Replaced all uses of getopt.optarg + with getopt.opt_arg(). + Thu Dec 6 09:00:31 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * clients/Caching/http_client.cpp (main): Make sure to remove the diff --git a/apps/JAWS/clients/Blobby/Options.cpp b/apps/JAWS/clients/Blobby/Options.cpp index 4c28033ae19..08f7de4ad8b 100644 --- a/apps/JAWS/clients/Blobby/Options.cpp +++ b/apps/JAWS/clients/Blobby/Options.cpp @@ -40,19 +40,19 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) this->operation_ = 'w'; break; case 'h': - this->hostname_ = get_opt.optarg; + this->hostname_ = get_opt.opt_arg (); break; case 'p': - this->port_ = ACE_OS::atoi (get_opt.optarg); + this->port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'f': - this->filename_ = get_opt.optarg; + this->filename_ = get_opt.opt_arg (); break; case 'l': - this->length_ = ACE_OS::atoi (get_opt.optarg); + this->length_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'o': - this->offset_ = ACE_OS::atoi (get_opt.optarg); + this->offset_ = ACE_OS::atoi (get_opt.opt_arg ()); break; // Usage fallthrough. default: diff --git a/apps/JAWS/server/HTTP_Server.cpp b/apps/JAWS/server/HTTP_Server.cpp index 146a7c04d8b..8de242b2df5 100644 --- a/apps/JAWS/server/HTTP_Server.cpp +++ b/apps/JAWS/server/HTTP_Server.cpp @@ -50,49 +50,49 @@ HTTP_Server::parse_args (int argc, switch (c) { case 'p': - this->port_ = ACE_OS::atoi (get_opt.optarg); + this->port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'n': - this->threads_ = ACE_OS::atoi (get_opt.optarg); + this->threads_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': // POOL -> thread pool // PER_REQUEST -> thread per request // THROTTLE -> thread per request with throttling - if (ACE_OS::strcmp (get_opt.optarg, "POOL") == 0) + if (ACE_OS::strcmp (get_opt.opt_arg (), "POOL") == 0) thr_strategy = JAWS::POOL; - else if (ACE_OS::strcmp (get_opt.optarg, "PER_REQUEST") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "PER_REQUEST") == 0) { thr_strategy = JAWS::PER_REQUEST; this->throttle_ = 0; } - else if (ACE_OS::strcmp (get_opt.optarg, "THROTTLE") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "THROTTLE") == 0) { thr_strategy = JAWS::PER_REQUEST; this->throttle_ = 1; } break; case 'f': - if (ACE_OS::strcmp (get_opt.optarg, "THR_BOUND") == 0) + if (ACE_OS::strcmp (get_opt.opt_arg (), "THR_BOUND") == 0) { // What happened here? } - else if (ACE_OS::strcmp (get_opt.optarg, "THR_DAEMON") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "THR_DAEMON") == 0) { } - else if (ACE_OS::strcmp (get_opt.optarg, "THR_DETACHED") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "THR_DETACHED") == 0) { } case 'i': // SYNCH -> synchronous I/O // ASYNCH -> asynchronous I/O - if (ACE_OS::strcmp (get_opt.optarg, "SYNCH") == 0) + if (ACE_OS::strcmp (get_opt.opt_arg (), "SYNCH") == 0) io_strategy = JAWS::SYNCH; - else if (ACE_OS::strcmp (get_opt.optarg, "ASYNCH") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "ASYNCH") == 0) io_strategy = JAWS::ASYNCH; break; case 'b': - this->backlog_ = ACE_OS::atoi (get_opt.optarg); + this->backlog_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: break; diff --git a/apps/JAWS/stress_testing/benchd.cpp b/apps/JAWS/stress_testing/benchd.cpp index 2c6dfcbd526..ff17f669430 100644 --- a/apps/JAWS/stress_testing/benchd.cpp +++ b/apps/JAWS/stress_testing/benchd.cpp @@ -184,7 +184,7 @@ parse_args (int argc, char *argv[]) case 'q': QUIET = 1; case 'i': - INTERFACE = get_opt.optarg; + INTERFACE = get_opt.opt_arg (); break; case 'u': // Usage fallthrough. diff --git a/apps/JAWS2/JAWS/Server.cpp b/apps/JAWS2/JAWS/Server.cpp index 629bd00d1f4..9c729bc6c81 100644 --- a/apps/JAWS2/JAWS/Server.cpp +++ b/apps/JAWS2/JAWS/Server.cpp @@ -148,34 +148,34 @@ JAWS_Server::parse_args (int argc, char *argv[]) t = !t; break; case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'c': - if (ACE_OS::strcmp (getopt.optarg, "PER_REQUEST") == 0) + if (ACE_OS::strcmp (getopt.opt_arg (), "PER_REQUEST") == 0) this->concurrency_ = 1; else this->concurrency_ = 0; break; case 'd': - if (ACE_OS::strcmp (getopt.optarg, "ASYNCH") == 0) + if (ACE_OS::strcmp (getopt.opt_arg (), "ASYNCH") == 0) this->dispatch_ = 1; else this->dispatch_ = 0; break; case 'n': - this->nthreads_ = ACE_OS::atoi (getopt.optarg); + this->nthreads_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'm': - this->maxthreads_ = ACE_OS::atoi (getopt.optarg); + this->maxthreads_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'f': - if (ACE_OS::strcmp (getopt.optarg, "THR_BOUND") == 0) + if (ACE_OS::strcmp (getopt.opt_arg (), "THR_BOUND") == 0) this->flags_ |= THR_BOUND; - else if (ACE_OS::strcmp (getopt.optarg, "THR_DAEMON") == 0) + else if (ACE_OS::strcmp (getopt.opt_arg (), "THR_DAEMON") == 0) this->flags_ |= THR_DAEMON; - else if (ACE_OS::strcmp (getopt.optarg, "THR_DETACHED") == 0) + else if (ACE_OS::strcmp (getopt.opt_arg (), "THR_DETACHED") == 0) this->flags_ |= THR_DETACHED; break; case 'r': - this->ratio_ = ACE_OS::atoi (getopt.optarg); + this->ratio_ = ACE_OS::atoi (getopt.opt_arg ()); break; } diff --git a/apps/drwho/Options.cpp b/apps/drwho/Options.cpp index 4b82de0563a..577d35a2b7a 100644 --- a/apps/drwho/Options.cpp +++ b/apps/drwho/Options.cpp @@ -88,7 +88,7 @@ Options::set_options (int argc, char *argv[]) Options::print_usage_and_die (0); /* NOTREACHED */ case 'A': - Multicast_Manager::add_host (getopt.optarg); + Multicast_Manager::add_host (getopt.opt_arg ()); break; case 'a': Options::protocol_type = PROTO_ALL; @@ -100,10 +100,10 @@ Options::set_options (int argc, char *argv[]) Options::set_opt (Options::DEBUG); break; case 'f': - Options::friend_file = getopt.optarg; + Options::friend_file = getopt.opt_arg (); break; case 'F': - if (Multicast_Manager::insert_hosts_from_file (getopt.optarg) < 0) + if (Multicast_Manager::insert_hosts_from_file (getopt.opt_arg ()) < 0) ACE_DEBUG ((LM_DEBUG, "%p%a\n", Options::program_name, @@ -111,7 +111,7 @@ Options::set_options (int argc, char *argv[]) add_default_hosts = 0; break; case 'H': - Multicast_Manager::add_host (getopt.optarg); + Multicast_Manager::add_host (getopt.opt_arg ()); add_default_hosts = 0; break; case 'h': @@ -124,7 +124,7 @@ Options::set_options (int argc, char *argv[]) Options::set_opt (Options::USE_VERBOSE_FORMAT); break; case 'p': - Options::port_number = atoi (getopt.optarg); + Options::port_number = atoi (getopt.opt_arg ()); break; case 'R': Options::protocol_type = PROTO_RUSER; @@ -139,10 +139,10 @@ Options::set_options (int argc, char *argv[]) Options::set_opt (Options::SORT_BY_REAL_NAME); break; case 't': - Options::max_server_timeout = atoi (getopt.optarg); + Options::max_server_timeout = atoi (getopt.opt_arg ()); break; case 'w': - Options::user_name = getopt.optarg; + Options::user_name = getopt.opt_arg (); Options::protocol_type = PROTO_USR; break; default: diff --git a/apps/gperf/src/Options.cpp b/apps/gperf/src/Options.cpp index 07d3e2311b5..5355ecdf8e8 100644 --- a/apps/gperf/src/Options.cpp +++ b/apps/gperf/src/Options.cpp @@ -316,7 +316,7 @@ Options::parse_args (int argc, char *argv[]) // Allows user to provide keyword/attribute separator case 'e': { - delimiters_ = getopt.optarg; + delimiters_ = getopt.opt_arg (); break; } case 'E': @@ -328,7 +328,7 @@ Options::parse_args (int argc, char *argv[]) case 'f': { ACE_SET_BITS (option_word_, FAST); - iterations_ = atoi (getopt.optarg); + iterations_ = atoi (getopt.opt_arg ()); if (iterations_ < 0) { ACE_ERROR ((LM_ERROR, "iterations value must not be negative, assuming 0\n")); @@ -448,13 +448,13 @@ Options::parse_args (int argc, char *argv[]) // Sets the name for the hash function. case 'H': { - hash_name_ = getopt.optarg; + hash_name_ = getopt.opt_arg (); break; } // Sets the initial value for the associated values array. case 'i': { - initial_asso_value_ = atoi (getopt.optarg); + initial_asso_value_ = atoi (getopt.opt_arg ()); if (initial_asso_value_ < 0) ACE_ERROR ((LM_ERROR, "Initial value %d should be non-zero, ignoring and continuing.\n", @@ -472,7 +472,7 @@ Options::parse_args (int argc, char *argv[]) // Sets the jump value, must be odd for later algorithms. case 'j': { - jump_ = atoi (getopt.optarg); + jump_ = atoi (getopt.opt_arg ()); if (jump_ < 0) ACE_ERROR_RETURN ((LM_ERROR, "Jump value %d must be a positive number.\n%r", @@ -496,7 +496,7 @@ Options::parse_args (int argc, char *argv[]) { const int BAD_VALUE = -1; int value; - Iterator expand (getopt.optarg, + Iterator expand (getopt.opt_arg (), 1, MAX_KEY_POS - 1, WORD_END, @@ -504,7 +504,7 @@ Options::parse_args (int argc, char *argv[]) EOS); // Use all the characters for hashing!!!! - if (*getopt.optarg == '*') + if (*getopt.opt_arg () == '*') option_word_ = (option_word_ & ~DEFAULTCHARS) | ALLCHARS; else { @@ -545,7 +545,7 @@ Options::parse_args (int argc, char *argv[]) // Make this the keyname for the keyword component field. case 'K': { - key_name_ = getopt.optarg; + key_name_ = getopt.opt_arg (); break; } // Create length table to avoid extra string compares. @@ -558,15 +558,15 @@ Options::parse_args (int argc, char *argv[]) case 'L': { option_word_ &= ~C; - if (!ACE_OS::strcmp (getopt.optarg, "C++")) + if (!ACE_OS::strcmp (getopt.opt_arg (), "C++")) ACE_SET_BITS (option_word_, (CPLUSPLUS | ANSI)); - else if (!ACE_OS::strcmp (getopt.optarg, "C")) + else if (!ACE_OS::strcmp (getopt.opt_arg (), "C")) ACE_SET_BITS (option_word_, C); else { ACE_ERROR ((LM_ERROR, "unsupported language option %s, defaulting to C\n", - getopt.optarg)); + getopt.opt_arg ())); ACE_SET_BITS (option_word_, C); } break; @@ -589,16 +589,16 @@ Options::parse_args (int argc, char *argv[]) ACE_SET_BITS (option_word_, NOLENGTH); break; } - // Make generated lookup function name be optarg + // Make generated lookup function name be.opt_arg () case 'N': { - function_name_ = getopt.optarg; + function_name_ = getopt.opt_arg (); break; } - // Make fill_default be optarg + // Make fill_default be.opt_arg () case 'F': { - fill_default_ = getopt.optarg; + fill_default_ = getopt.opt_arg (); break; } // Order input by frequency of key set occurrence. @@ -631,7 +631,7 @@ Options::parse_args (int argc, char *argv[]) // Range of associated values, determines size of final table. case 's': { - size_ = atoi (getopt.optarg); + size_ = atoi (getopt.opt_arg ()); if (abs (size_) > 50) ACE_ERROR ((LM_ERROR, "%d is excessive, did you really mean this?! (type %n -h for help)\n", @@ -642,11 +642,11 @@ Options::parse_args (int argc, char *argv[]) case 'S': { ACE_SET_BITS (option_word_, SWITCH); - total_switches_ = atoi (getopt.optarg); + total_switches_ = atoi (getopt.opt_arg ()); if (total_switches_ <= 0) ACE_ERROR_RETURN ((LM_ERROR, "number of switches %s must be a positive number\n%r", - getopt.optarg, + getopt.opt_arg (), &Options::usage), -1); break; @@ -680,7 +680,7 @@ Options::parse_args (int argc, char *argv[]) // Set the class name. case 'Z': { - class_name_ = getopt.optarg; + class_name_ = getopt.opt_arg (); break; } default: @@ -692,16 +692,16 @@ Options::parse_args (int argc, char *argv[]) } - if (argv[getopt.optind] && - freopen (argv[getopt.optind], + if (argv[getopt.opt_ind ()] && + freopen (argv[getopt.opt_ind ()], "r", stdin) == 0) ACE_ERROR_RETURN ((LM_ERROR, "Cannot open keyword file %p\n%r", - argv[getopt.optind], + argv[getopt.opt_ind ()], &Options::usage), -1); - if (getopt.optind + 1 < argc) + if (getopt.opt_ind () + 1 < argc) ACE_ERROR_RETURN ((LM_ERROR, "Extra trailing arguments to %n.\n%r", usage), diff --git a/examples/ASX/Event_Server/Event_Server/Options.cpp b/examples/ASX/Event_Server/Event_Server/Options.cpp index 3f180fe0b5d..b6aab6b1d2c 100644 --- a/examples/ASX/Event_Server/Event_Server/Options.cpp +++ b/examples/ASX/Event_Server/Event_Server/Options.cpp @@ -115,40 +115,40 @@ Options::parse_args (int argc, char *argv[]) this->t_flags (THR_BOUND); break; case 'c': - this->consumer_port (ACE_OS::atoi (get_opt.optarg)); + this->consumer_port (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'd': this->debugging_ = 1; break; case 'H': - this->high_water_mark (ACE_OS::atoi (get_opt.optarg)); + this->high_water_mark (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'i': - this->iterations (ACE_OS::atoi (get_opt.optarg)); + this->iterations (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'L': - this->low_water_mark (ACE_OS::atoi (get_opt.optarg)); + this->low_water_mark (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'l': - this->initial_queue_length (ACE_OS::atoi (get_opt.optarg)); + this->initial_queue_length (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'M': - this->message_size (ACE_OS::atoi (get_opt.optarg)); + this->message_size (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'n': this->t_flags (THR_NEW_LWP); break; case 's': - this->supplier_port (ACE_OS::atoi (get_opt.optarg)); + this->supplier_port (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'T': - if (ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0) + if (ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0) ACE_Trace::start_tracing (); - else if (ACE_OS::strcasecmp (get_opt.optarg, "OFF") == 0) + else if (ACE_OS::strcasecmp (get_opt.opt_arg (), "OFF") == 0) ACE_Trace::stop_tracing (); break; case 't': - this->thr_count (ACE_OS::atoi (get_opt.optarg)); + this->thr_count (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'v': this->verbosity_ = 1; diff --git a/examples/ASX/Event_Server/Transceiver/transceiver.cpp b/examples/ASX/Event_Server/Transceiver/transceiver.cpp index b9c1f7ab33c..2e2aedb7fc9 100644 --- a/examples/ASX/Event_Server/Transceiver/transceiver.cpp +++ b/examples/ASX/Event_Server/Transceiver/transceiver.cpp @@ -31,10 +31,10 @@ Event_Transceiver::parse_args (int argc, char *argv[]) this->role_ = "Consumer"; break; case 'h': - this->host_name_ = get_opt.optarg; + this->host_name_ = get_opt.opt_arg (); break; case 'p': - this->port_number_ = ACE_OS::atoi (get_opt.optarg); + this->port_number_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'S': this->role_ = "Supplier"; diff --git a/examples/ASX/UPIPE_Event_Server/Options.cpp b/examples/ASX/UPIPE_Event_Server/Options.cpp index f497db4fd29..c39f5eefcde 100644 --- a/examples/ASX/UPIPE_Event_Server/Options.cpp +++ b/examples/ASX/UPIPE_Event_Server/Options.cpp @@ -104,46 +104,46 @@ Options::parse_args (int argc, char *argv[]) this->t_flags (THR_BOUND); break; case 'C': - this->consumer_file (getopt.optarg); + this->consumer_file (getopt.opt_arg ()); break; case 'c': - this->consumer_port (getopt.optarg); + this->consumer_port (getopt.opt_arg ()); break; case 'd': this->debugging_ = 1; break; case 'H': - this->high_water_mark (ACE_OS::atoi (getopt.optarg)); + this->high_water_mark (ACE_OS::atoi (getopt.opt_arg ())); break; case 'i': - this->iterations (ACE_OS::atoi (getopt.optarg)); + this->iterations (ACE_OS::atoi (getopt.opt_arg ())); break; case 'L': - this->low_water_mark (ACE_OS::atoi (getopt.optarg)); + this->low_water_mark (ACE_OS::atoi (getopt.opt_arg ())); break; case 'l': - this->initial_queue_length (ACE_OS::atoi (getopt.optarg)); + this->initial_queue_length (ACE_OS::atoi (getopt.opt_arg ())); break; case 'M': - this->message_size (ACE_OS::atoi (getopt.optarg)); + this->message_size (ACE_OS::atoi (getopt.opt_arg ())); break; case 'n': this->t_flags (THR_NEW_LWP); break; case 'S': - this->supplier_file (getopt.optarg); + this->supplier_file (getopt.opt_arg ()); break; case 's': - this->supplier_port (getopt.optarg); + this->supplier_port (getopt.opt_arg ()); break; case 'T': - if (ACE_OS::strcasecmp (getopt.optarg, "ON") == 0) + if (ACE_OS::strcasecmp (getopt.opt_arg (), "ON") == 0) ACE_Trace::start_tracing (); - else if (ACE_OS::strcasecmp (getopt.optarg, "OFF") == 0) + else if (ACE_OS::strcasecmp (getopt.opt_arg (), "OFF") == 0) ACE_Trace::stop_tracing (); break; case 't': - this->thr_count (ACE_OS::atoi (getopt.optarg)); + this->thr_count (ACE_OS::atoi (getopt.opt_arg ())); break; case 'v': this->verbosity_ = 1; diff --git a/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp b/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp index 325456c46d4..0be7305d31b 100644 --- a/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp +++ b/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp @@ -33,7 +33,7 @@ Acceptor_Factory<PH, PK>::init (int argc, char *argv[]) switch (c) { case 'f': - addr.set (get_opt.optarg); + addr.set (get_opt.opt_arg ()); break; case 'd': break; diff --git a/examples/Connection/blocking/SPIPE-acceptor.cpp b/examples/Connection/blocking/SPIPE-acceptor.cpp index 1eec2118bbf..dcbd28c8f99 100644 --- a/examples/Connection/blocking/SPIPE-acceptor.cpp +++ b/examples/Connection/blocking/SPIPE-acceptor.cpp @@ -131,13 +131,13 @@ IPC_Server::parse_args (int argc, char *argv[]) { case 'r': ACE_OS::strncpy (rendezvous_, - ACE_TEXT_CHAR_TO_TCHAR (get_opt.optarg), + ACE_TEXT_CHAR_TO_TCHAR (get_opt.opt_arg ()), sizeof rendezvous_ / sizeof ACE_TCHAR); break; case 't': - n_threads_ = ACE_OS::atoi (get_opt.optarg); + n_threads_ = ACE_OS::atoi (get_opt.opt_arg ()); ACE_DEBUG ((LM_DEBUG, "%s == %d.\n", - get_opt.optarg, + get_opt.opt_arg (), n_threads_)); ACE_Proactor::instance (2 * n_threads_); // This is a lame way to tell the proactor how many threads diff --git a/examples/Connection/blocking/SPIPE-connector.cpp b/examples/Connection/blocking/SPIPE-connector.cpp index 8f8bdaabc92..284417cc1de 100644 --- a/examples/Connection/blocking/SPIPE-connector.cpp +++ b/examples/Connection/blocking/SPIPE-connector.cpp @@ -200,11 +200,11 @@ IPC_Client::parse_args (int argc, char *argv[]) { case 'r': ACE_OS::strncpy (rendezvous_, - ACE_TEXT_CHAR_TO_TCHAR (get_opt.optarg), + ACE_TEXT_CHAR_TO_TCHAR (get_opt.opt_arg ()), sizeof rendezvous_ / sizeof ACE_TCHAR); break; case 'i': - iterations_ = ACE_OS::atoi (get_opt.optarg); + iterations_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'u': default: diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp index 673cdd8caeb..98c01c2bfae 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp @@ -122,28 +122,28 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) this->oneway_ = 0; break; case 'h': - this->host_ = getopt.optarg; + this->host_ = getopt.opt_arg (); break; case 'i': - this->iterations_ = ACE_OS::atoi (getopt.optarg); + this->iterations_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'm': - this->message_len_ = ACE_OS::atoi (getopt.optarg); + this->message_len_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'q': - this->quit_string_ = getopt.optarg; + this->quit_string_ = getopt.opt_arg (); break; case 's': this->io_source_ = ACE_STDIN; break; case 't': - this->threads_ = (size_t) ACE_OS::atoi (getopt.optarg); + this->threads_ = (size_t) ACE_OS::atoi (getopt.opt_arg ()); break; case 'T': - this->sleep_time_.set (0, ACE_OS::atoi (getopt.optarg)); + this->sleep_time_.set (0, ACE_OS::atoi (getopt.opt_arg ())); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp index d928608a7b5..c4d6d46cfa2 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp @@ -168,10 +168,10 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'r': - this->reply_message_len_ = ACE_OS::atoi (getopt.optarg); + this->reply_message_len_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'v': this->verbose_ = 1; diff --git a/examples/IPC_SAP/SSL_SAP/SSL-client-simple.cpp b/examples/IPC_SAP/SSL_SAP/SSL-client-simple.cpp index f82b930dd10..b998c1322a5 100644 --- a/examples/IPC_SAP/SSL_SAP/SSL-client-simple.cpp +++ b/examples/IPC_SAP/SSL_SAP/SSL-client-simple.cpp @@ -107,25 +107,25 @@ Options::parse_args (int argc, char *argv[]) this->oneway_ = 0; break; case 'h': - this->host_ = getopt.optarg; + this->host_ = getopt.opt_arg (); break; case 'i': - this->iterations_ = ACE_OS::atoi (getopt.optarg); + this->iterations_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'm': - this->message_len_ = ACE_OS::atoi (getopt.optarg); + this->message_len_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'q': - this->quit_string_ = getopt.optarg; + this->quit_string_ = getopt.opt_arg (); break; case 's': this->io_source_ = ACE_STDIN; break; case 'T': - this->sleep_time_.set (0, ACE_OS::atoi (getopt.optarg)); + this->sleep_time_.set (0, ACE_OS::atoi (getopt.opt_arg ())); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/examples/IPC_SAP/SSL_SAP/SSL-client.cpp b/examples/IPC_SAP/SSL_SAP/SSL-client.cpp index 84781c6f80c..966292d0d9d 100644 --- a/examples/IPC_SAP/SSL_SAP/SSL-client.cpp +++ b/examples/IPC_SAP/SSL_SAP/SSL-client.cpp @@ -118,28 +118,28 @@ Options::parse_args (int argc, char *argv[]) this->oneway_ = 0; break; case 'h': - this->host_ = getopt.optarg; + this->host_ = getopt.opt_arg (); break; case 'i': - this->iterations_ = ACE_OS::atoi (getopt.optarg); + this->iterations_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'm': - this->message_len_ = ACE_OS::atoi (getopt.optarg); + this->message_len_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'q': - this->quit_string_ = getopt.optarg; + this->quit_string_ = getopt.opt_arg (); break; case 's': this->io_source_ = ACE_STDIN; break; case 't': - this->threads_ = (size_t) ACE_OS::atoi (getopt.optarg); + this->threads_ = (size_t) ACE_OS::atoi (getopt.opt_arg ()); break; case 'T': - this->sleep_time_.set (0, ACE_OS::atoi (getopt.optarg)); + this->sleep_time_.set (0, ACE_OS::atoi (getopt.opt_arg ())); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp b/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp index 4acc024fa64..d50a6366abb 100644 --- a/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp +++ b/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp @@ -179,10 +179,10 @@ Options::parse_args (int argc, char *argv[]) switch (c) { case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'r': - this->reply_message_len_ = ACE_OS::atoi (getopt.optarg); + this->reply_message_len_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'v': this->verbose_ = 1; diff --git a/examples/Logger/Acceptor-server/server_loggerd.cpp b/examples/Logger/Acceptor-server/server_loggerd.cpp index 8faf229e7b7..a67550e9fb7 100644 --- a/examples/Logger/Acceptor-server/server_loggerd.cpp +++ b/examples/Logger/Acceptor-server/server_loggerd.cpp @@ -40,7 +40,7 @@ Options::parse_args (int argc, char *argv[]) switch (c) { case 'p': - this->port_ = ACE_OS::atoi (get_opt.optarg); + this->port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: break; diff --git a/examples/Logger/simple-server/server_loggerd.cpp b/examples/Logger/simple-server/server_loggerd.cpp index b4e3161b236..d35c6c8eb15 100644 --- a/examples/Logger/simple-server/server_loggerd.cpp +++ b/examples/Logger/simple-server/server_loggerd.cpp @@ -46,7 +46,7 @@ main (int argc, char *argv[]) switch (c) { case 'p': - addr.set (ACE_OS::atoi (get_opt.optarg)); + addr.set (ACE_OS::atoi (get_opt.opt_arg ())); break; default: break; diff --git a/examples/Mem_Map/IO-tests/test_io.cpp b/examples/Mem_Map/IO-tests/test_io.cpp index e9ecaf87b88..934bf31a7fb 100644 --- a/examples/Mem_Map/IO-tests/test_io.cpp +++ b/examples/Mem_Map/IO-tests/test_io.cpp @@ -61,13 +61,13 @@ parse_args (int argc, char *argv[]) switch (c) { case 'i': - input_filename = get_opt.optarg; + input_filename = get_opt.opt_arg (); break; case 'n': - iteration_count = ACE_OS::atoi (get_opt.optarg); + iteration_count = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'o': - output_filename = get_opt.optarg; + output_filename = get_opt.opt_arg (); break; case 'r': remove_output = 0; diff --git a/examples/Misc/test_get_opt.cpp b/examples/Misc/test_get_opt.cpp index 756acb64ea7..69cf02a4059 100644 --- a/examples/Misc/test_get_opt.cpp +++ b/examples/Misc/test_get_opt.cpp @@ -20,32 +20,32 @@ main (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "got a\n")); break; case 'b': - ACE_DEBUG ((LM_DEBUG, "got b with arg %s\n", get_opt.optarg)); + ACE_DEBUG ((LM_DEBUG, "got b with arg %s\n", get_opt.opt_arg ())); break; case 'c': ACE_DEBUG ((LM_DEBUG, "got c\n")); break; case 'd': - ACE_DEBUG ((LM_DEBUG, "got d with arg %s\n", get_opt.optarg)); + ACE_DEBUG ((LM_DEBUG, "got d with arg %s\n", get_opt.opt_arg ())); break; case 'e': ACE_DEBUG ((LM_DEBUG, "got e\n")); break; case 'f': - ACE_DEBUG ((LM_DEBUG, "got f with arg %s\n", get_opt.optarg)); + ACE_DEBUG ((LM_DEBUG, "got f with arg %s\n", get_opt.opt_arg ())); break; case 'g': ACE_DEBUG ((LM_DEBUG, "got g\n")); break; case 'h': - ACE_DEBUG ((LM_DEBUG, "got h with arg %s\n", get_opt.optarg)); + ACE_DEBUG ((LM_DEBUG, "got h with arg %s\n", get_opt.opt_arg ())); break; default: ACE_DEBUG ((LM_DEBUG, "got %c, which is unrecognized!\n", c)); break; } - for (int i = get_opt.optind; i < argc; i++) + for (int i = get_opt.opt_ind (); i < argc; i++) ACE_DEBUG ((LM_DEBUG, "optind = %d, argv[optind] = %s\n", i, argv[i])); diff --git a/examples/NT_Service/main.cpp b/examples/NT_Service/main.cpp index c517615a11e..5f23fa3fb7d 100644 --- a/examples/NT_Service/main.cpp +++ b/examples/NT_Service/main.cpp @@ -100,7 +100,7 @@ Process::parse_args (int argc, ACE_TCHAR* argv[]) { case 'i': opt_install = 1; - opt_startup = ACE_OS::atoi (get_opt.optarg); + opt_startup = ACE_OS::atoi (get_opt.opt_arg ()); if (opt_startup <= 0) print_usage_and_die (); break; @@ -115,7 +115,7 @@ Process::parse_args (int argc, ACE_TCHAR* argv[]) break; case 't': opt_type = 1; - opt_startup = ACE_OS::atoi (get_opt.optarg); + opt_startup = ACE_OS::atoi (get_opt.opt_arg ()); if (opt_startup <= 0) print_usage_and_die (); break; @@ -125,7 +125,7 @@ Process::parse_args (int argc, ACE_TCHAR* argv[]) default: // -i can also be given without a value - if so, it defaults // to defined value. - if (ACE_OS::strcmp (get_opt.argv_[get_opt.optind-1], ACE_TEXT ("-i")) == 0) + if (ACE_OS::strcmp (get_opt.argv ()[get_opt.opt_ind () - 1], ACE_TEXT ("-i")) == 0) { opt_install = 1; opt_startup = DEFAULT_SERVICE_INIT_STARTUP; diff --git a/examples/OS/Process/imore.cpp b/examples/OS/Process/imore.cpp index 5f1d120b983..981b416b2bb 100644 --- a/examples/OS/Process/imore.cpp +++ b/examples/OS/Process/imore.cpp @@ -79,13 +79,13 @@ parse_args (int argc, char **argv) } } - if (get_opt.optind >= argc) // Do you forget to give me a filename to "more?" + if (get_opt.opt_ind () >= argc) // Do you forget to give me a filename to "more?" { usage (); return -1; } else - fname = argv[get_opt.optind]; // Alright. + fname = argv[get_opt.opt_int ()]; // Alright. return 0; } diff --git a/examples/OS/Process/process.cpp b/examples/OS/Process/process.cpp index 8b05831a303..8acdc3a579c 100644 --- a/examples/OS/Process/process.cpp +++ b/examples/OS/Process/process.cpp @@ -74,13 +74,13 @@ parse_args (int argc, char **argv) run_ls = 1; break; case 'x': - executable = get_opt.optarg; + executable = get_opt.opt_arg (); break; case 'p': - print_file = get_opt.optarg; + print_file = get_opt.opt_arg (); break; case 'e': - environment_string = get_opt.optarg; + environment_string = get_opt.opt_arg (); break; case 'g': get_env = 1; diff --git a/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.cpp b/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.cpp index d75e9343ba6..9a72bf56df1 100644 --- a/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.cpp +++ b/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.cpp @@ -43,16 +43,16 @@ QoS_Util::parse_args (void) { case 'm': // multicast session address. this->multicast_flag_ = 1; - this->mult_session_addr_->set (get_opts.optarg); + this->mult_session_addr_->set (get_opts.opt_arg ()); break; case 'n': // to be used by Senders only to specify the destination. - this->dest_addr_->set (get_opts.optarg); + this->dest_addr_->set (get_opts.opt_arg ()); break; case 'p': // protocol. - if (ACE_OS::strcasecmp (get_opts.optarg, "tcp") == 0) + if (ACE_OS::strcasecmp (get_opts.opt_arg (), "tcp") == 0) this->protocol_ = IPPROTO_TCP; else - if (ACE_OS::strcasecmp (get_opts.optarg, "udp") == 0) + if (ACE_OS::strcasecmp (get_opts.opt_arg (), "udp") == 0) this->protocol_ = IPPROTO_UDP; else ACE_DEBUG ((LM_DEBUG, @@ -60,7 +60,7 @@ QoS_Util::parse_args (void) "UDP assumed\n")); break; case 'P': // sender source port. - this->source_port_ = ACE_OS::atoi (get_opts.optarg); + this->source_port_ = ACE_OS::atoi (get_opts.opt_arg ()); break; case 'h': // display help for different options. default: diff --git a/examples/QOS/Change_Sender_TSpec/QoS_Util.cpp b/examples/QOS/Change_Sender_TSpec/QoS_Util.cpp index d75e9343ba6..9a72bf56df1 100644 --- a/examples/QOS/Change_Sender_TSpec/QoS_Util.cpp +++ b/examples/QOS/Change_Sender_TSpec/QoS_Util.cpp @@ -43,16 +43,16 @@ QoS_Util::parse_args (void) { case 'm': // multicast session address. this->multicast_flag_ = 1; - this->mult_session_addr_->set (get_opts.optarg); + this->mult_session_addr_->set (get_opts.opt_arg ()); break; case 'n': // to be used by Senders only to specify the destination. - this->dest_addr_->set (get_opts.optarg); + this->dest_addr_->set (get_opts.opt_arg ()); break; case 'p': // protocol. - if (ACE_OS::strcasecmp (get_opts.optarg, "tcp") == 0) + if (ACE_OS::strcasecmp (get_opts.opt_arg (), "tcp") == 0) this->protocol_ = IPPROTO_TCP; else - if (ACE_OS::strcasecmp (get_opts.optarg, "udp") == 0) + if (ACE_OS::strcasecmp (get_opts.opt_arg (), "udp") == 0) this->protocol_ = IPPROTO_UDP; else ACE_DEBUG ((LM_DEBUG, @@ -60,7 +60,7 @@ QoS_Util::parse_args (void) "UDP assumed\n")); break; case 'P': // sender source port. - this->source_port_ = ACE_OS::atoi (get_opts.optarg); + this->source_port_ = ACE_OS::atoi (get_opts.opt_arg ()); break; case 'h': // display help for different options. default: diff --git a/examples/QOS/Simple/QoS_Util.cpp b/examples/QOS/Simple/QoS_Util.cpp index d75e9343ba6..9a72bf56df1 100644 --- a/examples/QOS/Simple/QoS_Util.cpp +++ b/examples/QOS/Simple/QoS_Util.cpp @@ -43,16 +43,16 @@ QoS_Util::parse_args (void) { case 'm': // multicast session address. this->multicast_flag_ = 1; - this->mult_session_addr_->set (get_opts.optarg); + this->mult_session_addr_->set (get_opts.opt_arg ()); break; case 'n': // to be used by Senders only to specify the destination. - this->dest_addr_->set (get_opts.optarg); + this->dest_addr_->set (get_opts.opt_arg ()); break; case 'p': // protocol. - if (ACE_OS::strcasecmp (get_opts.optarg, "tcp") == 0) + if (ACE_OS::strcasecmp (get_opts.opt_arg (), "tcp") == 0) this->protocol_ = IPPROTO_TCP; else - if (ACE_OS::strcasecmp (get_opts.optarg, "udp") == 0) + if (ACE_OS::strcasecmp (get_opts.opt_arg (), "udp") == 0) this->protocol_ = IPPROTO_UDP; else ACE_DEBUG ((LM_DEBUG, @@ -60,7 +60,7 @@ QoS_Util::parse_args (void) "UDP assumed\n")); break; case 'P': // sender source port. - this->source_port_ = ACE_OS::atoi (get_opts.optarg); + this->source_port_ = ACE_OS::atoi (get_opts.opt_arg ()); break; case 'h': // display help for different options. default: diff --git a/examples/Reactor/Multicast/client.cpp b/examples/Reactor/Multicast/client.cpp index 10c16b7c24a..2845d556cf0 100644 --- a/examples/Reactor/Multicast/client.cpp +++ b/examples/Reactor/Multicast/client.cpp @@ -33,10 +33,10 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'm': - max_message_size = ACE_OS::atoi (getopt.optarg) * BUFSIZ; + max_message_size = ACE_OS::atoi (getopt.opt_arg ()) * BUFSIZ; break; case 'i': - iterations = ACE_OS::atoi (getopt.optarg); + iterations = ACE_OS::atoi (getopt.opt_arg ()); break; case 'u': // usage fallthrough diff --git a/examples/Reactor/Ntalker/ntalker.cpp b/examples/Reactor/Ntalker/ntalker.cpp index 6b0038289de..e114876cfcb 100644 --- a/examples/Reactor/Ntalker/ntalker.cpp +++ b/examples/Reactor/Ntalker/ntalker.cpp @@ -186,7 +186,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - INTERFACE = get_opt.optarg; + INTERFACE = get_opt.opt_arg (); break; case 'u': // Usage fallthrough. diff --git a/examples/Reactor/Proactor/simple_test_proactor.cpp b/examples/Reactor/Proactor/simple_test_proactor.cpp index cbb7a6d9164..511b95d956c 100644 --- a/examples/Reactor/Proactor/simple_test_proactor.cpp +++ b/examples/Reactor/Proactor/simple_test_proactor.cpp @@ -230,10 +230,10 @@ parse_args (int argc, char *argv[]) switch (c) { case 'f': - file = get_opt.optarg; + file = get_opt.opt_arg (); break; case 'd': - dump_file = get_opt.optarg; + dump_file = get_opt.opt_arg (); break; default: ACE_ERROR ((LM_ERROR, "%p.\n", diff --git a/examples/Reactor/Proactor/test_cancel.cpp b/examples/Reactor/Proactor/test_cancel.cpp index f9dc8cc5521..5823fe82de6 100644 --- a/examples/Reactor/Proactor/test_cancel.cpp +++ b/examples/Reactor/Proactor/test_cancel.cpp @@ -223,10 +223,10 @@ parse_args (int argc, char *argv[]) switch (c) { case 'p': - port = ACE_OS::atoi (get_opt.optarg); + port = ACE_OS::atoi (get_opt.opt_arg ()); break; case 's': - read_size = ACE_OS::atoi (get_opt.optarg); + read_size = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR ((LM_ERROR, "%p.\n", diff --git a/examples/Reactor/Proactor/test_proactor.cpp b/examples/Reactor/Proactor/test_proactor.cpp index 9eaf6c99e5a..a2ec5dd138c 100644 --- a/examples/Reactor/Proactor/test_proactor.cpp +++ b/examples/Reactor/Proactor/test_proactor.cpp @@ -640,16 +640,16 @@ parse_args (int argc, char *argv[]) switch (c) { case 'h': - host = get_opt.optarg; + host = get_opt.opt_arg (); break; case 'p': - port = ACE_OS::atoi (get_opt.optarg); + port = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'f': - file = get_opt.optarg; + file = get_opt.opt_arg (); break; case 'd': - dump_file = get_opt.optarg; + dump_file = get_opt.opt_arg (); break; default: ACE_ERROR ((LM_ERROR, "%p.\n", diff --git a/examples/Reactor/Proactor/test_proactor2.cpp b/examples/Reactor/Proactor/test_proactor2.cpp index 1f972d1c018..384de47be02 100644 --- a/examples/Reactor/Proactor/test_proactor2.cpp +++ b/examples/Reactor/Proactor/test_proactor2.cpp @@ -636,16 +636,16 @@ parse_args (int argc, char *argv[]) switch (c) { case 'h': - host = get_opt.optarg; + host = get_opt.opt_arg (); break; case 'n': - nThreads = ACE_OS::atoi (get_opt.optarg) ; + nThreads = ACE_OS::atoi (get_opt.opt_arg ()) ; break; case 'p': - port = ACE_OS::atoi (get_opt.optarg); + port = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': - duplex = ACE_OS::atoi (get_opt.optarg); + duplex = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR ((LM_ERROR, "%p.\n", diff --git a/examples/Reactor/Proactor/test_proactor3.cpp b/examples/Reactor/Proactor/test_proactor3.cpp index 38b9d3c0daa..d651bb5341d 100644 --- a/examples/Reactor/Proactor/test_proactor3.cpp +++ b/examples/Reactor/Proactor/test_proactor3.cpp @@ -674,27 +674,27 @@ parse_args (int argc, char *argv[]) switch (c) { case 'd': // duplex - duplex = ACE_OS::atoi (get_opt.optarg); + duplex = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'h': // host for sender - host = get_opt.optarg; + host = get_opt.opt_arg (); break; case 'p': // port number - port = ACE_OS::atoi (get_opt.optarg); + port = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'n': // thread pool size - threads = ACE_OS::atoi (get_opt.optarg); + threads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 's': // number of senders - senders = ACE_OS::atoi (get_opt.optarg); + senders = ACE_OS::atoi (get_opt.opt_arg ()); if (senders > MaxSenders) senders = MaxSenders; break; case 'o': // max number of aio for proactor - max_aio_operations = ACE_OS::atoi (get_opt.optarg); + max_aio_operations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': // Proactor Type - if (set_proactor_type (get_opt.optarg)) + if (set_proactor_type (get_opt.opt_arg ())) break; case 'u': default: diff --git a/examples/Reactor/Proactor/test_udp_proactor.cpp b/examples/Reactor/Proactor/test_udp_proactor.cpp index 88f48937620..31029eab233 100644 --- a/examples/Reactor/Proactor/test_udp_proactor.cpp +++ b/examples/Reactor/Proactor/test_udp_proactor.cpp @@ -372,10 +372,10 @@ parse_args (int argc, char *argv[]) switch (c) { case 'h': - host = get_opt.optarg; + host = get_opt.opt_arg (); break; case 'p': - port = ACE_OS::atoi (get_opt.optarg); + port = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", diff --git a/examples/Reactor/WFMO_Reactor/test_multithreading.cpp b/examples/Reactor/WFMO_Reactor/test_multithreading.cpp index b0a3bdca5fc..e2982059b49 100644 --- a/examples/Reactor/WFMO_Reactor/test_multithreading.cpp +++ b/examples/Reactor/WFMO_Reactor/test_multithreading.cpp @@ -60,19 +60,19 @@ parse_args (int argc, char **argv) switch (c) { case 't': - concurrent_threads = atoi (get_opt.optarg); + concurrent_threads = atoi (get_opt.opt_arg ()); break; case 'e': - iterations = atoi (get_opt.optarg); + iterations = atoi (get_opt.opt_arg ()); break; case 'h': - number_of_handles = atoi (get_opt.optarg); + number_of_handles = atoi (get_opt.opt_arg ()); break; case 'i': - interval = atoi (get_opt.optarg); + interval = atoi (get_opt.opt_arg ()); break; case 's': - number_of_handles_to_signal = atoi (get_opt.optarg); + number_of_handles_to_signal = atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); diff --git a/examples/Reactor/WFMO_Reactor/test_talker.cpp b/examples/Reactor/WFMO_Reactor/test_talker.cpp index 76d6a5f12d0..84ccb8a78b6 100644 --- a/examples/Reactor/WFMO_Reactor/test_talker.cpp +++ b/examples/Reactor/WFMO_Reactor/test_talker.cpp @@ -269,10 +269,10 @@ Peer_Handler::Peer_Handler (int argc, char *argv[]) switch (c) { case 'h': - host_ = get_opt.optarg; + host_ = get_opt.opt_arg (); break; case 'p': - port_ = ACE_OS::atoi (get_opt.optarg); + port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; } } diff --git a/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp index 8d8c0b15e19..aeba5fbc4da 100644 --- a/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp @@ -33,7 +33,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'p': - broadcast_port_number = ACE_OS::atoi (get_opt.optarg); + broadcast_port_number = ACE_OS::atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); diff --git a/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp index 9e8aeef81ef..d36e916ec1f 100644 --- a/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp @@ -38,13 +38,13 @@ parse_args (int argc, char *argv[]) switch (c) { case 'f': - file_name = get_opt.optarg; + file_name = get_opt.opt_arg (); break; case 'r': - rendezvous_dgram = get_opt.optarg; + rendezvous_dgram = get_opt.opt_arg (); break; case 'c': - rendezvous_codgram = get_opt.optarg; + rendezvous_codgram = get_opt.opt_arg (); break; default: print_usage_and_die (); diff --git a/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp index 03418e46d80..2c6fdc7818e 100644 --- a/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp @@ -45,7 +45,7 @@ parse_arguments (int argc, ACE_TCHAR *argv[]) debug = 1; break; case 'f': - rendezvous_fifo = get_opt.optarg; + rendezvous_fifo = get_opt.opt_arg (); break; default: print_usage_and_die (); diff --git a/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp index 607bc81ea3a..93216dca095 100644 --- a/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp @@ -40,10 +40,10 @@ parse_args (int argc, char *argv[]) switch (c) { case 'f': - file_name = get_opt.optarg; + file_name = get_opt.opt_arg (); break; case 'r': - rendezvous = get_opt.optarg; + rendezvous = get_opt.opt_arg (); break; default: print_usage_and_die (); diff --git a/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp index be6a6d6be27..706a857b3a9 100644 --- a/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp @@ -44,7 +44,7 @@ parse_arguments (int argc, char *argv[]) debug = 1; break; case 'r': - rendezvous_spipe = get_opt.optarg; + rendezvous_spipe = get_opt.opt_arg (); break; default: print_usage_and_die (); diff --git a/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp index 28a51b26509..350d3cdca4b 100644 --- a/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp @@ -37,10 +37,10 @@ parse_args (int argc, char *argv[]) switch (c) { case 'f': - file_name = get_opt.optarg; + file_name = get_opt.opt_arg (); break; case 'r': - rendezvous = get_opt.optarg; + rendezvous = get_opt.opt_arg (); break; default: print_usage_and_die (); 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 739c87f6be0..24ad5ac7f09 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 @@ -41,13 +41,13 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'f': - file_name = get_opt.optarg; + file_name = get_opt.opt_arg (); break; case 'h': - host_name = get_opt.optarg; + host_name = get_opt.opt_arg (); break; case 'p': - port_number = ACE_OS::atoi (get_opt.optarg); + port_number = ACE_OS::atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); 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 cb2652b1f9c..18d1b23bff8 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 @@ -35,10 +35,10 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'h': - host_name = get_opt.optarg; + host_name = get_opt.opt_arg (); break; case 'p': - port_number = ACE_OS::atoi (get_opt.optarg); + port_number = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'r': remote_reconfigure = 1; 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 ba81947b315..6684d67bd2c 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 @@ -42,13 +42,13 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'f': - file_name = get_opt.optarg; + file_name = get_opt.opt_arg (); break; case 'h': - host_name = get_opt.optarg; + host_name = get_opt.opt_arg (); break; case 'p': - port_number = ACE_OS::atoi (get_opt.optarg); + port_number = ACE_OS::atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); 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 8d5b4575cf4..3a5a91facdf 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 @@ -42,13 +42,13 @@ parse_args (int argc, char *argv[]) switch (c) { case 'f': - file_name = get_opt.optarg; + file_name = get_opt.opt_arg (); break; case 'h': - host_name = get_opt.optarg; + host_name = get_opt.opt_arg (); break; case 'p': - port_number = ACE_OS::atoi (get_opt.optarg); + port_number = ACE_OS::atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.i b/examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.i index 172597705c4..2d960f3e9dd 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.i @@ -52,7 +52,7 @@ Handle_Broadcast::init (int argc, char *argv[]) switch (c) { case 'p': - sba.set (ACE_OS::atoi (get_opt.optarg)); + sba.set (ACE_OS::atoi (get_opt.opt_arg ())); break; default: break; 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 0574138cc2e..4865b5eaa36 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i @@ -49,7 +49,7 @@ Handle_L_CODgram::init (int argc, char *argv[]) switch (c) { case 'r': - r = get_opt.optarg; + r = get_opt.opt_arg (); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.i b/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.i index 0fca5d4d2d5..295bdd7d76d 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.i @@ -48,7 +48,7 @@ Handle_L_Dgram::init (int argc, char *argv[]) switch (c) { case 'r': - r = get_opt.optarg; + r = get_opt.opt_arg (); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.i b/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.i index 5c98ecf30b3..930b4390fd8 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.i @@ -45,7 +45,7 @@ Handle_L_FIFO::init (int argc, char *argv[]) switch (c) { case 'r': - rendezvous_fifo = get_opt.optarg; + rendezvous_fifo = get_opt.opt_arg (); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.i b/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.i index 84e648d4ecb..a48081058e1 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.i @@ -53,7 +53,7 @@ Handle_L_Pipe::init (int argc, char *argv[]) switch (c) { case 'r': - r = get_opt.optarg; + r = get_opt.opt_arg (); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.i b/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.i index b3cb6005b58..209acc871de 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.i @@ -50,7 +50,7 @@ Handle_L_SPIPE::init (int argc, char *argv[]) switch (c) { case 'r': - rendezvous = get_opt.optarg; + rendezvous = get_opt.opt_arg (); break; default: break; 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 b395f3149f8..465eb3e2fbe 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i @@ -58,7 +58,7 @@ Handle_L_Stream::init (int argc, char *argv[]) switch (c) { case 'r': - r = get_opt.optarg; + r = get_opt.opt_arg (); break; default: break; 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 e39c1fce30b..505735ba3ed 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i @@ -47,7 +47,7 @@ Handle_R_Dgram::init (int argc, char *argv[]) switch (c) { case 'p': - sidg.set (ACE_OS::atoi (get_opt.optarg)); + sidg.set (ACE_OS::atoi (get_opt.opt_arg ())); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.i b/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.i index 73c2af2e489..f6599713678 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.i @@ -54,7 +54,7 @@ Handle_R_Stream::init (int argc, char *argv[]) switch (c) { case 'p': - sis.set (ACE_OS::atoi (get_opt.optarg)); + sis.set (ACE_OS::atoi (get_opt.opt_arg ())); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp b/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp index 00c75f552bd..18e9951d41d 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp +++ b/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp @@ -66,10 +66,10 @@ Handle_Thr_Acceptor<SVH, PR_AC_2>::init (int argc, char *argv[]) switch (c) { case 'p': - local_addr.set (ACE_OS::atoi (get_opt.optarg)); + local_addr.set (ACE_OS::atoi (get_opt.opt_arg ())); break; case 't': - n_threads = ACE_OS::atoi (get_opt.optarg); + n_threads = ACE_OS::atoi (get_opt.opt_arg ()); break; default: break; diff --git a/examples/Service_Configurator/IPC-tests/server/Handle_Timeout.i b/examples/Service_Configurator/IPC-tests/server/Handle_Timeout.i index be6ea286a9a..40baa000008 100644 --- a/examples/Service_Configurator/IPC-tests/server/Handle_Timeout.i +++ b/examples/Service_Configurator/IPC-tests/server/Handle_Timeout.i @@ -35,13 +35,13 @@ Handle_Timeout::init (int argc, char *argv[]) switch (c) { case 'd': - delta.sec (ACE_OS::atoi (get_opt.optarg)); + delta.sec (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'i': - interval.sec (ACE_OS::atoi (get_opt.optarg)); + interval.sec (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'a': - arg = atoi (get_opt.optarg); + arg = atoi (get_opt.opt_arg ()); break; default: break; diff --git a/examples/Shared_Malloc/Options.cpp b/examples/Shared_Malloc/Options.cpp index 90a84b458e0..3338c55a810 100644 --- a/examples/Shared_Malloc/Options.cpp +++ b/examples/Shared_Malloc/Options.cpp @@ -160,13 +160,13 @@ Options::parse_args (int argc, char *argv[]) this->use_sbrk_ = 0; break; case 'L': - this->max_msg_size_ = ACE_OS::atoi (get_opt.optarg); + this->max_msg_size_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'm': this->use_mmap_ = 1; break; case 'n': - this->iteration_count_ = ACE_OS::atoi (get_opt.optarg); + this->iteration_count_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'p': // Spawn processes rather than threads this->spawn_threads_ = 0; @@ -176,7 +176,7 @@ Options::parse_args (int argc, char *argv[]) this->use_shmem_ = 1; break; case 't': - this->spawn_count_ = ACE_OS::atoi (get_opt.optarg); + this->spawn_count_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'T': ACE_Trace::start_tracing (); diff --git a/examples/Shared_Malloc/test_position_independent_malloc.cpp b/examples/Shared_Malloc/test_position_independent_malloc.cpp index 3203b700601..1938fd68607 100644 --- a/examples/Shared_Malloc/test_position_independent_malloc.cpp +++ b/examples/Shared_Malloc/test_position_independent_malloc.cpp @@ -129,7 +129,7 @@ parse_args (int argc, char *argv[]) case 'a': // Override the default base address. base_addr = ACE_reinterpret_cast (void *, - ACE_OS::atoi (get_opt.optarg)); + ACE_OS::atoi (get_opt.opt_arg ())); break; case 'T': ACE_Trace::start_tracing (); diff --git a/examples/Synch/proc_sema.cpp b/examples/Synch/proc_sema.cpp index a0a15099b3c..85d829c9d3c 100644 --- a/examples/Synch/proc_sema.cpp +++ b/examples/Synch/proc_sema.cpp @@ -67,13 +67,13 @@ int main (int argc, ACE_TCHAR *argv[]) delete_sema = 1; break; case 'n': // Specify the name of the semaphore. - sema_name = getopt.optarg; + sema_name = getopt.opt_arg (); break; case 'i': // Number of acquire/release we'll perform. - iteration = ACE_OS::atoi (getopt.optarg); + iteration = ACE_OS::atoi (getopt.opt_arg ()); break; case 'd': - exit_delay = ACE_OS::atoi (getopt.optarg); + exit_delay = ACE_OS::atoi (getopt.opt_arg ()); break; default: return -1; diff --git a/examples/Threads/process_manager.cpp b/examples/Threads/process_manager.cpp index 4a772b86142..7b5fcc19a49 100644 --- a/examples/Threads/process_manager.cpp +++ b/examples/Threads/process_manager.cpp @@ -135,10 +135,10 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - n_iterations = ACE_OS::atoi (get_opt.optarg); + n_iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'e': - exit_code = ACE_OS::atoi (get_opt.optarg); + exit_code = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'c': child = 1; diff --git a/examples/Threads/reader_writer.cpp b/examples/Threads/reader_writer.cpp index c5844abac54..34d4cc6ae57 100644 --- a/examples/Threads/reader_writer.cpp +++ b/examples/Threads/reader_writer.cpp @@ -58,16 +58,16 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'r': - n_readers = ACE_OS::atoi (get_opt.optarg); + n_readers = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'w': - n_writers = ACE_OS::atoi (get_opt.optarg); + n_writers = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'n': - n_iterations = ACE_OS::atoi (get_opt.optarg); + n_iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'l': - n_loops = ACE_OS::atoi (get_opt.optarg); + n_loops = ACE_OS::atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); diff --git a/examples/Threads/recursive_mutex.cpp b/examples/Threads/recursive_mutex.cpp index ef019fdc3fb..33a276207dd 100644 --- a/examples/Threads/recursive_mutex.cpp +++ b/examples/Threads/recursive_mutex.cpp @@ -38,10 +38,10 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'n': - n_iterations = ACE_OS::atoi (get_opt.optarg); + n_iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': - n_threads = ACE_OS::atoi (get_opt.optarg); + n_threads = ACE_OS::atoi (get_opt.opt_arg ()); break; default: print_usage_and_die (); diff --git a/examples/Web_Crawler/Options.cpp b/examples/Web_Crawler/Options.cpp index 89b8e90e5bc..b9c7585a807 100644 --- a/examples/Web_Crawler/Options.cpp +++ b/examples/Web_Crawler/Options.cpp @@ -35,27 +35,27 @@ Options::parse_args (int argc, char *argv[]) this->debug_ = 1; break; case 'f': - this->url_filter_ = getopt.optarg; + this->url_filter_ = getopt.opt_arg (); break; case 'h': - this->hostname_ = getopt.optarg; + this->hostname_ = getopt.opt_arg (); break; case 'i': - this->uri_ = getopt.optarg; + this->uri_ = getopt.opt_arg (); break; case 'l': - this->handle_limit_ = ACE_OS::atoi (getopt.optarg); + this->handle_limit_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'r': this->recurse_ = 1; break; case 't': - this->timeout_.sec (ACE_OS::atoi (getopt.optarg)); + this->timeout_.sec (ACE_OS::atoi (getopt.opt_arg ())); break; case 'u': { - this->hostname_ = getopt.optarg; - char *s = ACE_OS::strchr (getopt.optarg, '/'); + this->hostname_ = getopt.opt_arg (); + char *s = ACE_OS::strchr (getopt.opt_arg (), '/'); if (s != 0) { this->uri_ = s + 1; @@ -64,7 +64,7 @@ Options::parse_args (int argc, char *argv[]) else ACE_ERROR ((LM_ERROR, "invalid URL %s\n", - getopt.optarg)); + getopt.opt_arg ())); } break; case 'v': @@ -72,11 +72,11 @@ Options::parse_args (int argc, char *argv[]) break; case 'o': { - this->order_ = getopt.optarg; + this->order_ = getopt.opt_arg (); } break; case 'p': - this->port_no_ = ACE_OS::atoi (getopt.optarg); + this->port_no_ = ACE_OS::atoi (getopt.opt_arg ()); break; default: ACE_ERROR ((LM_ERROR, diff --git a/netsvcs/clients/Tokens/collection/collection.cpp b/netsvcs/clients/Tokens/collection/collection.cpp index 822240f6a9f..c6d223ed095 100644 --- a/netsvcs/clients/Tokens/collection/collection.cpp +++ b/netsvcs/clients/Tokens/collection/collection.cpp @@ -100,18 +100,18 @@ parse_args (int argc, char *argv[]) switch (c) { case 'h': // specify the host machine on which the server is running - server_host = get_opt.optarg; + server_host = get_opt.opt_arg (); remote = 1; break; case 'p': // specify the port on which the server is running - server_port = ACE_OS::atoi (get_opt.optarg); + server_port = ACE_OS::atoi (get_opt.opt_arg ()); remote = 1; break; case 'd': debug = 1; break; case 'n': - iterations = ACE_OS::atoi (get_opt.optarg); + iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'u': // usage: fallthrough diff --git a/netsvcs/clients/Tokens/collection/rw_locks.cpp b/netsvcs/clients/Tokens/collection/rw_locks.cpp index e48f0e5db0d..2a64f8d9786 100644 --- a/netsvcs/clients/Tokens/collection/rw_locks.cpp +++ b/netsvcs/clients/Tokens/collection/rw_locks.cpp @@ -82,16 +82,16 @@ parse_args (int argc, char *argv[]) switch (c) { case 'h': // specify the host machine on which the server is running - server_host = get_opt.optarg; + server_host = get_opt.opt_arg (); break; case 'p': // specify the port on which the server is running - server_port = ACE_OS::atoi (get_opt.optarg); + server_port = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': - threads = ACE_OS::atoi (get_opt.optarg); + threads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'R': - reads = ACE_OS::atoi (get_opt.optarg); + reads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': debug = 1; @@ -103,7 +103,7 @@ parse_args (int argc, char *argv[]) write_sleep = 1; break; case 'n': - iterations = ACE_OS::atoi (get_opt.optarg); + iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'i': ignore_deadlock = 1; diff --git a/netsvcs/clients/Tokens/deadlock/deadlock_detection_test.cpp b/netsvcs/clients/Tokens/deadlock/deadlock_detection_test.cpp index 9b4c12b77e1..46a9daabf80 100644 --- a/netsvcs/clients/Tokens/deadlock/deadlock_detection_test.cpp +++ b/netsvcs/clients/Tokens/deadlock/deadlock_detection_test.cpp @@ -184,15 +184,15 @@ parse_args (int argc, char *argv[]) ignore_deadlock = 1; break; case 'h': - server_host = get_opt.optarg; + server_host = get_opt.opt_arg (); remote_mutexes = 1; break; case 'p': - server_port = ACE_OS::atoi (get_opt.optarg); + server_port = ACE_OS::atoi (get_opt.opt_arg ()); remote_mutexes = 1; break; case 'n': - iterations = ACE_OS::atoi (get_opt.optarg); + iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'u': default: diff --git a/netsvcs/clients/Tokens/manual/manual.cpp b/netsvcs/clients/Tokens/manual/manual.cpp index 1393150f751..9574fc7edb6 100644 --- a/netsvcs/clients/Tokens/manual/manual.cpp +++ b/netsvcs/clients/Tokens/manual/manual.cpp @@ -111,11 +111,11 @@ STDIN_Token::parse_args (int argc, char *argv[]) switch (c) { case 'h': // specify the host machine on which the server is running - server_host_ = get_opt.optarg; + server_host_ = get_opt.opt_arg (); remote_ = 1; break; case 'p': // specify the port on which the server is running - server_port_ = ACE_OS::atoi (get_opt.optarg); + server_port_ = ACE_OS::atoi (get_opt.opt_arg ()); remote_ = 1; break; case 'd': diff --git a/netsvcs/clients/Tokens/mutex/test_mutex.cpp b/netsvcs/clients/Tokens/mutex/test_mutex.cpp index b15243dffba..c291981789d 100644 --- a/netsvcs/clients/Tokens/mutex/test_mutex.cpp +++ b/netsvcs/clients/Tokens/mutex/test_mutex.cpp @@ -77,18 +77,18 @@ parse_args (int argc, char *argv[]) switch (c) { case 't': - spawn_count = ACE_OS::atoi (get_opt.optarg); + spawn_count = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'h': // specify the host machine on which the server is running - server_host = get_opt.optarg; + server_host = get_opt.opt_arg (); remote_mutexes = 1; break; case 'p': // specify the port on which the server is running - server_port = ACE_OS::atoi (get_opt.optarg); + server_port = ACE_OS::atoi (get_opt.opt_arg ()); remote_mutexes = 1; break; case 'n': // specify the port on which the server is running - iterations = ACE_OS::atoi (get_opt.optarg); + iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'u': default: diff --git a/netsvcs/clients/Tokens/rw_lock/rw_locks.cpp b/netsvcs/clients/Tokens/rw_lock/rw_locks.cpp index f9d8da9eb9c..098d2bd9d84 100644 --- a/netsvcs/clients/Tokens/rw_lock/rw_locks.cpp +++ b/netsvcs/clients/Tokens/rw_lock/rw_locks.cpp @@ -150,21 +150,21 @@ parse_args (int argc, char *argv[]) switch (c) { case 'h': // specify the host machine on which the server is running - server_host = get_opt.optarg; + server_host = get_opt.opt_arg (); remote = 1; break; case 'p': // specify the port on which the server is running - server_port = ACE_OS::atoi (get_opt.optarg); + server_port = ACE_OS::atoi (get_opt.opt_arg ()); remote = 1; break; case 't': - threads = ACE_OS::atoi (get_opt.optarg); + threads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'R': renew = 1; break; case 'r': - reads = ACE_OS::atoi (get_opt.optarg); + reads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': debug = 1; @@ -173,7 +173,7 @@ parse_args (int argc, char *argv[]) write_sleep = 1; break; case 'n': - iterations = ACE_OS::atoi (get_opt.optarg); + iterations = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'i': ignore_deadlock = 1; diff --git a/netsvcs/lib/Client_Logging_Handler.cpp b/netsvcs/lib/Client_Logging_Handler.cpp index 8fe4c6d5fbf..7d3e10b32e7 100644 --- a/netsvcs/lib/Client_Logging_Handler.cpp +++ b/netsvcs/lib/Client_Logging_Handler.cpp @@ -500,14 +500,14 @@ ACE_Client_Logging_Acceptor::parse_args (int argc, char *argv[]) { case 'h': ACE_OS::free ((void *) this->server_host_); - this->server_host_ = ACE_OS::strdup (get_opt.optarg); + this->server_host_ = ACE_OS::strdup (get_opt.opt_arg ()); break; case 'k': ACE_OS::free ((void *) this->logger_key_); - this->logger_key_ = ACE_OS::strdup (get_opt.optarg); + this->logger_key_ = ACE_OS::strdup (get_opt.opt_arg ()); break; case 'p': - this->server_port_ = ACE_OS::atoi (get_opt.optarg); + this->server_port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/netsvcs/lib/Name_Handler.cpp b/netsvcs/lib/Name_Handler.cpp index bfa2eb7c591..8ecbe1659f8 100644 --- a/netsvcs/lib/Name_Handler.cpp +++ b/netsvcs/lib/Name_Handler.cpp @@ -52,7 +52,7 @@ ACE_Name_Acceptor::parse_args (int argc, char *argv[]) switch (c) { case 'p': - this->service_port_ = ACE_OS::atoi (get_opt.optarg); + this->service_port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/netsvcs/lib/Server_Logging_Handler_T.cpp b/netsvcs/lib/Server_Logging_Handler_T.cpp index 994a9426dc2..a4465722891 100644 --- a/netsvcs/lib/Server_Logging_Handler_T.cpp +++ b/netsvcs/lib/Server_Logging_Handler_T.cpp @@ -256,7 +256,7 @@ ACE_Server_Logging_Acceptor_T<SLH, LMR, SST>::parse_args (int argc, char *argv[] switch (c) { case 'p': - this->service_port_ = ACE_OS::atoi (get_opt.optarg); + this->service_port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/netsvcs/lib/TS_Clerk_Handler.cpp b/netsvcs/lib/TS_Clerk_Handler.cpp index 95565887a83..094676c99e2 100644 --- a/netsvcs/lib/TS_Clerk_Handler.cpp +++ b/netsvcs/lib/TS_Clerk_Handler.cpp @@ -560,7 +560,7 @@ ACE_TS_Clerk_Processor::parse_args (int argc, char *argv[]) { case 'h': // Get the hostname:port and create an ADDR - server_addr.set (get_opt.optarg); + server_addr.set (get_opt.opt_arg ()); // Create a new handler ACE_NEW_RETURN (handler, @@ -572,12 +572,12 @@ ACE_TS_Clerk_Processor::parse_args (int argc, char *argv[]) break; case 't': // Get the timeout value - this->timeout_ = ACE_OS::atoi (get_opt.optarg); + this->timeout_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'p': // Get the poolname ACE_OS::strncpy (this->poolname_, - ACE_TEXT_CHAR_TO_TCHAR (get_opt.optarg), + ACE_TEXT_CHAR_TO_TCHAR (get_opt.opt_arg ()), sizeof this->poolname_ / sizeof (ACE_TCHAR)); break; case 'b': diff --git a/netsvcs/lib/TS_Server_Handler.cpp b/netsvcs/lib/TS_Server_Handler.cpp index 130afe253bd..9a9fd7e223a 100644 --- a/netsvcs/lib/TS_Server_Handler.cpp +++ b/netsvcs/lib/TS_Server_Handler.cpp @@ -51,7 +51,7 @@ ACE_TS_Server_Acceptor::parse_args (int argc, char *argv[]) switch (c) { case 'p': - this->service_port_ = ACE_OS::atoi (get_opt.optarg); + this->service_port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/netsvcs/lib/Token_Handler.cpp b/netsvcs/lib/Token_Handler.cpp index 0dca06cd4ea..4d420130bfd 100644 --- a/netsvcs/lib/Token_Handler.cpp +++ b/netsvcs/lib/Token_Handler.cpp @@ -43,7 +43,7 @@ ACE_Token_Acceptor::parse_args (int argc, char *argv[]) switch (c) { case 'p': - this->service_port_ = ACE_OS::atoi (get_opt.optarg); + this->service_port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/performance-tests/Misc/basic_perf.cpp b/performance-tests/Misc/basic_perf.cpp index 7bfaa43e7f6..ea8a5bd4e16 100644 --- a/performance-tests/Misc/basic_perf.cpp +++ b/performance-tests/Misc/basic_perf.cpp @@ -505,7 +505,7 @@ get_options (int argc, ACE_TCHAR *argv []) { case 'i': { - int temp = ACE_OS::atoi (get_opt.optarg); + int temp = ACE_OS::atoi (get_opt.opt_arg ()); if (temp > 0) iterations = (u_int) temp; else @@ -528,7 +528,7 @@ get_options (int argc, ACE_TCHAR *argv []) } } - switch (argc - get_opt.optind) + switch (argc - get_opt.opt_ind ()) { case 0: // OK diff --git a/performance-tests/Misc/childbirth_time.cpp b/performance-tests/Misc/childbirth_time.cpp index f4030d60cf7..a7942bd8966 100644 --- a/performance-tests/Misc/childbirth_time.cpp +++ b/performance-tests/Misc/childbirth_time.cpp @@ -346,11 +346,11 @@ main (int argc, ACE_TCHAR* argv[]) switch (c) { case 'n': - iteration = ACE_OS::atoi (get_opt.optarg); + iteration = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'l': MULTIPLY_FACTOR = ACE_static_cast (size_t, - ACE_OS::atoi (get_opt.optarg)); + ACE_OS::atoi (get_opt.opt_arg ())); break; case 'p': // test ACE_Process.spawn () profiler = prof_ace_process; diff --git a/performance-tests/Misc/context_switch_time.cpp b/performance-tests/Misc/context_switch_time.cpp index b6a793ddd15..44679a8c029 100644 --- a/performance-tests/Misc/context_switch_time.cpp +++ b/performance-tests/Misc/context_switch_time.cpp @@ -1088,9 +1088,9 @@ get_options (int argc, ACE_TCHAR *argv[]) while ((opt = get_opt ()) != EOF) { switch (opt) { case 'c': - if (ACE_OS::atoi (get_opt.optarg) >= 0) + if (ACE_OS::atoi (get_opt.opt_arg ()) >= 0) { - count = ACE_OS::atoi (get_opt.optarg); + count = ACE_OS::atoi (get_opt.opt_arg ()); } else { @@ -1113,15 +1113,13 @@ get_options (int argc, ACE_TCHAR *argv[]) } } - switch (argc - get_opt.optind) { + switch (argc - get_opt.opt_ind ()) { case 0: // use default number of iterations break; case 1: - if (ACE_OS::atoi (argv [get_opt.optind]) > 0) - { - num_iterations = ACE_OS::atoi (argv [get_opt.optind]); - } + if (ACE_OS::atoi (argv [get_opt.opt_ind ()]) > 0) + num_iterations = ACE_OS::atoi (argv [get_opt.opt_ind ()]); else { ACE_DEBUG ((LM_ERROR, "%n: iterations must be > 0\n")); diff --git a/performance-tests/Misc/preempt.cpp b/performance-tests/Misc/preempt.cpp index 9b5f618eb18..7a0ee743966 100644 --- a/performance-tests/Misc/preempt.cpp +++ b/performance-tests/Misc/preempt.cpp @@ -295,28 +295,28 @@ get_options (int argc, ACE_TCHAR *argv[]) use_fork = 1; break; case 'h': - if (ACE_OS::atoi (get_opt.optarg) >= 2) - high_iterations = ACE_OS::atoi (get_opt.optarg); + if (ACE_OS::atoi (get_opt.opt_arg ()) >= 2) + high_iterations = ACE_OS::atoi (get_opt.opt_arg ()); else ACE_ERROR_RETURN ((LM_ERROR, "%n: high iterations must be >= 2\n"), -1); break; case 'l': - if (ACE_OS::atoi (get_opt.optarg) >= 2) - low_iterations = ACE_OS::atoi (get_opt.optarg); + if (ACE_OS::atoi (get_opt.opt_arg ()) >= 2) + low_iterations = ACE_OS::atoi (get_opt.opt_arg ()); else ACE_ERROR_RETURN ((LM_ERROR, "%n: low iterations must be >= 2\n"), -1); break; case 'n': - if (ACE_OS::atoi (get_opt.optarg) >= 1) - high_priority_tasks = ACE_OS::atoi (get_opt.optarg); + if (ACE_OS::atoi (get_opt.opt_arg ()) >= 1) + high_priority_tasks = ACE_OS::atoi (get_opt.opt_arg ()); else ACE_ERROR_RETURN ((LM_ERROR, "%n: number of high priority threads " "must be >= 1\n"), -1); break; case 'p': - if (ACE_OS::atoi (get_opt.optarg) > 0) - read_period = ACE_OS::atoi (get_opt.optarg); + if (ACE_OS::atoi (get_opt.opt_arg ()) > 0) + read_period = ACE_OS::atoi (get_opt.opt_arg ()); else ACE_ERROR_RETURN ((LM_ERROR, "%n: read period > 0\n"), -1); break; @@ -333,7 +333,7 @@ get_options (int argc, ACE_TCHAR *argv[]) } } - switch (argc - get_opt.optind) { + switch (argc - get_opt.opt_ind ()) { case 0: // OK, no non-flag arguments. break; diff --git a/performance-tests/Misc/test_guard.cpp b/performance-tests/Misc/test_guard.cpp index 78024742e5f..bbff5602888 100644 --- a/performance-tests/Misc/test_guard.cpp +++ b/performance-tests/Misc/test_guard.cpp @@ -72,7 +72,7 @@ main (int argc, char *argv[]) test_function = guard; break; case 'n': - iterations = ACE_OS::atoi (getopt.optarg); + iterations = ACE_OS::atoi (getopt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/performance-tests/RPC/client.cpp b/performance-tests/RPC/client.cpp index 440b623470e..b0f4a476600 100644 --- a/performance-tests/RPC/client.cpp +++ b/performance-tests/RPC/client.cpp @@ -20,11 +20,11 @@ int main (int argc, char* argv[]) switch ((char) c) { case 'h': - host = getopt.optarg; + host = getopt.opt_arg (); break; case 'i': - nsamples = ACE_OS::atoi (getopt.optarg); + nsamples = ACE_OS::atoi (getopt.opt_arg ()); break; } } diff --git a/performance-tests/Server_Concurrency/Leader_Follower/RT_CORBA_Leader_Follower.cpp b/performance-tests/Server_Concurrency/Leader_Follower/RT_CORBA_Leader_Follower.cpp index 8cf94d33434..47e504591ed 100644 --- a/performance-tests/Server_Concurrency/Leader_Follower/RT_CORBA_Leader_Follower.cpp +++ b/performance-tests/Server_Concurrency/Leader_Follower/RT_CORBA_Leader_Follower.cpp @@ -251,16 +251,16 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'm': - number_of_messages = ACE_OS::atoi (get_opt.optarg); + number_of_messages = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': - number_of_threads = ACE_OS::atoi (get_opt.optarg); + number_of_threads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': - debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.optarg)); + debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.opt_arg ())); break; case 's': - message_size = ACE_OS::atoi (get_opt.optarg); + message_size = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp b/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp index d03a62194e1..d4beccdae30 100644 --- a/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp +++ b/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp @@ -197,22 +197,22 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'm': - number_of_messages = ACE_OS::atoi (get_opt.optarg); + number_of_messages = ACE_OS::atoi (get_opt.opt_arg ()); break; case 's': - message_size = ACE_OS::atoi (get_opt.optarg); + message_size = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'w': - number_of_threads = ACE_OS::atoi (get_opt.optarg); + number_of_threads = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'b': - burst_size = ACE_OS::atoi (get_opt.optarg); + burst_size = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': - timeout_between_bursts = ACE_OS::atoi (get_opt.optarg); + timeout_between_bursts = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': - debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.optarg)); + debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.opt_arg ())); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/performance-tests/Server_Concurrency/Queue_Based_Workers/RT_CORBA_Workers.cpp b/performance-tests/Server_Concurrency/Queue_Based_Workers/RT_CORBA_Workers.cpp index 6a1d739ab3b..1ff045b9b04 100644 --- a/performance-tests/Server_Concurrency/Queue_Based_Workers/RT_CORBA_Workers.cpp +++ b/performance-tests/Server_Concurrency/Queue_Based_Workers/RT_CORBA_Workers.cpp @@ -402,16 +402,16 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'm': - number_of_messages = ACE_OS::atoi (get_opt.optarg); + number_of_messages = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': - number_of_workers = ACE_OS::atoi (get_opt.optarg); + number_of_workers = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': - debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.optarg)); + debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.opt_arg ())); break; case 's': - message_size = ACE_OS::atoi (get_opt.optarg); + message_size = ACE_OS::atoi (get_opt.opt_arg ()); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp b/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp index 27b7274826d..729ce9a2692 100644 --- a/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp +++ b/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp @@ -239,22 +239,22 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'm': - number_of_messages = ACE_OS::atoi (get_opt.optarg); + number_of_messages = ACE_OS::atoi (get_opt.opt_arg ()); break; case 's': - message_size = ACE_OS::atoi (get_opt.optarg); + message_size = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'w': - number_of_workers = ACE_OS::atoi (get_opt.optarg); + number_of_workers = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'b': - burst_size = ACE_OS::atoi (get_opt.optarg); + burst_size = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': - timeout_between_bursts = ACE_OS::atoi (get_opt.optarg); + timeout_between_bursts = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'd': - debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.optarg)); + debug = ACE_static_cast (DEBUGGING_RANGE, ACE_OS::atoi (get_opt.opt_arg ())); break; default: ACE_ERROR_RETURN ((LM_ERROR, diff --git a/performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.cpp b/performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.cpp index be6e1eaf72f..62fb4297507 100644 --- a/performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.cpp +++ b/performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.cpp @@ -42,7 +42,7 @@ Baseline_Test_Base::parse_args (int argc, char *argv[]) { case 'i': // Total iterations { - int tmp = ACE_OS::atoi (getopt.optarg); + int tmp = ACE_OS::atoi (getopt.opt_arg ()); if (tmp <= 0) ACE_ERROR_RETURN ((LM_ERROR, "%d is not a valid value for iteration\n", diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp index 2c39019e811..2eb43501280 100644 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp +++ b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp @@ -80,17 +80,17 @@ Performance_Test_Options::parse_args (int argc, char *argv[]) switch (c) { case 'a': // Not used. (do_ack ???) - this->_ack = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_ack = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'A': // Not used. (set rendezvous point.) - this->pipe_addr (get_opt.optarg); + this->pipe_addr (get_opt.opt_arg ()); break; case 'B': // Create thread with THR_BOUND. this->t_flags (THR_BOUND); break; case 'c': // Not used. (# of connections.) { - long connections = ACE_OS::atoi (get_opt.optarg); + long connections = ACE_OS::atoi (get_opt.opt_arg ()); if (connections < 0) this->physical_connections (size_t (-connections)); @@ -102,7 +102,7 @@ Performance_Test_Options::parse_args (int argc, char *argv[]) break; } case 'C': // Not used. (Toggle calculate checksum.) - this->_checksum = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_checksum = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'd': // Not used. (Enable debugging.) this->_debugging = 1; @@ -111,58 +111,58 @@ Performance_Test_Options::parse_args (int argc, char *argv[]) this->t_flags (THR_DETACHED); break; case 'e': // Perform eager exit (without cleaning up.) - this->_eager_exit = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_eager_exit = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'F': // Not used. - this->_free_memory = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_free_memory = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'g': // Not used. (generate data ??) - this->_generate = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_generate = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'H': // Not used. (set high water mark) - this->high_water_mark (ACE_OS::atoi (get_opt.optarg)); + this->high_water_mark (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'i': // Not used. (# of iterations) - this->iterations (ACE_OS::atoi (get_opt.optarg)); + this->iterations (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'L': // Not used. (set low water mark) - this->low_water_mark (ACE_OS::atoi (get_opt.optarg)); + this->low_water_mark (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'l': // Not used. (set initial queue length) - this->initial_queue_length (ACE_OS::atoi (get_opt.optarg)); + this->initial_queue_length (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'M': // Set message size in pipe_[proc|thr]_test. - this->msg_size (ACE_OS::atoi (get_opt.optarg)); + this->msg_size (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'm': // Not used. (set mapped file name) - this->mapped_file (get_opt.optarg); + this->mapped_file (get_opt.opt_arg ()); break; case 'N': // Create thread with flag THR_NEW_LWP. this->t_flags (THR_NEW_LWP); break; case 'n': // Set # of lwp's - this->n_lwps (ACE_OS::atoi (get_opt.optarg)); + this->n_lwps (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'p': // Toggle whether summary is printed. - this->_print_summary = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_print_summary = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'P': // Not used. - this->consecutive_ports (ACE_OS::atoi (get_opt.optarg)); + this->consecutive_ports (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'S': // Not used (set service_entry ???) - this->service_entry (get_opt.optarg); + this->service_entry (get_opt.opt_arg ()); break; case 's': // Set testing duration. - this->sleep_time (ACE_OS::atoi (get_opt.optarg)); + this->sleep_time (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'T': // Enable/disable tracing. - if (ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0) + if (ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0) ACE_Trace::start_tracing (); - else if (ACE_OS::strcasecmp (get_opt.optarg, "OFF") == 0) + else if (ACE_OS::strcasecmp (get_opt.opt_arg (), "OFF") == 0) ACE_Trace::stop_tracing (); break; case 't': // Set # of threads contending the lock. - this->thr_count (ACE_OS::atoi (get_opt.optarg)); + this->thr_count (ACE_OS::atoi (get_opt.opt_arg ())); break; case 'u': // Not used. (use udp.) this->_udp = 1; @@ -171,10 +171,10 @@ Performance_Test_Options::parse_args (int argc, char *argv[]) this->_verbosity = 1; break; case 'X': // Not used. (Use xdr conversion.) - this->_xdr = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_xdr = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; case 'Z': // Not used. (Do zero copy.) - this->_zero_copy = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; + this->_zero_copy = ACE_OS::strcasecmp (get_opt.opt_arg (), "ON") == 0; break; default: ACE_DEBUG ((LM_INFO, diff --git a/performance-tests/TCP/tcp_test.cpp b/performance-tests/TCP/tcp_test.cpp index 0f31a960742..af75df3ba12 100644 --- a/performance-tests/TCP/tcp_test.cpp +++ b/performance-tests/TCP/tcp_test.cpp @@ -536,7 +536,7 @@ main (int argc, char *argv[]) break; case 'm': - bufsz = ACE_OS::atoi (getopt.optarg); + bufsz = ACE_OS::atoi (getopt.opt_arg ()); if (bufsz <= 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -549,7 +549,7 @@ main (int argc, char *argv[]) 1); case 'i': - nsamples = ACE_OS::atoi (getopt.optarg); + nsamples = ACE_OS::atoi (getopt.opt_arg ()); if (nsamples <= 0) ACE_ERROR_RETURN ((LM_ERROR, "\nIterations must be greater than 0!\n\n"), @@ -573,7 +573,7 @@ main (int argc, char *argv[]) #endif /* ACE_WIN32 */ case 'b': - so_bufsz = ACE_OS::atoi (getopt.optarg); + so_bufsz = ACE_OS::atoi (getopt.opt_arg ()); if (so_bufsz <= 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -582,7 +582,7 @@ main (int argc, char *argv[]) break; case 'I': - usdelay = ACE_OS::atoi (getopt.optarg); + usdelay = ACE_OS::atoi (getopt.opt_arg ()); if (usdelay < 0) { @@ -590,20 +590,20 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "%s: bad usdelay: %s\n", argv[0], - getopt.optarg), + getopt.opt_arg ()), 1); } break; case 'p': - dstport = ACE_OS::atoi (getopt.optarg); + dstport = ACE_OS::atoi (getopt.opt_arg ()); if (dstport <= 0) ACE_ERROR_RETURN ((LM_ERROR, "\nInvalid port number!\n\n"), 1); break; case 't': - svr_thrno = ACE_OS::atoi (getopt.optarg); + svr_thrno = ACE_OS::atoi (getopt.opt_arg ()); if (svr_thrno <= 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -625,7 +625,7 @@ main (int argc, char *argv[]) } } - if (getopt.optind >= argc && client || argc == 1) + if (getopt.opt_ind () >= argc && client || argc == 1) { usage (); return 1; @@ -644,25 +644,25 @@ main (int argc, char *argv[]) ACE_INET_Addr remote_addr; - if (isdigit(argv[getopt.optind][0])) + if (isdigit(argv[getopt.opt_ind ()][0])) { if (remote_addr.set (dstport, (ACE_UINT32) ACE_OS::inet_addr - (argv[getopt.optind])) == -1) + (argv[getopt.opt_ind ()])) == -1) ACE_ERROR_RETURN ((LM_ERROR, "invalid IP address: %s\n", - argv[getopt.optind]), + argv[getopt.opt_ind ()]), 1); } else { - if (remote_addr.set (dstport, argv[getopt.optind]) == -1) + if (remote_addr.set (dstport, argv[getopt.opt_ind ()]) == -1) ACE_ERROR_RETURN ((LM_ERROR, "invalid IP address: %s\n", - argv[getopt.optind]), + argv[getopt.opt_ind ()]), 1); } - getopt.optind++; + getopt.opt_ind ()++; ACE_DEBUG ((LM_DEBUG, "Connecting to %s:%d\n", remote_addr.get_host_name (), diff --git a/performance-tests/UDP/udp_test.cpp b/performance-tests/UDP/udp_test.cpp index 45fa0988950..b6295291876 100644 --- a/performance-tests/UDP/udp_test.cpp +++ b/performance-tests/UDP/udp_test.cpp @@ -608,24 +608,24 @@ main (int argc, char *argv[]) switch ((char) c) { case 'x': - max_allow = ACE_OS::atoi (getopt.optarg); + max_allow = ACE_OS::atoi (getopt.opt_arg ()); break; case 'w': - window = ACE_OS::atoi (getopt.optarg); + window = ACE_OS::atoi (getopt.opt_arg ()); if (window < 0) ACE_ERROR_RETURN ((LM_ERROR, "Invalid window!\n\n"), 1); break; case 'f': - ACE_OS::strcpy (datafile, getopt.optarg); + ACE_OS::strcpy (datafile, getopt.opt_arg ()); logfile = 1; break; case 'v': VERBOSE = 1; break; case 'b': - bufsz = ACE_OS::atoi (getopt.optarg); + bufsz = ACE_OS::atoi (getopt.opt_arg ()); if (bufsz <= 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -633,7 +633,7 @@ main (int argc, char *argv[]) 1); case 'n': - nsamples = ACE_OS::atoi (getopt.optarg); + nsamples = ACE_OS::atoi (getopt.opt_arg ()); if (nsamples <= 0) ACE_ERROR_RETURN ((LM_ERROR, "\nIterations must be greater than 0!\n\n"), @@ -643,7 +643,7 @@ main (int argc, char *argv[]) use_reactor = 1; break; case 's': - so_bufsz = ACE_OS::atoi (getopt.optarg); + so_bufsz = ACE_OS::atoi (getopt.opt_arg ()); if (so_bufsz <= 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -651,17 +651,17 @@ main (int argc, char *argv[]) 1); break; case 'I': - usdelay = ACE_OS::atoi (getopt.optarg); + usdelay = ACE_OS::atoi (getopt.opt_arg ()); if (usdelay == 0) ACE_ERROR_RETURN ((LM_ERROR, "%s: bad usdelay: %s\n", argv[0], - getopt.optarg), + getopt.opt_arg ()), 1); break; case 'p': - dstport = ACE_OS::atoi (getopt.optarg); + dstport = ACE_OS::atoi (getopt.opt_arg ()); if (dstport <= 0) ACE_ERROR_RETURN ((LM_ERROR, "\nInvalid port number!\n\n"), @@ -681,7 +681,7 @@ main (int argc, char *argv[]) } } - if (getopt.optind >= argc && client || argc == 1) + if (getopt.opt_ind () >= argc && client || argc == 1) { usage (); return 1; @@ -713,25 +713,25 @@ main (int argc, char *argv[]) 1); ACE_INET_Addr remote_addr; - if (isdigit(argv[getopt.optind][0])) + if (isdigit(argv[getopt.opt_ind ()][0])) { if (remote_addr.set (dstport, (ACE_UINT32) ACE_OS::inet_addr - (argv[getopt.optind])) == -1) + (argv[getopt.opt_ind ()])) == -1) ACE_ERROR_RETURN ((LM_ERROR, "invalid IP address: %s\n", - argv[getopt.optind]), + argv[getopt.opt_ind ()]), 1); } else { - if (remote_addr.set (dstport, argv[getopt.optind]) == -1) + if (remote_addr.set (dstport, argv[getopt.opt_ind ()]) == -1) ACE_ERROR_RETURN ((LM_ERROR, "invalid IP address: %s\n", - argv[getopt.optind]), + argv[getopt.opt_ind ()]), 1); } - getopt.optind++; + getopt.opt_ind ()++; Client client (addr, remote_addr); |