summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-03-31 00:45:48 +0000
committerLuke Leighton <lkcl@samba.org>2000-03-31 00:45:48 +0000
commitfcdf525f4d12460f51ffd477e6b4cd5462dd8f46 (patch)
tree79b7a54fd2f7692a579f3571e74dc6b19538e726
parent692c3359cb88bc662328f944ae3c96c77f9d8294 (diff)
downloadsamba-fcdf525f4d12460f51ffd477e6b4cd5462dd8f46.tar.gz
more compiler warnings on ultrasparc resolved
-rw-r--r--source/lib/getopt.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/source/lib/getopt.c b/source/lib/getopt.c
index 3785cb200fd..007a84f5da9 100644
--- a/source/lib/getopt.c
+++ b/source/lib/getopt.c
@@ -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;