headers: include-what-you-use fixes
authorSami Kerola <kerolasa@iki.fi>
Wed, 8 Jun 2011 18:59:56 +0000 (20:59 +0200)
committerSami Kerola <kerolasa@iki.fi>
Wed, 8 Jun 2011 18:59:56 +0000 (20:59 +0200)
Usage of includes are set up the way found to be in use, with a help of
magnificent utility.

http://code.google.com/p/include-what-you-use/

Signed-off-by: Sami Kerola <kerolasa@iki.fi>

src/analyze.c
src/dhcpd-pools.c
src/dhcpd-pools.h
src/getdata.c
src/getopt.c
src/getopt1.c
src/other.c
src/output.c
src/sort.c

index e9bfad7..a023f98 100644 (file)
 ** along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include <stddef.h>
 #include <stdlib.h>
-#include <stdio.h>
 
 #include "dhcpd-pools.h"
 
index abcb8ca..232ed94 100644 (file)
@@ -20,9 +20,6 @@
 #endif
 
 #include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 #ifdef  HAVE_STDLIB_H
 #include <stdlib.h>
 #else                          /* Not STDC_HEADERS */
@@ -33,12 +30,12 @@ extern char *malloc();
 #else
 #include <strings.h>
 #endif
-#include <getopt.h>
-#include <errno.h>
 #include <err.h>
+#include <errno.h>
+#include <getopt.h>
 
-#include "dhcpd-pools.h"
 #include "defaults.h"
+#include "dhcpd-pools.h"
 
 int main(int argc, char **argv)
 {
index fcf75b2..c43bd33 100644 (file)
 # define DHCPD_POOLS_H 1
 
 #include <config.h>
+#include <stddef.h>
 
 /* Feature test switches */
 #define _POSIX_SOURCE 1
 #define POSIXLY_CORRECT 1
 
 #ifdef HAVE_STDLIB_H
-#include <stdlib.h>
 #else
 extern void exit();
 extern char *malloc();
+#define EXIT_FAILURE   1
+#define EXIT_SUCCESS   0
 #endif                         /* STDC_HEADERS */
 
 #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
index 5456b65..215c707 100644 (file)
 #include <config.h>
 #endif
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
 #ifdef  HAVE_STDLIB_H
 #include <stdlib.h>
 #else                          /* Not STDC_HEADERS */
@@ -37,20 +33,20 @@ extern char *malloc();
 #include <strings.h>
 #endif
 
-#include <stdio.h>
 #include <arpa/inet.h>
+#include <assert.h>
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <features.h>
 #include <netinet/in.h>
-#include <sys/socket.h>
+#include <stddef.h>
+#include <stdio.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #ifndef _XOPEN_SOURCE
 #define _XOPEN_SOURCE 600
 #endif
-#include <fcntl.h>
-#include <errno.h>
-#include <err.h>
-#include <ctype.h>
-#include <assert.h>
 
 #include "dhcpd-pools.h"
 #include "defaults.h"
index 9f01d83..8f49931 100644 (file)
@@ -26,9 +26,7 @@
 # define _NO_PROTO
 #endif
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <features.h>
 
 #if !defined __STDC__ || !__STDC__
 /* This is a separate conditional since some stdc systems
@@ -38,8 +36,6 @@
 # endif
 #endif
 
-#include <stdio.h>
-
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
    Library, but also included in many other GNU distributions.  Compiling
index d3182d8..652ae07 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 \f
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "getopt.h"
+#include <features.h>
 
 #if !defined __STDC__ || !__STDC__
 /* This is a separate conditional since some stdc systems
@@ -31,8 +27,6 @@
 #endif
 #endif
 
-#include <stdio.h>
-
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
    Library, but also included in many other GNU distributions.  Compiling
index 7719c4e..5e887e6 100644 (file)
@@ -28,9 +28,9 @@
 extern void exit();
 extern char *malloc();
 #endif                         /* STDC_HEADERS */
-#include <errno.h>
 #include <err.h>
-#include <stdarg.h>
+#include <errno.h>
+#include <stddef.h>
 #ifdef  HAVE_STRING_H
 #include <string.h>
 #else
index 874efa4..86423d9 100644 (file)
 #include <config.h>
 #endif
 
-#include <stdio.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <err.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 #include "dhcpd-pools.h"
 
index e436f5a..460f4cd 100644 (file)
 ** along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
+#include <err.h>
+#include <errno.h>
 #include <stdlib.h>
-#include <stdio.h>
 #include <string.h>
-#include <errno.h>
-#include <err.h>
 
 #include "dhcpd-pools.h"