From 1e0126fcbf956b5893dabcac2c7c3f5002ce910c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 14 Dec 2010 08:09:49 -0500 Subject: More header simplification. All regression tests pass. --- cgps.c | 1 - gpsd.c | 19 ------------------- gpspipe.c | 13 ++++--------- libgps_core.c | 6 +++--- libgpsd_core.c | 17 ++++++++++------- net_gnss_dispatch.c | 5 +++-- sockaddr.h | 20 ++++++++++++++++++++ 7 files changed, 40 insertions(+), 41 deletions(-) diff --git a/cgps.c b/cgps.c index db294d6f..b097fcc8 100644 --- a/cgps.c +++ b/cgps.c @@ -82,7 +82,6 @@ #include #include /* for select() */ #ifndef S_SPLINT_S -#include #include #endif /* S_SPLINT_S */ #include diff --git a/gpsd.c b/gpsd.c index 2bf7fa0b..b7c0447b 100644 --- a/gpsd.c +++ b/gpsd.c @@ -25,25 +25,6 @@ #endif /* S_SPLINT_S */ #include "gpsd_config.h" -#ifndef S_SPLINT_S -#ifdef HAVE_SYS_SOCKET_H -#include -#else -#define AF_UNSPEC 0 -#endif /* HAVE_SYS_SOCKET_H */ -#ifdef HAVE_SYS_UN_H -#include -#endif /* HAVE_SYS_UN_H */ -#ifdef HAVE_NETINET_IN_H -#include -#endif /* HAVE_NETINET_IN_H */ -#ifdef HAVE_ARPA_INET_H -#include -#endif /* HAVE_ARPA_INET_H */ -#ifdef HAVE_NETDB_H -#include -#endif /* HAVE_NETDB_H */ -#endif /* S_SPLINT_S */ #if defined (HAVE_PATH_H) #include diff --git a/gpspipe.c b/gpspipe.c index fdf7ee7b..8df4a85d 100644 --- a/gpspipe.c +++ b/gpspipe.c @@ -26,20 +26,15 @@ #include #include #include -#include "gpsd_config.h" -#ifndef S_SPLINT_S -#if HAVE_SYS_SOCKET_H -#include -#endif /* HAVE_SYS_SOCKET_H */ -#include -#endif /* S_SPLINT_S */ #include #include #include -#if HAVE_TERMIOS #include -#endif /* HAVE_TERMIOS */ #include +#ifndef S_SPLINT_S +#include +#endif /* S_SPLINT_S */ + #include "gpsd.h" #include "gpsdclient.h" #include "revision.h" diff --git a/libgps_core.c b/libgps_core.c index 306cfbdc..9d96ec14 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -3,9 +3,6 @@ * This file is Copyright (c) 2010 by the GPSD project * BSD terms apply: see the file COPYING in the distribution root for details. */ -#ifndef S_SPLINT_S -#include -#endif /* S_SPLINT_S */ #include #include #include @@ -15,6 +12,9 @@ #include #include #include /* expected to have a select(2) prototype a la SuS */ +#ifndef S_SPLINT_S +#include +#endif /* S_SPLINT_S */ #include "gpsd.h" #include "gps_json.h" diff --git a/libgpsd_core.c b/libgpsd_core.c index 9997de09..f3240760 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -3,9 +3,18 @@ * This file is Copyright (c) 2010 by the GPSD project * BSD terms apply: see the file COPYING in the distribution root for details. */ +#include #include +#include +#include +#include +#include +#include +#ifndef S_SPLINT_S +#include +#endif /* S_SPLINT_S */ + #include "gpsd_config.h" -#include #ifdef HAVE_SYS_IOCTL_H #include #endif /* HAVE_SYS_IOCTL_H */ @@ -15,18 +24,12 @@ #else #define AF_UNSPEC 0 #endif /* HAVE_SYS_SOCKET_H */ -#include #endif /* S_SPLINT_S */ -#include -#include #ifndef S_SPLINT_S #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #endif /* S_SPLINT_S */ -#include -#include -#include #include "gpsd.h" diff --git a/net_gnss_dispatch.c b/net_gnss_dispatch.c index 96009aeb..1d3f2dab 100644 --- a/net_gnss_dispatch.c +++ b/net_gnss_dispatch.c @@ -5,6 +5,9 @@ */ #include +#include +#include + #include "gpsd_config.h" #ifndef S_SPLINT_S #ifdef HAVE_SYS_SOCKET_H @@ -12,8 +15,6 @@ #endif #include #endif /* S_SPLINT_S */ -#include -#include #include "gpsd.h" diff --git a/sockaddr.h b/sockaddr.h index 61866d09..118fb372 100644 --- a/sockaddr.h +++ b/sockaddr.h @@ -1,5 +1,25 @@ /* klugey def'n of a socket address struct helps hide IPV4 vs. IPV6 ugliness */ +#ifndef S_SPLINT_S +#ifdef HAVE_SYS_SOCKET_H +#include +#else +#define AF_UNSPEC 0 +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_SYS_UN_H +#include +#endif /* HAVE_SYS_UN_H */ +#ifdef HAVE_NETINET_IN_H +#include +#endif /* HAVE_NETINET_IN_H */ +#ifdef HAVE_ARPA_INET_H +#include +#endif /* HAVE_ARPA_INET_H */ +#ifdef HAVE_NETDB_H +#include +#endif /* HAVE_NETDB_H */ +#endif /* S_SPLINT_S */ + typedef union sockaddr_u { struct sockaddr sa; struct sockaddr_in sa_in; -- cgit v1.2.1