Author: elemings
Date: Mon Jun  2 10:37:03 2008
New Revision: 662493

URL: http://svn.apache.org/viewvc?rev=662493&view=rev
Log:
2008-06-02  Eric Lemings <[EMAIL PROTECTED]>

        STDCXX-550
        * util/cmdopt.cpp (get_long_val, eval_options): Change `offset'
        parameter type from `unsigned' to `size_t' type.  (Better fix
        for conversion warning than casting.)


Modified:
    stdcxx/branches/4.2.x/util/cmdopt.cpp

Modified: stdcxx/branches/4.2.x/util/cmdopt.cpp
URL: 
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/util/cmdopt.cpp?rev=662493&r1=662492&r2=662493&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/util/cmdopt.cpp (original)
+++ stdcxx/branches/4.2.x/util/cmdopt.cpp Mon Jun  2 10:37:03 2008
@@ -198,7 +198,7 @@
     @param offset length of option name (including leading --)
 */
 static char*
-get_long_val (char* const* argv, int* idx, unsigned offset)
+get_long_val (char* const* argv, int* idx, size_t offset)
 {
     assert (0 != argv);
     assert (0 != idx);
@@ -567,7 +567,7 @@
                      && !memcmp (opt_exit, argv [i], sizeof opt_exit - 1)) {
                 /* exit immediately with the specified status */
                 optname = opt_exit;
-                optarg  = get_long_val (argv, &i, unsigned (sizeof opt_exit - 
1));
+                optarg  = get_long_val (argv, &i, sizeof opt_exit - 1);
                 if (optarg && *optarg) {
                     if (!isdigit (*optarg))
                         bad_value (optname, optarg);
@@ -589,7 +589,7 @@
                      && !memcmp (opt_sleep, argv [i], sizeof opt_sleep - 1)) {
                 /* sleep for the specified number of seconds */ 
                 optname = opt_sleep;
-                optarg  = get_long_val (argv, &i, unsigned (sizeof opt_sleep - 
1));
+                optarg  = get_long_val (argv, &i, sizeof opt_sleep - 1);
                 if (optarg && *optarg) {
                     if (!isdigit (*optarg))
                         bad_value (optname, optarg);
@@ -606,7 +606,7 @@
                      && !memcmp (opt_signal, argv [i], sizeof opt_signal - 1)) 
{
                 /* send ourselves the specified signal */
                 optname = opt_signal;
-                optarg  = get_long_val (argv, &i, unsigned (sizeof opt_signal 
- 1));
+                optarg  = get_long_val (argv, &i, sizeof opt_signal - 1);
                 if (optarg && *optarg) {
                     const int signo = get_signo (optarg);
                     if (0 <= signo) {
@@ -621,7 +621,7 @@
                      && !memcmp (opt_ignore, argv [i], sizeof opt_ignore - 1)) 
{
                 /* ignore the specified signal */
                 optname = opt_ignore;
-                optarg  = get_long_val (argv, &i, unsigned (sizeof opt_ignore 
- 1));
+                optarg  = get_long_val (argv, &i, sizeof opt_ignore - 1);
                 if (optarg && *optarg) {
                     const int signo = get_signo (optarg);
                     if (0 <= signo) {
@@ -636,7 +636,7 @@
                      && !memcmp (opt_ulimit, argv [i], sizeof opt_ulimit - 1)) 
{
                 /* set child process resource utilization limits */
                 optname = opt_ulimit;
-                optarg  = get_long_val (argv, &i, unsigned (sizeof opt_ulimit 
- 1));
+                optarg  = get_long_val (argv, &i, sizeof opt_ulimit - 1);
                 if (optarg && *optarg) {
                     if (!parse_limit_opts (optarg, defaults)) {
                         break;
@@ -647,7 +647,7 @@
                      && !memcmp (opt_warn, argv [i], sizeof opt_warn - 1)) {
                 /* set compiler warning mode */
                 optname = opt_warn;
-                optarg  = get_long_val (argv, &i, unsigned (sizeof opt_warn - 
1));
+                optarg  = get_long_val (argv, &i, sizeof opt_warn - 1);
                 if (optarg && *optarg) {
                     if (!parse_warn_opts (optarg, defaults)) {
                         break;


Reply via email to