Age | Commit message (Collapse) | Author |
|
Include stdint.h if available, as Autoconf suggests.
(ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
is an array.
(fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
Use size_t for sizes.
(fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
fts_palloc):
Use bool when appropriate.
(SIZE_MAX, TYPE_SIGNED): New macros.
(fts_read): Use u_short for instructions.
(fts_build): Use ptrdiff_t for levels. Don't assume file name lengths
fit into int. Don't assume nlink_t is signed.
(find_matching_ancestor): Don't assume dev, ino fit in int.
(fts_stat): Use function prototype; required for bool arg.
(fts_sort): Detect integer overflow in size calculations.
(fts_alloc): Simplify allocation code, now that fts_statp is an array
and not a pointer.
|
|
Include stddef.h, for ptrdiff_t.
(FTS.fts_nitems): Now size_t, not int, for hosts that allow more
than INT_MAX entries in a directory.
(FTS_ROOTPARENTLEVEL): Parenthesize properly.
(FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
than INT_MAX levels deep on 64-bit hosts.
(FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
the Hurd that don't have arbitrary limits on directory entry lengths.
(FTSENT.fts_statp): Now an array, not a pointer, so that we don't
have to play unportable games with pointer arithmetic. Keep it array
for the benefit of user code that assumes it is a pointer.
|
|
Include unistd.h, for lseek.
|
|
(struct fs_usage): Use uintmax_t for block sizes, so that they're
not limited to INT_MAX.
Use bool for booleans.
|
|
to worry about wraparound.
|
|
(FCT): Use size_t, not unsigned int, for sizes.
(EXT): Use ptrdiff_t, not int, for a variable that has to
store a size-related quantity but might go negative.
ptrdiff_t is good enough here, since in practice the value
can't exceed SIZE_MAX/2.
|
|
(errno): Remove decl; we now assume C89 or better.
|
|
|
|
|
|
(strip_trailing_slashes): Now returns bool.
|
|
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.
Use bool when appropriate.
|
|
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.
|
|
|
|
(safe_rw): Don't work around Tru64 bug unless the bug symptoms
manifest themselves. This allows us to do proper reads and writes
on other hosts, e.g., "dd" with a block size greater than 2**31.
|
|
|
|
|
|
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.
|
|
(UNALIGNED_P): Remove.
(__memrchr): Use size_t, not uintptr_t, to test alignment.
|
|
(UNALIGNED_P): Remove.
(__memchr): Use size_t, not uintptr_t, to test alignment.
|
|
as it defines symbols like UINT32_MAX on Solaris 8.
(md5_uint32): Assume uint32_t exists; Autoconf will define it
otherwise (if the host has a 32-bit unsigned type, anyway).
|
|
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.
|
|
|
|
|
|
Use mode_t for modes, not int. All uses changed.
(errno): Remove decl; no longer needed since we assume C89.
|
|
(make_path, make_dir): Use bool, not int, since we're not setting errno.
Use mode_t for modes, not int. All uses changed.
|
|
|
|
|
|
(mode_compile): Use bool when appropriate.
|
|
|
|
|
|
|
|
|
|
|
|
(V_STRDUP): Don't assume the string's length fits in int.
(ISDIGIT): unsigned -> unsigned int
(is_number): Define only ifdef __DJGPP__; not needed elsewhere.
Use bool instead of int where appropriate.
Do not allow empty strings.
(parse_user_spec): Parse numbers as decimal integers, even if
they have a leading 0. Don't assume uids and gids fit in int.
|
|
|
|
|
|
(LONG_MAX_32_BITS): Remove.
Include <inttypes.h> and <stdint.h> if available.
(alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
(__memrchr): Don't assume unsigned long int is either 4 or 8 bytes;
let it be any number of bytes greater than or equal to 4.
|
|
(LONG_MAX_32_BITS): Remove.
Include <inttypes.h> and <stdint.h> if available.
(alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
(__memchr): Don't assume unsigned long int is either 4 or 8 bytes;
let it be any number of bytes greater than or equal to 4.
* memrchr.c: Likewise, with __memrchr.
|
|
|
|
suffices with C89 or better.
(alignof): New macro, portable to all C89 hosts.
(UNALIGNED): Use it. Use uintptr_t if available, and assume
everything is unaligned otherwise; this is more portable than
assuming 'unsigned long int' will always work.
|
|
ifdef _LIBC.
(md5_uint32): Use uint32_t if available. Simplify fallback ifdefs.
|
|
(EOVERFLOW): Define if not defined.
(getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
occurs.
|
|
|
|
|
|
eaccess on Solaris and SVR4-like systems.
(euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
|
|
|
|
you need to include first. You don't need to include any files
other than the usual config.h.
Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
Remove 'struct stat;' not needed since we know sys/stat.h has
been included by dev-ino.h.
(struct cycle_check_state): Change chdir_counter to uintmax_t,
not size_t, since it isn't limited by object sizes.
Change magic from long unsigned int to int; that's good enough
for our use.
|
|
is_power_of_two, to reflect better what it really does.
All uses changed. Arg is now uintmax_t, not unsigned int
(it should have been unsigned long int -- that was a bug).
(cycle_check): Check for integer overflow in cycle count,
and report a cycle if that happens, as it must be a cycle
by this point.
|
|
|
|
|