From d0bf19739dfd5f9d72d11cfb27318330c6e76aac Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Mon, 20 Feb 2017 21:07:46 +0100
Subject: [PATCH 1/2] WIP first set cleaned up

---
 include/monetary.h |  2 +-
 include/pwd.h      | 55 +++++++++++++++++++++++++++---------------------------
 include/search.h   |  5 ++---
 include/strings.h  |  2 +-
 include/time.h     |  2 +-
 include/wordexp.h  |  9 ++++-----
 sys/sys/wait.h     |  7 +++++--
 7 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/include/monetary.h b/include/monetary.h
index 3c9e1df118..93c4710603 100644
--- a/include/monetary.h
+++ b/include/monetary.h
@@ -30,7 +30,7 @@
 #define	_MONETARY_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>
+#include <machine/stdint.h>	/* for ...__ types */
 
 #ifndef _SIZE_T_DECLARED
 typedef	__size_t	size_t;
diff --git a/include/pwd.h b/include/pwd.h
index 5b626d8b4c..befcad286d 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -33,20 +33,24 @@
  *
  *	@(#)pwd.h	8.2 (Berkeley) 1/21/94
  * $FreeBSD: src/include/pwd.h,v 1.17 2009/03/14 19:13:01 das Exp $
- * $DragonFly: src/include/pwd.h,v 1.2 2003/11/14 01:01:43 dillon Exp $
  */
 
 #ifndef _PWD_H_
 #define	_PWD_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>
+#include <machine/stdint.h>	/* for __... types */
 
 #ifndef _GID_T_DECLARED
 typedef	__uint32_t	gid_t;
 #define	_GID_T_DECLARED
 #endif
 
+#ifndef _SIZE_T_DECLARED
+typedef	__size_t	size_t;
+#define	_SIZE_T_DECLARED
+#endif
+
 #ifndef _TIME_T_DECLARED
 typedef	__time_t	time_t;
 #define	_TIME_T_DECLARED
@@ -57,12 +61,7 @@ typedef	__uint32_t	uid_t;
 #define	_UID_T_DECLARED
 #endif
 
-#ifndef _SIZE_T_DECLARED
-typedef __size_t	size_t;
-#define _SIZE_T_DECLARED
-#endif
-
-#define _PATH_PWD		"/etc"
+#define	_PATH_PWD		"/etc"
 #define	_PATH_PASSWD		"/etc/passwd"
 #define	_PASSWD			"passwd"
 #define	_PATH_MASTERPASSWD	"/etc/master.passwd"
@@ -90,21 +89,21 @@ typedef __size_t	size_t;
  * tag, and that is what the _PW_VERSIONED macro is about.
  */
 
-#define _PW_VERSION_MASK	'\xF0'
-#define _PW_VERSIONED(x, v)	((unsigned char)(((x) & 0xCF) | ((v)<<4)))
+#define	_PW_VERSION_MASK	'\xF0'
+#define	_PW_VERSIONED(x, v)	((unsigned char)(((x) & 0xCF) | ((v)<<4)))
 
 #define	_PW_KEYBYNAME		'\x31'	/* stored by name */
 #define	_PW_KEYBYNUM		'\x32'	/* stored by entry in the "file" */
 #define	_PW_KEYBYUID		'\x33'	/* stored by uid */
-#define _PW_KEYYPENABLED	'\x34'	/* YP is enabled */
+#define	_PW_KEYYPENABLED	'\x34'	/* YP is enabled */
 #define	_PW_KEYYPBYNUM		'\x35'	/* special +@netgroup entries */
 
 /* The database also contains a key to indicate the format version of
  * the entries therein.  There may be other, older versioned entries
  * as well.
  */
-#define _PWD_VERSION_KEY	"\xFF" "VERSION"
-#define _PWD_CURRENT_VERSION	'\x04'
+#define	_PWD_VERSION_KEY	"\xFF" "VERSION"
+#define	_PWD_CURRENT_VERSION	'\x04'
 
 #define	_PASSWORD_EFMT1		'_'	/* extended encryption format */
 
@@ -125,25 +124,25 @@ struct passwd {
 };
 
 /* Mapping from fields to bits for pw_fields. */
-#define _PWF(x)		(1 << x)
-#define _PWF_NAME	_PWF(0)
-#define _PWF_PASSWD	_PWF(1)
-#define _PWF_UID	_PWF(2)
-#define _PWF_GID	_PWF(3)
-#define _PWF_CHANGE	_PWF(4)
-#define _PWF_CLASS	_PWF(5)
-#define _PWF_GECOS	_PWF(6)
-#define _PWF_DIR	_PWF(7)
-#define _PWF_SHELL	_PWF(8)
-#define _PWF_EXPIRE	_PWF(9)
+#define	_PWF(x)		(1 << x)
+#define	_PWF_NAME	_PWF(0)
+#define	_PWF_PASSWD	_PWF(1)
+#define	_PWF_UID	_PWF(2)
+#define	_PWF_GID	_PWF(3)
+#define	_PWF_CHANGE	_PWF(4)
+#define	_PWF_CLASS	_PWF(5)
+#define	_PWF_GECOS	_PWF(6)
+#define	_PWF_DIR	_PWF(7)
+#define	_PWF_SHELL	_PWF(8)
+#define	_PWF_EXPIRE	_PWF(9)
 
 /* XXX These flags are bogus.  With nsswitch, there are many
  * possible sources and they cannot be represented in a small integer.
  */
-#define _PWF_SOURCE	0x3000
-#define _PWF_FILES	0x1000
-#define _PWF_NIS	0x2000
-#define _PWF_HESIOD	0x3000
+#define	_PWF_SOURCE	0x3000
+#define	_PWF_FILES	0x1000
+#define	_PWF_NIS	0x2000
+#define	_PWF_HESIOD	0x3000
 
 __BEGIN_DECLS
 struct passwd	*getpwnam(const char *);
diff --git a/include/search.h b/include/search.h
index 1e9b99c51f..eddab04aec 100644
--- a/include/search.h
+++ b/include/search.h
@@ -4,14 +4,13 @@
  *
  *	$NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $
  * $FreeBSD: src/include/search.h,v 1.10 2002/10/16 14:29:23 robert Exp $
- * $DragonFly: src/include/search.h,v 1.6 2008/05/19 10:05:18 corecode Exp $
  */
 
 #ifndef _SEARCH_H_
-#define _SEARCH_H_
+#define	_SEARCH_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>
+#include <machine/stdint.h>	/* for __... types */
 
 #ifndef _SIZE_T_DECLARED
 typedef	__size_t	size_t;
diff --git a/include/strings.h b/include/strings.h
index 65a999299c..1e82a759be 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -30,7 +30,7 @@
 #define	_STRINGS_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>
+#include <machine/stdint.h>
 
 #ifndef _SIZE_T_DECLARED
 typedef	__size_t	size_t;
diff --git a/include/time.h b/include/time.h
index fe2a0a5f85..d44df833b0 100644
--- a/include/time.h
+++ b/include/time.h
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #include <sys/_null.h>
-#include <sys/types.h>
+#include <sys/stdint.h>
 
 #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
 /*
diff --git a/include/wordexp.h b/include/wordexp.h
index b286e61fb9..cfc607b0f3 100644
--- a/include/wordexp.h
+++ b/include/wordexp.h
@@ -24,21 +24,20 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/include/wordexp.h,v 1.5 2004/06/30 13:55:08 tjr Exp $
- * $DragonFly: src/include/wordexp.h,v 1.1 2008/10/06 21:01:37 swildner Exp $
  */
 
 #ifndef _WORDEXP_H_
 #define	_WORDEXP_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>
+#include <machine/stdint.h>	/* for __... types */
 
-#if __XSI_VISIBLE && !defined(_SIZE_T_DECLARED)
+#ifndef _SIZE_T_DECLARED
 typedef	__size_t	size_t;
 #define	_SIZE_T_DECLARED
 #endif
 
-typedef struct {
+typedef	struct {
 	__size_t	we_wordc;	/* count of words matched */
 	char		**we_wordv;	/* pointer to list of words */
 	__size_t	we_offs;	/* slots to reserve in we_wordv */
@@ -63,7 +62,7 @@ typedef struct {
 #define	WRDE_BADVAL	2		/* undefined variable */
 #define	WRDE_CMDSUB	3		/* command substitution not allowed */
 #define	WRDE_NOSPACE	4		/* no memory for result */
-#if __XSI_VISIBLE
+#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 700)
 #define	WRDE_NOSYS	5		/* obsolete, reserved */
 #endif
 #define	WRDE_SYNTAX	6		/* shell syntax error */
diff --git a/sys/sys/wait.h b/sys/sys/wait.h
index 02bb8029a7..ecbd953d6b 100644
--- a/sys/sys/wait.h
+++ b/sys/sys/wait.h
@@ -89,8 +89,11 @@
 #endif /* __BSD_VISIBLE */
 
 #if !defined(_KERNEL) || defined(_KERNEL_VIRTUAL)
-#ifndef _SYS_TYPES_H_
-#include <sys/types.h>
+#include <sys/stdint.h>
+
+#ifndef _PID_T_DECLARED
+typedef	__pid_t		pid_t;		/* process id */
+#define	_PID_T_DECLARED
 #endif
 
 __BEGIN_DECLS
-- 
2.11.0

