From 6ca73bf6707fde7b51cba7f952affc45c20bf551 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 14 Jun 2013 13:30:54 +0200 Subject: [PATCH] Cleanup including of system headers --- client.c | 6 ------ cmdmon.c | 1 - keys.c | 4 +--- local.c | 3 +-- manual.c | 2 +- md5.h | 6 +----- memory.h | 2 -- nameserv.c | 1 - ntp.h | 6 +----- ntp_io.c | 2 -- refclock_shm.c | 5 ++--- refclock_sock.c | 7 ++----- regress.c | 6 +----- rtc_linux.c | 23 +---------------------- rtc_linux.h | 4 ---- sys_linux.c | 14 +------------- sysincl.h | 3 +++ wrap_adjtimex.c | 7 ------- 18 files changed, 15 insertions(+), 87 deletions(-) diff --git a/client.c b/client.c index fec503b..d247977 100644 --- a/client.c +++ b/client.c @@ -48,12 +48,6 @@ #endif #endif -#ifdef HAS_STDINT_H -#include -#elif defined(HAS_INTTYPES_H) -#include -#endif - /* ================================================== */ union sockaddr_in46 { diff --git a/cmdmon.c b/cmdmon.c index c9fa39b..b61e776 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -34,7 +34,6 @@ #include "sched.h" #include "util.h" #include "logging.h" -#include "md5.h" #include "keys.h" #include "ntp_sources.h" #include "ntp_core.h" diff --git a/keys.c b/keys.c index 1c14dc2..e11a264 100644 --- a/keys.c +++ b/keys.c @@ -28,9 +28,7 @@ #include "config.h" -#include -#include -#include +#include "sysincl.h" #include "keys.h" #include "cmdparse.h" diff --git a/local.c b/local.c index 3cd1bb2..cbe8518 100644 --- a/local.c +++ b/local.c @@ -30,8 +30,7 @@ #include "config.h" -#include -#include +#include "sysincl.h" #include "conf.h" #include "local.h" diff --git a/manual.c b/manual.c index 47a4d1f..a7b117c 100644 --- a/manual.c +++ b/manual.c @@ -32,7 +32,7 @@ #include "config.h" -#include +#include "sysincl.h" #include "manual.h" #include "logging.h" diff --git a/md5.h b/md5.h index aaf9548..5f37235 100644 --- a/md5.h +++ b/md5.h @@ -32,11 +32,7 @@ *********************************************************************** */ -#ifdef HAS_STDINT_H -#include -#elif defined(HAS_INTTYPES_H) -#include -#endif +#include "sysincl.h" /* typedef a 32-bit type */ typedef uint32_t UINT4; diff --git a/memory.h b/memory.h index 4e584fb..5c65272 100644 --- a/memory.h +++ b/memory.h @@ -27,8 +27,6 @@ #ifndef GOT_MEMORY_H #define GOT_MEMORY_H -#include - #define Malloc(x) malloc(x) #define MallocNew(T) ((T *) malloc(sizeof(T))) #define MallocArray(T, n) ((T *) malloc((n) * sizeof(T))) diff --git a/nameserv.c b/nameserv.c index 1770845..328212b 100644 --- a/nameserv.c +++ b/nameserv.c @@ -32,7 +32,6 @@ #include "nameserv.h" #include "util.h" -#include /* ================================================== */ diff --git a/ntp.h b/ntp.h index 8801970..6ae7bd8 100644 --- a/ntp.h +++ b/ntp.h @@ -27,11 +27,7 @@ #ifndef GOT_NTP_H #define GOT_NTP_H -#ifdef HAS_STDINT_H -#include -#elif defined(HAS_INTTYPES_H) -#include -#endif +#include "sysincl.h" #include "hash.h" diff --git a/ntp_io.c b/ntp_io.c index 803be91..9924056 100644 --- a/ntp_io.c +++ b/ntp_io.c @@ -39,8 +39,6 @@ #include "conf.h" #include "util.h" -#include - union sockaddr_in46 { struct sockaddr_in in4; #ifdef HAVE_IPV6 diff --git a/refclock_shm.c b/refclock_shm.c index 110236f..acf2e52 100644 --- a/refclock_shm.c +++ b/refclock_shm.c @@ -27,13 +27,12 @@ #include "config.h" +#include "sysincl.h" + #include "refclock.h" #include "logging.h" #include "util.h" -#include -#include - #define SHMKEY 0x4e545030 struct shmTime { diff --git a/refclock_sock.c b/refclock_sock.c index 79e0e54..73f02be 100644 --- a/refclock_sock.c +++ b/refclock_sock.c @@ -27,16 +27,13 @@ #include "config.h" +#include "sysincl.h" + #include "refclock.h" #include "logging.h" #include "util.h" #include "sched.h" -#include -#include -#include -#include - #define SOCK_MAGIC 0x534f434b struct sock_sample { diff --git a/regress.c b/regress.c index 60e589a..8922288 100644 --- a/regress.c +++ b/regress.c @@ -28,11 +28,7 @@ #include "config.h" -#include -#include - -#include -#include +#include "sysincl.h" #include "regress.h" #include "logging.h" diff --git a/rtc_linux.c b/rtc_linux.c index 500af30..2c52426 100644 --- a/rtc_linux.c +++ b/rtc_linux.c @@ -29,25 +29,8 @@ #include "config.h" -#if defined LINUX +#include "sysincl.h" -#ifdef sparc -#define __KERNEL__ -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include #include #include "logging.h" @@ -1067,7 +1050,3 @@ RTC_Linux_Trim(void) return 1; } - -/* ================================================== */ - -#endif /* defined LINUX */ diff --git a/rtc_linux.h b/rtc_linux.h index 04896a3..4ac13e1 100644 --- a/rtc_linux.h +++ b/rtc_linux.h @@ -28,8 +28,6 @@ #include "reports.h" -#if defined LINUX - extern int RTC_Linux_Initialise(void); extern void RTC_Linux_Finalise(void); extern void RTC_Linux_TimePreInit(void); @@ -44,6 +42,4 @@ extern int RTC_Linux_Trim(void); extern void RTC_Linux_CycleLogFile(void); -#endif /* defined LINUX */ - #endif /* _GOT_RTC_LINUX_H */ diff --git a/sys_linux.c b/sys_linux.c index f6c2d8d..80c888e 100644 --- a/sys_linux.c +++ b/sys_linux.c @@ -29,14 +29,8 @@ #include "config.h" -#ifdef LINUX +#include "sysincl.h" -#include -#include -#include -#include -#include -#include #include #if defined(HAVE_SCHED_SETSCHEDULER) @@ -1250,9 +1244,3 @@ void SYS_Linux_MemLockAll(int LockAll) } } #endif /* HAVE_MLOCKALL */ - -#endif /* LINUX */ - -/* vim:ts=8 - * */ - diff --git a/sysincl.h b/sysincl.h index 1baef39..55c0207 100644 --- a/sysincl.h +++ b/sysincl.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,8 @@ #include #include #include +#include +#include #include #include diff --git a/wrap_adjtimex.c b/wrap_adjtimex.c index d0cd14a..9e2f1b8 100644 --- a/wrap_adjtimex.c +++ b/wrap_adjtimex.c @@ -31,10 +31,6 @@ #include "config.h" -#ifdef LINUX - -#define _LOOSE_KERNEL_NAMES - #include "chrony_timex.h" #include "wrap_adjtimex.h" @@ -276,6 +272,3 @@ TMX_ApplyStepOffset(double offset) return adjtimex(&txc); } - -#endif -