more compiler warnings on ultrasparc resolved
authorLuke Leighton <lkcl@samba.org>
Fri, 31 Mar 2000 00:45:48 +0000 (00:45 +0000)
committerLuke Leighton <lkcl@samba.org>
Fri, 31 Mar 2000 00:45:48 +0000 (00:45 +0000)
source/lib/getopt.c

index 3785cb200fdc9bf84795a3be5ebb347d1a49ff1c..007a84f5da97e026eed2b1611c9801831c0f1932 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef HAVE_GETOPT_LONG
 #include "getopt.h"
 #include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
 
 /* Getopt for GNU.
    NOTE: getopt is now part of the C library, so if you don't know what
@@ -155,16 +157,12 @@ static char *posixly_correct;
 /* Avoid depending on library functions or files
    whose names are inconsistent.  */
 
-char *getenv();
-
-static char *my_index(str, chr)
-     const char *str;
-     int chr;
+static const char *my_index(const char *str, int chr)
 {
        while (*str)
        {
                if (*str == chr)
-                       return (char *)str;
+                       return (const char *)str;
                str++;
        }
        return 0;
@@ -202,8 +200,7 @@ static int last_nonopt;
    `first_nonopt' and `last_nonopt' are relocated so that they describe
    the new indices of the non-options in ARGV after they are moved.  */
 
-static void exchange(argv)
-     char **argv;
+static void exchange( char **argv)
 {
        int bottom = first_nonopt;
        int middle = last_nonopt;
@@ -260,8 +257,7 @@ static void exchange(argv)
 
 /* Initialize the internal data when the first call is made.  */
 
-static const char *_getopt_initialize(optstring)
-     const char *optstring;
+static const char *_getopt_initialize( const char *optstring)
 {
        /* Start processing options with ARGV-element 1 (since ARGV-element 0
           is the program name); the sequence of previously skipped
@@ -349,13 +345,11 @@ static const char *_getopt_initialize(optstring)
    If LONG_ONLY is nonzero, '-' as well as '--' can introduce
    long-named options.  */
 
-static int _getopt_internal(argc, argv, optstring, longopts, longind, long_only)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-     const struct option *longopts;
-     int *longind;
-     int long_only;
+static int _getopt_internal( int argc, char *const *argv,
+                            const char *optstring,
+                            const struct option *longopts,
+                            int *longind,
+                            int long_only)
 {
        optarg = NULL;