Port to Forte Developer 7 C 5.4 and C99.
* src/common.h (add_exclude_tag): Add decl; C99 requires this and Forte warns about it. * src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype, for same reason. * src/misc.c (get_max_open_files): Rewrite to avoid code that Forte C complains about as being unreachable. * src/xheader.c (mtime_code): Rewrite to avoid Forte error reported by Trond Hasle Amundsen. * src/incremen.c (compare_dirnames): Rewrite to avoid casts. * src/utf8.c (string_ascii_p): Likewise. * src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder): Likewise. SCALAR(0x8283218)
This commit is contained in:
19
ChangeLog
19
ChangeLog
@@ -1,3 +1,20 @@
|
||||
2006-12-12 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Port to Forte Developer 7 C 5.4 and C99.
|
||||
* src/common.h (add_exclude_tag): Add decl; C99 requires this
|
||||
and Forte warns about it.
|
||||
* src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
|
||||
for same reason.
|
||||
* src/misc.c (get_max_open_files): Rewrite to avoid code that
|
||||
Forte C complains about as being unreachable.
|
||||
* src/xheader.c (mtime_code): Rewrite to avoid Forte error
|
||||
reported by Trond Hasle Amundsen.
|
||||
|
||||
* src/incremen.c (compare_dirnames): Rewrite to avoid casts.
|
||||
* src/utf8.c (string_ascii_p): Likewise.
|
||||
* src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
|
||||
Likewise.
|
||||
|
||||
2006-12-08 Sergey Poznyakoff <gray@gnu.org.ua>
|
||||
|
||||
* bootstrap: Add paxutils files to dot_ignore.
|
||||
@@ -19,7 +36,7 @@
|
||||
Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
|
||||
* tests/truncate.at: Use genfile instead of dd, because on some
|
||||
systems /dev/zero is not available.
|
||||
|
||||
|
||||
2006-12-04 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: Fix some race conditions with tar -x --same-owner.
|
||||
|
||||
@@ -417,6 +417,7 @@ enum dump_status
|
||||
dump_status_not_implemented
|
||||
};
|
||||
|
||||
void add_exclude_tag (const char *name);
|
||||
bool file_dumpable_p (struct tar_stat_info *st);
|
||||
void create_archive (void);
|
||||
void pad_archive (off_t size_left);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <system.h>
|
||||
#include <getline.h>
|
||||
#include <hash.h>
|
||||
#include <mkdtemp.h>
|
||||
#include <quotearg.h>
|
||||
#include "common.h"
|
||||
|
||||
@@ -378,7 +379,9 @@ dumpdir_size (const char *p)
|
||||
static int
|
||||
compare_dirnames (const void *first, const void *second)
|
||||
{
|
||||
return strcmp (*(const char**)first, *(const char**)second);
|
||||
char const *const *name1 = first;
|
||||
char const *const *name2 = second;
|
||||
return strcmp (*name1, *name2);
|
||||
}
|
||||
|
||||
/* Compare dumpdir array from DIRECTORY with directory listing DIR and
|
||||
|
||||
10
src/misc.c
10
src/misc.c
@@ -1,7 +1,7 @@
|
||||
/* Miscellaneous functions, not really specific to GNU tar.
|
||||
|
||||
Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001,
|
||||
2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -588,10 +588,12 @@ get_max_open_files ()
|
||||
|
||||
if (getrlimit(RLIMIT_NOFILE, &rlim) == 0)
|
||||
return rlim.rlim_max;
|
||||
return -1;
|
||||
#elif defined HAVE_GETDTABLESIZE
|
||||
return getdtablesize ();
|
||||
#endif
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Close all descriptors, except the first three */
|
||||
@@ -603,7 +605,7 @@ closeopen ()
|
||||
for (i = get_max_open_files () - 1; i > 2; i--)
|
||||
close (i);
|
||||
}
|
||||
|
||||
|
||||
/* Change to directory I. If I is 0, change to the initial working
|
||||
directory; otherwise, I must be a value returned by chdir_arg. */
|
||||
void
|
||||
@@ -611,7 +613,7 @@ chdir_do (int i)
|
||||
{
|
||||
static int previous;
|
||||
static int saved_count;
|
||||
|
||||
|
||||
if (previous != i)
|
||||
{
|
||||
struct wd *prev = &wd[previous];
|
||||
|
||||
11
src/utf8.c
11
src/utf8.c
@@ -1,6 +1,6 @@
|
||||
/* Charset handling for GNU tar.
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -28,7 +28,7 @@
|
||||
# define ICONV_CONST
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ICONV
|
||||
#ifndef HAVE_ICONV
|
||||
|
||||
# undef iconv_open
|
||||
# define iconv_open(tocode, fromcode) ((iconv_t) -1)
|
||||
@@ -39,7 +39,7 @@
|
||||
# undef iconv_close
|
||||
# define iconv_close(cd) 0
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -88,11 +88,10 @@ utf8_convert (bool to_utf, char const *input, char **output)
|
||||
|
||||
|
||||
bool
|
||||
string_ascii_p (const char *str)
|
||||
string_ascii_p (char const *p)
|
||||
{
|
||||
const unsigned char *p = (const unsigned char *)str;
|
||||
for (; *p; p++)
|
||||
if (*p > 127)
|
||||
if (! (0 <= *p && *p <= 127))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ xheader_set_option (char *string)
|
||||
to the result of the basename
|
||||
utility on the translated file name.
|
||||
%p The process ID of the pax process.
|
||||
%n The value of the 3rd argument.
|
||||
%n The value of the 3rd argument.
|
||||
%% A '%' character. */
|
||||
|
||||
char *
|
||||
@@ -331,7 +331,7 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
|
||||
}
|
||||
|
||||
free (dirp);
|
||||
|
||||
|
||||
/* Do not allow it to end in a slash */
|
||||
while (q > buf && ISSLASH (q[-1]))
|
||||
q--;
|
||||
@@ -508,7 +508,7 @@ decode_record (char **ptr,
|
||||
ERROR ((0, 0, _("Extended header length is out of allowed range")));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (len_max < len)
|
||||
{
|
||||
int len_len = len_lim - p;
|
||||
@@ -954,7 +954,7 @@ decode_time (struct timespec *ts, char const *arg, char const *keyword)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
code_num (uintmax_t value, char const *keyword, struct xheader *xhdr)
|
||||
@@ -1094,8 +1094,8 @@ static void
|
||||
mtime_coder (struct tar_stat_info const *st, char const *keyword,
|
||||
struct xheader *xhdr, void const *data)
|
||||
{
|
||||
const struct timespec mtime = data ? *(struct timespec *) data : st->mtime;
|
||||
code_time (mtime, keyword, xhdr);
|
||||
struct timespec const *mtime = data;
|
||||
code_time (mtime ? *mtime : st->mtime, keyword, xhdr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1379,8 +1379,8 @@ static void
|
||||
volume_size_coder (struct tar_stat_info const *st, char const *keyword,
|
||||
struct xheader *xhdr, void const *data)
|
||||
{
|
||||
off_t v = *(off_t*)data;
|
||||
code_num (v, keyword, xhdr);
|
||||
off_t const *v = data;
|
||||
code_num (*v, keyword, xhdr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1398,8 +1398,8 @@ static void
|
||||
volume_offset_coder (struct tar_stat_info const *st, char const *keyword,
|
||||
struct xheader *xhdr, void const *data)
|
||||
{
|
||||
off_t v = *(off_t*)data;
|
||||
code_num (v, keyword, xhdr);
|
||||
off_t const *v = data;
|
||||
code_num (*v, keyword, xhdr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1438,12 +1438,12 @@ sparse_major_decoder (struct tar_stat_info *st,
|
||||
if (decode_num (&u, arg, TYPE_MAXIMUM (unsigned), keyword))
|
||||
st->sparse_major = u;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sparse_minor_coder (struct tar_stat_info const *st, char const *keyword,
|
||||
struct xheader *xhdr, void const *data)
|
||||
{
|
||||
code_num (st->sparse_minor, keyword, xhdr);
|
||||
code_num (st->sparse_minor, keyword, xhdr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1456,7 +1456,7 @@ sparse_minor_decoder (struct tar_stat_info *st,
|
||||
if (decode_num (&u, arg, TYPE_MAXIMUM (unsigned), keyword))
|
||||
st->sparse_minor = u;
|
||||
}
|
||||
|
||||
|
||||
struct xhdr_tab const xhdr_tab[] = {
|
||||
{ "atime", atime_coder, atime_decoder, false },
|
||||
{ "comment", dummy_coder, dummy_decoder, false },
|
||||
|
||||
Reference in New Issue
Block a user