From b41eac5a4d0f87624296ed36b492f918747ec4a6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 17 Apr 2022 16:12:51 +0100 Subject: Prefer pragma once --- netfs/daemon/daemon.h | 5 +---- netfs/daemon/daemonDirectory.h | 5 +---- netfs/daemon/daemonFile.h | 5 +---- netfs/daemon/daemonService.h | 5 +---- netfs/daemon/daemonVolume.h | 5 +---- netfs/daemon/modeCheck.h | 5 +---- netfs/fuse/fuseApp.h | 5 +---- netfs/fuse/fuseApp.impl.h | 5 +---- netfs/fuse/fuseAppBase.h | 5 +---- netfs/fuse/fuseDirs.h | 5 +---- netfs/fuse/fuseFiles.h | 5 +---- netfs/fuse/fuseMappersImpl.h | 5 +---- netfs/ice/directory.ice | 6 +----- netfs/ice/exceptions.ice | 6 +----- netfs/ice/file.ice | 6 +----- netfs/ice/mapper.ice | 6 +----- netfs/ice/numeric.h | 5 +---- netfs/ice/service.ice | 6 +----- netfs/ice/typeConverter.h | 5 +---- netfs/ice/types.ice | 6 +----- netfs/ice/volume.ice | 6 +----- netfs/lib/baseMapper.h | 5 +---- netfs/lib/defaultMapper.h | 5 +---- netfs/lib/entCache.h | 5 +---- netfs/lib/entCache.impl.h | 5 +---- netfs/lib/entries.h | 5 +---- netfs/lib/entryResolver.h | 5 +---- netfs/unittests/mockDaemon.h | 5 +---- netfs/unittests/mockFuse.h | 5 +---- netfs/unittests/mockGlacier.h | 5 +---- netfs/unittests/mockMount.h | 5 +---- 31 files changed, 31 insertions(+), 131 deletions(-) diff --git a/netfs/daemon/daemon.h b/netfs/daemon/daemon.h index 373c0cb..353c89b 100644 --- a/netfs/daemon/daemon.h +++ b/netfs/daemon/daemon.h @@ -1,5 +1,4 @@ -#ifndef DAEMON_H -#define DAEMON_H +#pragma once #include #include @@ -29,5 +28,3 @@ private: std::string hostname(); }; - -#endif diff --git a/netfs/daemon/daemonDirectory.h b/netfs/daemon/daemonDirectory.h index 83a827a..183e102 100644 --- a/netfs/daemon/daemonDirectory.h +++ b/netfs/daemon/daemonDirectory.h @@ -1,5 +1,4 @@ -#ifndef DAEMONDIRECTORY_H -#define DAEMONDIRECTORY_H +#pragma once #include #include @@ -16,5 +15,3 @@ public: private: DIR * od; }; - -#endif diff --git a/netfs/daemon/daemonFile.h b/netfs/daemon/daemonFile.h index e5b7475..2da4c6f 100644 --- a/netfs/daemon/daemonFile.h +++ b/netfs/daemon/daemonFile.h @@ -1,5 +1,4 @@ -#ifndef DAEMONFILE_H -#define DAEMONFILE_H +#pragma once #include #include @@ -19,5 +18,3 @@ public: private: const int fd; }; - -#endif diff --git a/netfs/daemon/daemonService.h b/netfs/daemon/daemonService.h index 753583e..fe79e21 100644 --- a/netfs/daemon/daemonService.h +++ b/netfs/daemon/daemonService.h @@ -1,5 +1,4 @@ -#ifndef DAEMONSERVICE_H -#define DAEMONSERVICE_H +#pragma once #include #include @@ -18,5 +17,3 @@ private: NetFS::Daemon::ConfigurationPtr config; }; - -#endif diff --git a/netfs/daemon/daemonVolume.h b/netfs/daemon/daemonVolume.h index 649d8c2..8fdf670 100644 --- a/netfs/daemon/daemonVolume.h +++ b/netfs/daemon/daemonVolume.h @@ -1,5 +1,4 @@ -#ifndef DAEMONVOLUME_H -#define DAEMONVOLUME_H +#pragma once #include #include @@ -52,5 +51,3 @@ private: EntryResolver & groupLookup; EntryTypeConverter converter; }; - -#endif diff --git a/netfs/daemon/modeCheck.h b/netfs/daemon/modeCheck.h index 6365816..4a57317 100644 --- a/netfs/daemon/modeCheck.h +++ b/netfs/daemon/modeCheck.h @@ -1,5 +1,4 @@ -#ifndef NETFS_DAEMON_IOHELPERS -#define NETFS_DAEMON_IOHELPERS +#pragma once #include #include @@ -32,5 +31,3 @@ private: const EntryResolver & userLookup; const EntryResolver & groupLookup; }; - -#endif diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h index dcb00c7..78cdf06 100644 --- a/netfs/fuse/fuseApp.h +++ b/netfs/fuse/fuseApp.h @@ -1,5 +1,4 @@ -#ifndef NETFS_FUSE_H -#define NETFS_FUSE_H +#pragma once #include "cache.h" #include "fuseAppBase.h" @@ -117,5 +116,3 @@ namespace NetFS { StatCache statCache; }; } - -#endif diff --git a/netfs/fuse/fuseApp.impl.h b/netfs/fuse/fuseApp.impl.h index af05b0b..f509ad9 100644 --- a/netfs/fuse/fuseApp.impl.h +++ b/netfs/fuse/fuseApp.impl.h @@ -1,5 +1,4 @@ -#ifndef NETFS_FUSE_COMMON_H -#define NETFS_FUSE_COMMON_H +#pragma once #include "fuseApp.h" #include @@ -38,5 +37,3 @@ namespace NetFS { map.erase(localID); } } - -#endif diff --git a/netfs/fuse/fuseAppBase.h b/netfs/fuse/fuseAppBase.h index ef7b27f..035af21 100644 --- a/netfs/fuse/fuseAppBase.h +++ b/netfs/fuse/fuseAppBase.h @@ -1,5 +1,4 @@ -#ifndef FUSEAPP_H -#define FUSEAPP_H +#pragma once #include #include @@ -189,5 +188,3 @@ protected: return (fuseApp->*f)(a...); } }; - -#endif diff --git a/netfs/fuse/fuseDirs.h b/netfs/fuse/fuseDirs.h index bb02e65..87a5b06 100644 --- a/netfs/fuse/fuseDirs.h +++ b/netfs/fuse/fuseDirs.h @@ -1,5 +1,4 @@ -#ifndef NETFS_FUSE_DIRS_H -#define NETFS_FUSE_DIRS_H +#pragma once #include "fuseApp.impl.h" @@ -12,5 +11,3 @@ namespace NetFS { const std::string path; }; } - -#endif diff --git a/netfs/fuse/fuseFiles.h b/netfs/fuse/fuseFiles.h index ca6cf53..46dff07 100644 --- a/netfs/fuse/fuseFiles.h +++ b/netfs/fuse/fuseFiles.h @@ -1,5 +1,4 @@ -#ifndef NETFS_FUSE_FILES_H -#define NETFS_FUSE_FILES_H +#pragma once #include "fuseApp.h" #include @@ -28,5 +27,3 @@ namespace NetFS { mutable std::shared_mutex mutex; }; } - -#endif diff --git a/netfs/fuse/fuseMappersImpl.h b/netfs/fuse/fuseMappersImpl.h index a87f7ba..e37874a 100644 --- a/netfs/fuse/fuseMappersImpl.h +++ b/netfs/fuse/fuseMappersImpl.h @@ -1,5 +1,4 @@ -#ifndef NETFS_MAPPING_CLIENTIMPL_H -#define NETFS_MAPPING_CLIENTIMPL_H +#pragma once #include "baseMapper.h" #include "entries.h" @@ -27,5 +26,3 @@ namespace NetFS::Client { Mapping::FileSystem mapTransport(const std::string & un, const std::string & gn) override; }; } - -#endif diff --git a/netfs/ice/directory.ice b/netfs/ice/directory.ice index 4424d3f..4f5ce79 100644 --- a/netfs/ice/directory.ice +++ b/netfs/ice/directory.ice @@ -1,5 +1,4 @@ -#ifndef _DIRECTORY -#define _DIRECTORY +#pragma once #include "exceptions.ice" #include "types.ice" @@ -12,6 +11,3 @@ module NetFS { idempotent DirectoryContents listdir() throws AuthError, SystemError; }; }; - -#endif - diff --git a/netfs/ice/exceptions.ice b/netfs/ice/exceptions.ice index 02a42e0..4f12321 100644 --- a/netfs/ice/exceptions.ice +++ b/netfs/ice/exceptions.ice @@ -1,5 +1,4 @@ -#ifndef _EXCEPTIONS -#define _EXCEPTIONS +#pragma once module NetFS { // Exceptions @@ -18,6 +17,3 @@ module NetFS { string exportName; }; }; - -#endif - diff --git a/netfs/ice/file.ice b/netfs/ice/file.ice index 7a41f18..fba14df 100644 --- a/netfs/ice/file.ice +++ b/netfs/ice/file.ice @@ -1,5 +1,4 @@ -#ifndef _FILES -#define _FILES +#pragma once #include "exceptions.ice" #include "types.ice" @@ -15,6 +14,3 @@ module NetFS { idempotent long copyrange(File * to, long offsetsrc, long offsetdest, long size, int flags) throws AuthError, SystemError; }; }; - -#endif - diff --git a/netfs/ice/mapper.ice b/netfs/ice/mapper.ice index 505b53a..ce2ecb2 100644 --- a/netfs/ice/mapper.ice +++ b/netfs/ice/mapper.ice @@ -1,5 +1,4 @@ -#ifndef _MAPPER -#define _MAPPER +#pragma once #include "exceptions.ice" @@ -27,6 +26,3 @@ module NetFS { }; } - -#endif - diff --git a/netfs/ice/numeric.h b/netfs/ice/numeric.h index 302df91..f66b98d 100644 --- a/netfs/ice/numeric.h +++ b/netfs/ice/numeric.h @@ -1,5 +1,4 @@ -#ifndef NUMERIC_H -#define NUMERIC_H +#pragma once #include #include @@ -87,5 +86,3 @@ operator+(const safe left, const Right right) { return static_cast(left) + right; } - -#endif diff --git a/netfs/ice/service.ice b/netfs/ice/service.ice index d691ae2..a3c3e3b 100644 --- a/netfs/ice/service.ice +++ b/netfs/ice/service.ice @@ -1,5 +1,4 @@ -#ifndef _SERVICE -#define _SERVICE +#pragma once #include "exceptions.ice" #include "types.ice" @@ -11,6 +10,3 @@ module NetFS { Volume * connect(string volume, string auth) throws AuthError, ConfigError; }; }; - -#endif - diff --git a/netfs/ice/typeConverter.h b/netfs/ice/typeConverter.h index 0baff2b..affda73 100644 --- a/netfs/ice/typeConverter.h +++ b/netfs/ice/typeConverter.h @@ -1,5 +1,4 @@ -#ifndef NETFS_TYPECONVERT_H -#define NETFS_TYPECONVERT_H +#pragma once #include #include @@ -25,5 +24,3 @@ public: NetFS::Mapping::MapperPtr mapper; }; - -#endif diff --git a/netfs/ice/types.ice b/netfs/ice/types.ice index de83f6f..9f0b6e2 100644 --- a/netfs/ice/types.ice +++ b/netfs/ice/types.ice @@ -1,5 +1,4 @@ -#ifndef _TYPES -#define _TYPES +#pragma once module NetFS { struct VFS { @@ -43,6 +42,3 @@ module NetFS { dictionary DirectoryContents; }; - -#endif - diff --git a/netfs/ice/volume.ice b/netfs/ice/volume.ice index b8fe9ea..a41953a 100644 --- a/netfs/ice/volume.ice +++ b/netfs/ice/volume.ice @@ -1,5 +1,4 @@ -#ifndef _VOLUME -#define _VOLUME +#pragma once #include "exceptions.ice" #include "types.ice" @@ -34,6 +33,3 @@ module NetFS { idempotent void utimens(ReqEnv env, string path, long atime, long atimens, long mtime, long mtimens) throws AuthError, SystemError; }; }; - -#endif - diff --git a/netfs/lib/baseMapper.h b/netfs/lib/baseMapper.h index 89adf5f..edcdae1 100644 --- a/netfs/lib/baseMapper.h +++ b/netfs/lib/baseMapper.h @@ -1,5 +1,4 @@ -#ifndef NETFS_MAPPING_BASEIMPL_H -#define NETFS_MAPPING_BASEIMPL_H +#pragma once #include "entries.h" #include "entryResolver.h" @@ -19,5 +18,3 @@ namespace NetFS { }; } } - -#endif diff --git a/netfs/lib/defaultMapper.h b/netfs/lib/defaultMapper.h index 9f063a8..d4fb77f 100644 --- a/netfs/lib/defaultMapper.h +++ b/netfs/lib/defaultMapper.h @@ -1,5 +1,4 @@ -#ifndef NETFS_MAPPING_DEFAULTIMPL_H -#define NETFS_MAPPING_DEFAULTIMPL_H +#pragma once #include "baseMapper.h" #include "entries.h" @@ -17,5 +16,3 @@ namespace NetFS { }; } } - -#endif diff --git a/netfs/lib/entCache.h b/netfs/lib/entCache.h index d11e64f..2d6d37d 100644 --- a/netfs/lib/entCache.h +++ b/netfs/lib/entCache.h @@ -1,5 +1,4 @@ -#ifndef ENTCACHE_H -#define ENTCACHE_H +#pragma once #include "entries.h" #include "entryResolver.h" @@ -50,5 +49,3 @@ private: void fillCache() const noexcept override; EntryResolverPtr users; }; - -#endif diff --git a/netfs/lib/entCache.impl.h b/netfs/lib/entCache.impl.h index 96bf4eb..64d5025 100644 --- a/netfs/lib/entCache.impl.h +++ b/netfs/lib/entCache.impl.h @@ -1,5 +1,4 @@ -#ifndef ENTCACHE_IMPL_H -#define ENTCACHE_IMPL_H +#pragma once #include "entCache.h" #include "entries.h" @@ -57,5 +56,3 @@ EntCache::getEntryNoFill(const key_t & key) const noexcept } return nullptr; } - -#endif diff --git a/netfs/lib/entries.h b/netfs/lib/entries.h index 6e032e1..7da8b99 100644 --- a/netfs/lib/entries.h +++ b/netfs/lib/entries.h @@ -1,5 +1,4 @@ -#ifndef ENTRIES_H -#define ENTRIES_H +#pragma once #include #include @@ -23,5 +22,3 @@ public: std::string name; std::set members; }; - -#endif diff --git a/netfs/lib/entryResolver.h b/netfs/lib/entryResolver.h index 86aaace..bb5baa3 100644 --- a/netfs/lib/entryResolver.h +++ b/netfs/lib/entryResolver.h @@ -1,5 +1,4 @@ -#ifndef NETFS_ENTRYRESOLVER_H -#define NETFS_ENTRYRESOLVER_H +#pragma once #include @@ -13,5 +12,3 @@ public: }; template using EntryResolverPtr = std::shared_ptr>; - -#endif diff --git a/netfs/unittests/mockDaemon.h b/netfs/unittests/mockDaemon.h index 8bc6097..de1e857 100644 --- a/netfs/unittests/mockDaemon.h +++ b/netfs/unittests/mockDaemon.h @@ -1,5 +1,4 @@ -#ifndef MOCKDAEMON_H -#define MOCKDAEMON_H +#pragma once #include #include @@ -35,5 +34,3 @@ private: Ice::StringSeq params; std::unique_ptr daemon; }; - -#endif diff --git a/netfs/unittests/mockFuse.h b/netfs/unittests/mockFuse.h index c0e7828..cb69816 100644 --- a/netfs/unittests/mockFuse.h +++ b/netfs/unittests/mockFuse.h @@ -1,5 +1,4 @@ -#ifndef MOCKFUSE_H -#define MOCKFUSE_H +#pragma once #include #include @@ -28,5 +27,3 @@ private: public: const fuse_operations * fuse; }; - -#endif diff --git a/netfs/unittests/mockGlacier.h b/netfs/unittests/mockGlacier.h index 007715d..61adcee 100644 --- a/netfs/unittests/mockGlacier.h +++ b/netfs/unittests/mockGlacier.h @@ -1,5 +1,4 @@ -#ifndef MOCKGLACIER_H -#define MOCKGLACIER_H +#pragma once #include #include @@ -15,5 +14,3 @@ private: const int lockdir; pid_t glacier; }; - -#endif diff --git a/netfs/unittests/mockMount.h b/netfs/unittests/mockMount.h index 38fb2ee..2eaad82 100644 --- a/netfs/unittests/mockMount.h +++ b/netfs/unittests/mockMount.h @@ -1,5 +1,4 @@ -#ifndef MOCKMOUNT_H -#define MOCKMOUNT_H +#pragma once #include "mockDaemon.h" #include @@ -32,5 +31,3 @@ public: struct fuse_args fargs; std::unique_ptr th; }; - -#endif -- cgit v1.2.3