From 5a9410189792235c1a8b7002c8988e4b20063c87 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 24 Mar 2011 20:56:11 +0000 Subject: [PATCH] dir: Tidy header includes Since we adopted libroken, we get a lot of header includes automatically from roken.h. Use these, instead of including lots of things multiple times. Change-Id: I355cf33fdf72fed640c17ff5c2dfca1dd6f93d6f Reviewed-on: http://gerrit.openafs.org/4326 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/dir/buffer.c | 1 - src/dir/dir.c | 128 +++++++++++++++++++++------------------------- src/dir/salvage.c | 15 +----- 3 files changed, 59 insertions(+), 85 deletions(-) diff --git a/src/dir/buffer.c b/src/dir/buffer.c index 5058b3e31..f25bb1cde 100644 --- a/src/dir/buffer.c +++ b/src/dir/buffer.c @@ -12,7 +12,6 @@ #include -#include #include #ifdef AFS_64BIT_IOPS_ENV diff --git a/src/dir/dir.c b/src/dir/dir.c index b71794682..d34769a8c 100644 --- a/src/dir/dir.c +++ b/src/dir/dir.c @@ -10,44 +10,43 @@ #include #include - #ifdef KERNEL -#if !defined(UKERNEL) -#include "h/types.h" -#include "h/param.h" -#ifdef AFS_AUX_ENV -#include "h/mmu.h" -#include "h/seg.h" -#include "h/sysmacros.h" -#include "h/signal.h" -#include "h/errno.h" -#endif -#include "h/time.h" -#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) -#include "h/errno.h" -#else -#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) -#include "h/kernel.h" -#endif -#endif -#if defined(AFS_SUN56_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV) || defined(AFS_DARWIN80_ENV) -#include "afs/sysincludes.h" -#endif -#if !defined(AFS_SGI64_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD48_ENV) -#include "h/user.h" -#endif /* AFS_SGI64_ENV */ -#include "h/uio.h" -#ifdef AFS_OSF_ENV -#include -#include -#include -#endif -#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV) -#include "h/mbuf.h" -#endif -#ifndef AFS_LINUX20_ENV -#include "netinet/in.h" -#endif +# if !defined(UKERNEL) +# include "h/types.h" +# include "h/param.h" +# ifdef AFS_AUX_ENV +# include "h/mmu.h" +# include "h/seg.h" +# include "h/sysmacros.h" +# include "h/signal.h" +# include "h/errno.h" +# endif +# include "h/time.h" +# if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) +# include "h/errno.h" +# else +# if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) +# include "h/kernel.h" +# endif +# endif +# if defined(AFS_SUN56_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV) || defined(AFS_DARWIN80_ENV) +# include "afs/sysincludes.h" +# endif +# if !defined(AFS_SGI64_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD48_ENV) +# include "h/user.h" +# endif /* AFS_SGI64_ENV */ +# include "h/uio.h" +# ifdef AFS_OSF_ENV +# include +# include +# include +# endif +# if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV) +# include "h/mbuf.h" +# endif +# ifndef AFS_LINUX20_ENV +# include "netinet/in.h" +# endif /* afs_buffer.c */ /* These are needed because afs_prototypes.h is not included here */ @@ -55,53 +54,42 @@ struct dcache; extern void *DRead(struct dcache *adc, int page); extern void *DNew(struct dcache *adc, int page); -#else /* !defined(UKERNEL) */ -#include "afs/stds.h" -#include "afs/sysincludes.h" +# else /* !defined(UKERNEL) */ +# include "afs/stds.h" +# include "afs/sysincludes.h" /* afs_buffer.c */ /* These are needed because afs_prototypes.h is not included here */ extern void *DRead(afs_int32 *fid, int page); extern void *DNew(afs_int32 *fid, int page); -#endif /* !defined(UKERNEL) */ -#include "afs/afs_osi.h" +# endif /* !defined(UKERNEL) */ +# include "afs/afs_osi.h" -#include "afs/dir.h" +# include "afs/dir.h" -#ifdef AFS_LINUX20_ENV -#include "h/string.h" -#endif +# ifdef AFS_LINUX20_ENV +# include "h/string.h" +# endif /* generic renaming */ -#define NameBlobs afs_dir_NameBlobs -#define GetBlob afs_dir_GetBlob -#define Create afs_dir_Create -#define Length afs_dir_Length -#define Delete afs_dir_Delete -#define MakeDir afs_dir_MakeDir -#define Lookup afs_dir_Lookup -#define LookupOffset afs_dir_LookupOffset -#define EnumerateDir afs_dir_EnumerateDir -#define IsEmpty afs_dir_IsEmpty -#define InverseLookup afs_dir_InverseLookup -#define ChangeFid afs_dir_ChangeFid +# define NameBlobs afs_dir_NameBlobs +# define GetBlob afs_dir_GetBlob +# define Create afs_dir_Create +# define Length afs_dir_Length +# define Delete afs_dir_Delete +# define MakeDir afs_dir_MakeDir +# define Lookup afs_dir_Lookup +# define LookupOffset afs_dir_LookupOffset +# define EnumerateDir afs_dir_EnumerateDir +# define IsEmpty afs_dir_IsEmpty +# define InverseLookup afs_dir_InverseLookup +# define ChangeFid afs_dir_ChangeFid #else /* KERNEL */ -# ifdef HAVE_UNISTD_H -# include -# endif -# include -# include +# include # include "dir.h" -#ifdef AFS_NT40_ENV -#include -#else -#include -#endif - -#include #endif /* KERNEL */ afs_int32 DErrno; diff --git a/src/dir/salvage.c b/src/dir/salvage.c index 701346355..900b92ffc 100644 --- a/src/dir/salvage.c +++ b/src/dir/salvage.c @@ -16,20 +16,7 @@ #include #include - -#include -#include -#ifdef AFS_NT40_ENV -#include -#else -#include -#endif - -#include - -#ifdef HAVE_STDINT_H -# include -#endif +#include #include "dir.h" /* Defined in vol/vol-salvage.c */ -- 2.39.5