Fix compiler warnings for pax

This commit is contained in:
Ben Gras 2006-03-24 14:03:25 +00:00
parent e1f91e1855
commit 65723cba53
5 changed files with 20 additions and 7 deletions

View file

@ -31,6 +31,9 @@
* SUCH DAMAGE.
*/
#define _POSIX_SOURCE 1
#define _MINIX 1
#if 0
#ifndef lint
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
@ -48,6 +51,13 @@ static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#include <stdlib.h>
#include <limits.h>
#include <minix/paths.h>
#include <sys/types.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include "pax.h"
#include "options.h"
#include "cpio.h"
@ -1477,7 +1487,9 @@ str_offt(char *val)
return(num);
}
char *
char *fgetln(FILE *f, size_t *);
static char *
getline(FILE *f)
{
char *name, *temp;
@ -1518,7 +1530,7 @@ no_op(void)
* print the usage summary to the user
*/
void
static void
pax_usage(void)
{
(void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr);
@ -1552,7 +1564,7 @@ pax_usage(void)
* print the usage summary to the user
*/
void
static void
tar_usage(void)
{
(void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
@ -1567,7 +1579,7 @@ tar_usage(void)
* print the usage summary to the user
*/
void
static void
cpio_usage(void)
{
(void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);

View file

@ -80,7 +80,7 @@ _PROTOTYPE( int putenv, (const char *_name) );
/* According to POSIX, getopt should be in unistd.h. What do we do with
* this?
*/
_PROTOTYPE(int getopt, (int _argc, char **_argv, char *_opts));
_PROTOTYPE(int getopt, (int _argc, char * const _argv[], const char *_opts));
extern char *optarg;
extern int optind, opterr, optopt;
#endif /* _MINIX */

View file

@ -7,3 +7,4 @@ _PROTOTYPE( char *index, (const char *_s, int _charwanted) );
_PROTOTYPE( int strcasecmp, (const char *_s1, const char *_s2) );
_PROTOTYPE( int strncasecmp, (const char *_s1, const char *_s2,
size_t _len) );
_PROTOTYPE( int ffs, (int i) );

View file

@ -148,7 +148,7 @@ _PROTOTYPE( int ftruncate, (int _fd, off_t _length) );
/* Open Group Base Specifications Issue 6 (not complete) */
_PROTOTYPE( int symlink, (const char *path1, const char *path2) );
_PROTOTYPE( int readlink, (const char *, char *, size_t) );
_PROTOTYPE( int getopt, (int _argc, char **_argv, char *_opts) );
_PROTOTYPE( int getopt, (int _argc, char * const _argv[], char const *_opts) );
extern char *optarg;
extern int optind, opterr, optopt;
_PROTOTYPE( int usleep, (useconds_t _useconds) );

View file

@ -49,7 +49,7 @@ char *optarg; /* argument associated with option */
* Parse argc/argv argument vector.
*/
int
getopt(int nargc, char **nargv, char *ostr)
getopt(int nargc, char * const nargv[], const char *ostr)
{
static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */