I installed this into gnulib. This is just an internal cleanup; it
shouldn't affect behavior.
2005-05-18 Paul Eggert [EMAIL PROTECTED]
* lib/canonicalize.c: Include canonicalize.h first, to test interface.
Include stddef.h unconditionally, since we assume C89 now.
All uses of PTR_INT_TYPE replaced by ptrdiff_t.
* lib/fts.c: Include fts_.h first, to check interface.
Do not include intprops.h; no longer needed.
Include cycle-check.h and hash.h, since fts_.h no longer does.
Remove unnecessary casts of closedir to void.
(fts_build): Use a simpler method (not involving TYPE_SIGNED) to
decide whether to decrement nlinks.
* lib/fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
(FTS): Use struct hash_table * instead of Hash_table, so that
we no longer need to include hash.h here.
* m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME]):
Don't check for stddef.h.
* m4/fts.m4 (gl_FUNC_FTS): Don't require AC_HEADER_STDC, as we
don't use its results.
Don't check for fcntl.h, stddef.h, stdlib.h, string.h, unistd.h,
since we include them unconditionally. Don't require
AM_STDBOOL_H, since stdbool is a prerequisite.
Don't require AC_C_CONST, AC_TYPE_SIZE_T or check for ptrdiff_t
since we assume C89 or better.
Don't require AC_FUNC_CLOSEDIR_VOID, AC_FUNC_LSTAT, or AC_FUNC_STAT,
as we don't use their results.
Don't check for fchdir, memmove, memset, strrchr, as we use
them unconditionally.
* m4/gettimeofday.m4 (AC_FUNC_GETTIMEOFDAY_CLOBBER): Don't define
GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, since nobody uses it.
Index: lib/canonicalize.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/canonicalize.c,v
retrieving revision 1.3
diff -p -u -r1.3 canonicalize.c
--- lib/canonicalize.c 14 May 2005 06:03:57 - 1.3
+++ lib/canonicalize.c 18 May 2005 19:43:49 -
@@ -20,6 +20,8 @@
# include config.h
#endif
+#include canonicalize.h
+
#ifdef STDC_HEADERS
# include stdlib.h
#else
@@ -43,6 +45,7 @@ void free ();
#endif
#include errno.h
+#include stddef.h
#include cycle-check.h
#include path-concat.h
@@ -54,24 +57,6 @@ void free ();
# define __set_errno(Val) errno = (Val)
#endif
-/* If __PTRDIFF_TYPE__ is
- defined, as with GNU C, use that; that way we don't pollute the
- namespace with stddef.h's symbols. Otherwise, if stddef.h is
- available, include it and use ptrdiff_t. In traditional C, long is
- the best that we can do. */
-
-#ifdef __PTRDIFF_TYPE__
-# define PTR_INT_TYPE __PTRDIFF_TYPE__
-#else
-# ifdef HAVE_STDDEF_H
-# include stddef.h
-# define PTR_INT_TYPE ptrdiff_t
-# else
-# define PTR_INT_TYPE long
-# endif
-#endif
-
-#include canonicalize.h
#include pathmax.h
#include xreadlink.h
@@ -230,7 +215,7 @@ canonicalize_filename_mode (const char *
if (dest + (end - start) = rpath_limit)
{
- PTR_INT_TYPE dest_offset = dest - rpath;
+ ptrdiff_t dest_offset = dest - rpath;
size_t new_size = rpath_limit - rpath;
if (end - start + 1 PATH_MAX)
Index: lib/fts.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/fts.c,v
retrieving revision 1.1
diff -p -u -r1.1 fts.c
--- lib/fts.c 17 May 2005 07:07:19 - 1.1
+++ lib/fts.c 18 May 2005 19:43:49 -
@@ -53,6 +53,8 @@
static char sccsid[] = @(#)fts.c 8.6 (Berkeley) 8/14/94;
#endif /* LIBC_SCCS and not lint */
+#include fts_.h
+
#if HAVE_SYS_PARAM_H || defined _LIBC
# include sys/param.h
#endif
@@ -64,9 +66,10 @@ static char sccsid[] = @(#)fts.c8.6 (B
#include fcntl.h
#include errno.h
#include dirfd.h
-#include fts_.h
-#include intprops.h
+#include cycle-check.h
+#include hash.h
#include unistd-safer.h
+#include stdbool.h
#include stdlib.h
#include string.h
#include unistd.h
@@ -926,7 +929,7 @@ fts_build (register FTS *sp, int type)
cur-fts_flags |= FTS_DONTCHDIR;
descend = false;
cderrno = errno;
- (void)closedir(dirp);
+ closedir(dirp);
dirp = NULL;
} else
descend = true;
@@ -976,7 +979,7 @@ mem1: saved_errno = errno;
if (p)
free(p);
fts_lfree(head);
- (void)closedir(dirp);
+ closedir(dirp);
cur-fts_info = FTS_ERR;
SET(FTS_STOP);
__set_errno (saved_errno);
@@ -1001,7 +1004,7 @@ mem1: saved_errno =