glibc/sysdeps/generic
Zack Weinberg 11160cb76f Installed-header hygiene (BZ#20366): obsolete BSD u_* types.
The types u_char, u_short, u_int, u_long, ushort, uint, ulong, u_int8_t,
u_int16_t, u_int32_t, u_int64_t, quad_t, and u_quad_t are BSDisms that
have never been standardized.  While glibc should continue to *provide*
these types for compatibility's sake, its public headers should not
use them.

The meat of this change was mechanically generated by the following
shell command:

    perl -pi~ -e '
        s/\b(__)?u_char\b/unsigned char/g;
        s/\b(__)?u_?short\b/unsigned short/g;
        s/\b(__)?u_?int\b/unsigned int/g;
        s/\b(__)?u_?long\b/unsigned long/g;
        s/\b(__)?u_int8_t\b/uint8_t/g;
        s/\b(__)?u_int16_t\b/uint16_t/g;
        s/\b(__)?u_int32_t\b/uint32_t/g;
        s/\b(__)?u_int64_t\b/uint64_t/g;
        s/\b(__)?u_quad_t\b/uint64_t/g;
        s/\b(__)?quad_t\b/uint64_t/g;
    ' $(grep -lE -e '\<((__)?(quad_t|u(short|int|long|_(char|short|int([0-9]+_t)?|long|quad_t))))\>' \
        $(grep -LE '\<(_(SYS|BITS)_TYPES_H|rpc/(rpc|rpc_msg|types|xdr)\.h)\>' \
          $(find . \( -false $(sed 's/^/-o -name /' all-installed-headers) \
                   \) -printf '%P\n' | sort -u)))

where 'all-installed-headers' was a list of the basenames of all installed
header files, manually extracted from the Makefiles.  Non-installed
wrapper headers in include/ are also adjusted, for consistency.
I then manually fixed up indentation and line-wrapping.

sys/types.h and bits/types.h are excluded because they must continue
to define the u_* types (under __USE_MISC) for compatibility with
applications.  They do not use these types themselves.

All headers that (transitively) include rpc/types.h are also excluded,
for three reasons.  First, the u_* types are defined by rpc/types.h,
unconditionally (not just under __USE_MISC) so they are logically part
of the SunRPC API.  Second, many of those headers appear to be
machine-generated.  Third, it's my understanding that we are getting
rid of as much of SunRPC as possible in the near future.

(The one file under sunrpc/ that's touched, sunrpc/rpc/rpc_des.h, does
*not* include rpc/types.h.  This may itself be a bug.)

After changing from u_intNN_t to uintNN_t, a number of headers now
need to include stdint.h to pick up those types.  It might be more
hygenic, namespace-wise, to use __uintNN_t instead, but none of these
headers are bound by ISO or POSIX to do so, and it's unlikely that
anyone using them will be bothered.  (The two files that were using
__-prefixed versions of the u_types, sysdeps/mach/hurd/net/route.h and
sysdeps/unix/sysv/linux/net/route.h, both already also contained uses of
the unprefixed versions.)

Some of these files directly included features.h and/or sys/cdefs.h,
which I removed, as the style generally seems to be to let sys/types.h
do that for us.  (This does not change the set of definitions exposed
by any header; sys/types.h unconditionally includes both features.h
and sys/cdefs.h.)

One file included asm/types.h unnecessarily.

	* bits/in.h, gmon/sys/gmon.h, inet/netinet/igmp.h
	* inet/protocols/routed.h, inet/protocols/talkd.h
	* inet/protocols/timed.h, io/fts.h, nptl_db/thread_db.h
	* resolv/arpa/nameser.h, resolv/resolv.h, sunrpc/rpc/rpc_des.h
	* sysdeps/generic/netinet/if_ether.h
	* sysdeps/generic/netinet/in_systm.h
	* sysdeps/generic/netinet/ip.h, sysdeps/generic/netinet/tcp.h
	* sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h
	* sysdeps/gnu/netinet/udp.h, sysdeps/mach/hurd/net/ethernet.h
	* sysdeps/mach/hurd/net/if_arp.h
	* sysdeps/mach/hurd/net/if_ppp.h
	* sysdeps/mach/hurd/net/route.h, sysdeps/mach/sys/reboot.h
	* sysdeps/unix/sysv/linux/bits/in.h
	* sysdeps/unix/sysv/linux/net/ethernet.h
	* sysdeps/unix/sysv/linux/net/if_arp.h
	* sysdeps/unix/sysv/linux/net/if_ppp.h
	* sysdeps/unix/sysv/linux/net/if_shaper.h
	* sysdeps/unix/sysv/linux/net/route.h
	* sysdeps/unix/sysv/linux/netinet/if_ether.h
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h
	* sysdeps/unix/sysv/linux/netinet/if_tr.h
	* sysdeps/unix/sysv/linux/netipx/ipx.h
	* sysdeps/unix/sysv/linux/sys/acct.h
	* include/arpa/nameser.h, include/resolv.h:
	Change all uses of u_char to unsigned char,
	u_short and ushort to unsigned short, u_int and uint to unsigned int,
	u_long and ulong to unsigned long, u_int8_t to uint8_t,
        u_int16_t to uint16_t, u_int32_t to uint32_t, quad_t to int64_t,
	and u_int64_t and u_quad_t to uint64_t.

	* mach/sys/reboot.h: Remove two casts of integer literals
	to the types they already have.

	* bits/in.h: Correct error in description of IP_MULTICAST_LOOP.
	* sysdeps/unix/sysv/linux/bits/in.h: Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_ether.h: Change a comment
	from referring to 'unsigned char' to 'uint8_t' for consistency with
	the macro definition below.

	* gmon/sys/gmon.h, inet/netinet/igmp.h, inet/protocols/talkd.h
	* io/fts.h, resolv/arpa/nameser.h, resolv/resolv.h
	* sunrpc/rpc/rpc_des.h, sysdeps/generic/netinet/ip.h
	* sysdeps/gnu/netinet/tcp.h, sysdeps/gnu/netinet/udp.h
	* sysdeps/mach/hurd/net/if_ppp.h, sysdeps/unix/sysv/linux/net/if_ppp.h
	* sysdeps/unix/sysv/linux/sys/acct.h
	* include/arpa/nameser.h, include/resolv.h:
	Fix indentation disrupted by mechanical edits.

	* inet/protocols/talkd.h, resolv/arpa/nameser.h
	* sysdeps/generic/netinet/in_systm.h
	* sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h
	* sysdeps/gnu/netinet/udp.h
	* sysdeps/unix/sysv/linux/net/ethernet.h
	* sysdeps/unix/sysv/linux/net/if_arp.h
	* sysdeps/unix/sysv/linux/net/if_ppp.h
	* sysdeps/unix/sysv/linux/net/if_shaper.h
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h
	* sysdeps/unix/sysv/linux/netinet/if_tr.h
	* sysdeps/unix/sysv/linux/netipx/ipx.h
	* sysdeps/unix/sysv/linux/sys/acct.h
	Include stdint.h for uintNN_t definitions.
	Don't include sys/cdefs.h, features.h, or asm/types.h directly.
2016-09-23 08:43:56 -04:00
..
net Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
netinet Installed-header hygiene (BZ#20366): obsolete BSD u_* types. 2016-09-23 08:43:56 -04:00
nfs Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sys Minimize sysdeps code involved in defining major/minor/makedev. 2016-08-03 15:23:04 -04:00
_G_config.h Remove _G_OPEN64, _G_LSEEK64, _G_MMAP64, _G_FSTAT64 from _G_config.h. 2012-10-18 18:50:43 +00:00
_itoa.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
a.out.h update from main archive 961203 1996-12-04 01:41:39 +00:00
abort-instr.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
aio_misc.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
allocalim.h Update. 2002-10-09 09:42:48 +00:00
asm-syntax.h Update. 1997-10-15 05:34:02 +00:00
atomic-machine.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
c++-types.data Add placeholder c++-types.data and *.abilist files. 2015-02-13 15:41:34 -08:00
confstr.h Update. 1997-10-15 05:34:02 +00:00
device-nrs.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dirstream.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-cache.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-dtv.h elf: Avoid using memalign for TLS allocations [BZ #17730] 2016-08-03 16:15:38 +02:00
dl-fcntl.h hurd: Do not hide rtld symbols which need to be preempted 2016-03-20 19:51:42 +01:00
dl-fileid.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-fptr.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-hash.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-librecon.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-machine.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-mman.h Update copyright dates committed in 2016 2016-01-06 14:03:10 -08:00
dl-osinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-procinfo.c Dummy dl-procinfo.c file for platforms which don't have one. 2002-02-01 18:25:44 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-sysdep.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-tls.h Update. 2002-02-07 04:08:19 +00:00
dl-unistd.h Update copyright dates committed in 2016 2016-01-06 14:03:10 -08:00
dwarf2.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elide.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
eloop-threshold.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
entry.h Update. 2002-03-15 03:16:52 +00:00
errqueue.h Update. 2001-01-10 23:47:39 +00:00
exit-thread.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fd_to_filename.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fips-private.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fix-fp-int-convert-overflow.h S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
fix-int-fp-convert-zero.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fork.h Update. 2002-10-01 00:05:23 +00:00
fpu_control.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
frame.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
framestate.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gcc-compat.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
get-rounding-mode.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gmp-mparam.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hp-timing-common.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hp-timing.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ifreq.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ifunc-sel.h Move sysdeps/generic/elf/* to sysdeps/generic 2012-03-19 21:04:21 +01:00
intr-msg.h Update. 1997-10-15 05:34:02 +00:00
inttypes.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ld.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
ldconfig.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldsodefs.h Treat STV_HIDDEN and STV_INTERNAL symbols as STB_LOCAL 2016-07-01 23:48:52 +01:00
libanl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libBrokenLocale.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libc-lock.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-mmap.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-tsd.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libcidn.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libcrypt.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libdl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libm-test-ulps Update. 1999-10-19 06:29:27 +00:00
libm.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libnsl.abilist Add placeholder libnsl.abilist and libutil.abilist files 2016-03-07 00:49:36 +01:00
libnss_compat.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_db.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_dns.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_files.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_hesiod.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_nis.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_nisplus.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libpthread.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libresolv.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
librt.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libutil.abilist Add placeholder libnsl.abilist and libutil.abilist files 2016-03-07 00:49:36 +01:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
local-setxid.h * sysdeps/posix/spawni.c (__spawni): Use local_seteuid and 2006-06-04 22:17:06 +00:00
localplt.data Add hidden __tls_get_addr/___tls_get_addr alias 2014-12-21 09:27:11 -08:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
machine-lock.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
machine-sp.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
malloc-machine.h malloc: Remove NO_THREADS 2016-02-19 17:07:45 +01:00
malloc-sysdep.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
math_ldbl_opt.h * math/math.h [__NO_LONG_DOUBLE_MATH] (__nldbl_nexttowardf): New 2006-01-14 12:10:44 +00:00
math_ldbl.h Update. 1999-08-02 19:56:07 +00:00
math_private.h Remove __nan{f,,l} macros 2016-09-20 14:37:41 -05:00
math-tests-arch.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
math-tests.h Add tests for fegetexceptflag, fesetexceptflag. 2016-08-10 21:01:08 +00:00
math-type-macros-double.h Build s_nan* objects from a generic template 2016-09-20 14:37:42 -05:00
math-type-macros-float.h Build s_nan* objects from a generic template 2016-09-20 14:37:42 -05:00
math-type-macros-ldouble.h Build s_nan* objects from a generic template 2016-09-20 14:37:42 -05:00
math-type-macros.h Build s_nan* objects from a generic template 2016-09-20 14:37:42 -05:00
memcopy.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
not-cancel.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd-types.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pagecopy.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
paths.h generic paths.h: remove old paths from _PATH_STDPATH 2012-11-04 10:11:39 +01:00
profil-counter.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pty-private.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
register-dump.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rtld-lowlevel.h Jakub Jelinek <jakub@redhat.com> 2006-10-10 00:51:29 +00:00
safe-fatal.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sigcontextinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
siglist.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sigset-cvt-mask.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stackguard-macros.h BZ #15754: Fix test case for ARM. 2013-09-23 01:44:38 -04:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stdint.h Add <stdint.h> integer width macros. 2016-09-21 17:06:36 +00:00
stdio-lock.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
string_private.h Add _STRING_INLINE_unaligned and string_private.h 2016-02-18 14:55:29 -02:00
symbol-hacks.h Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
sysdep-cancel.h * elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P. 2006-10-29 21:46:32 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
thread_state.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tininess.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tls-macros.h * elf/tls-macros.h: #include_next <tls-macros.h> to get a sysdeps 2005-03-13 09:09:05 +00:00
tls.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-audit.h Move testsuite audit definitions to sysdeps tst-audit.h files. 2012-07-26 11:29:07 +00:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unsecvars.h * malloc/malloc.c (_int_malloc): Remove unused any_larger variable. 2006-10-11 16:29:13 +00:00
unwind-dw2-fde-glibc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unwind-dw2-fde.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unwind-dw2-fde.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unwind-dw2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unwind-pe.c Update. 2004-03-10 10:04:19 +00:00
unwind-pe.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unwind-resume.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unwind.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
utmp-equal.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00