Skip to content

Commit

Permalink
lib: Automated cleanup of cdefs and other formatting
Browse files Browse the repository at this point in the history
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
  • Loading branch information
bsdimp committed Nov 27, 2023
1 parent 33ccf36 commit a2f733a
Show file tree
Hide file tree
Showing 239 changed files with 6 additions and 248 deletions.
1 change: 0 additions & 1 deletion lib/csu/arm/crt1_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/elf_common.h>

Expand Down
1 change: 0 additions & 1 deletion lib/csu/common/crtbegin.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>

#include "crt.h"
Expand Down
1 change: 0 additions & 1 deletion lib/csu/tests/cxx_constructors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/wait.h>

Expand Down
1 change: 0 additions & 1 deletion lib/csu/tests/fini_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/wait.h>

Expand Down
1 change: 0 additions & 1 deletion lib/flua/libjail/lua_jail.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/jail.h>
#include <errno.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/concat/geom_concat.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/eli/geom_eli.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/mman.h>
#include <sys/sysctl.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/journal/geom_journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/journal/geom_journal_ufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/disklabel.h>
#include <sys/mount.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/label/geom_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/mirror/geom_mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <err.h>
#include <errno.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/multipath/geom_multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/raid/geom_raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/raid3/geom_raid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/shsec/geom_shsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/stripe/geom_stripe.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/geom/virstor/geom_virstor.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <errno.h>
#include <paths.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libbe/be.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/module.h>
#include <sys/mount.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libc/db/recno/rec_seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include <errno.h>
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/rpc/svc_dg.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* Copyright (c) 1986-1991 by Sun Microsystems Inc.
*/

#if defined(LIBC_SCCS) && !defined(lint)
#endif
/*
* svc_dg.c, Server side for connectionless RPC.
*
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/stdio/vfwprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
* SUCH DAMAGE.
*/

#if 0
#endif
/*
* Actual wprintf innards.
*
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/stdio/vfwscanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
* SUCH DAMAGE.
*/

#if 0
#endif
#include "namespace.h"
#include <ctype.h>
#include <inttypes.h>
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/stdlib/getopt_long.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#if 0
#endif
#include <err.h>
#include <errno.h>
#include <getopt.h>
Expand Down
3 changes: 0 additions & 3 deletions lib/libc/stdlib/ptsname.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
* SUCH DAMAGE.
*/

#ifndef lint
#endif /* not lint */

#include "namespace.h"
#include <sys/param.h>
#include <sys/ioctl.h>
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/string/wcsncpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/

#if 0
#endif
#include <wchar.h>

/*
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/string/wcsstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/

#if 0
#endif
#include <wchar.h>

/*
Expand Down
1 change: 0 additions & 1 deletion lib/libcam/camlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/param.h>
#include <assert.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcam/camlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#ifndef _CAMLIB_H
#define _CAMLIB_H

#include <sys/cdefs.h>
#include <sys/param.h>

#include <cam/cam.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcam/scsi_cmdparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* From: scsi.c,v 1.8 1997/02/22 15:07:54 peter Exp $
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include <stdlib.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcam/scsi_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* details.
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include <err.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/libcasper/libcasper.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/nv.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/libcasper/libcasper_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/libcasper/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/libcasper/zygote.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/capsicum.h>
#include <sys/procdesc.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_dns/tests/dns_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/capsicum.h>
#include <sys/nv.h>

Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_fileargs/cap_fileargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/capsicum.h>
#include <sys/sysctl.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/capsicum.h>
#include <sys/stat.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_grp/tests/grp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/capsicum.h>
#include <sys/nv.h>

Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_net/tests/net_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_netdb/tests/netdb_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/capsicum.h>
#include <sys/nv.h>

Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_pwd/cap_pwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/nv.h>

Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_pwd/tests/pwd_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/capsicum.h>
#include <sys/nv.h>

Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_sysctl/cap_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/cnv.h>
#include <sys/dnv.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/capsicum.h>
#include <sys/sysctl.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcompat/4.1/ftime.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/timeb.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcrypt/crypt-md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include <err.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcrypt/crypt-nthash.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include <netinet/in.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcrypt/crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include <string.h>
Expand Down
1 change: 0 additions & 1 deletion lib/libcrypt/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
#include <sys/types.h>

#include "crypt.h"
Expand Down
Loading

0 comments on commit a2f733a

Please sign in to comment.