From edddca27fa030b8151c6fdcca4872095e4460952 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Tue, 30 Apr 2019 14:24:56 -0400 Subject: [PATCH] rgw: add editor directive comments to rgw services source files So that both vi and emacs help to correctly format the source files, add the directives to each of the source files. In addition, use `#pragma once` in the header files instead of the macro work-around. Signed-off-by: J. Eric Ivancich --- src/rgw/services/svc_finisher.cc | 3 +++ src/rgw/services/svc_finisher.h | 7 +++---- src/rgw/services/svc_notify.cc | 3 +++ src/rgw/services/svc_notify.h | 8 +++----- src/rgw/services/svc_quota.cc | 3 +++ src/rgw/services/svc_quota.h | 7 +++---- src/rgw/services/svc_rados.cc | 3 +++ src/rgw/services/svc_rados.h | 7 +++---- src/rgw/services/svc_sync_modules.cc | 3 +++ src/rgw/services/svc_sync_modules.h | 8 +++----- src/rgw/services/svc_sys_obj.cc | 3 +++ src/rgw/services/svc_sys_obj.h | 8 +++----- src/rgw/services/svc_sys_obj_cache.cc | 3 +++ src/rgw/services/svc_sys_obj_cache.h | 8 +++----- src/rgw/services/svc_sys_obj_core.cc | 3 +++ src/rgw/services/svc_sys_obj_core.h | 7 +++---- src/rgw/services/svc_zone.cc | 3 +++ src/rgw/services/svc_zone.h | 7 +++---- src/rgw/services/svc_zone_utils.cc | 3 +++ src/rgw/services/svc_zone_utils.h | 7 +++---- 20 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/rgw/services/svc_finisher.cc b/src/rgw/services/svc_finisher.cc index d239ff3c4fa..9e8bee0bf7a 100644 --- a/src/rgw/services/svc_finisher.cc +++ b/src/rgw/services/svc_finisher.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "common/Finisher.h" #include "svc_finisher.h" diff --git a/src/rgw/services/svc_finisher.h b/src/rgw/services/svc_finisher.h index 116fd8fded0..c6c25f5a349 100644 --- a/src/rgw/services/svc_finisher.h +++ b/src/rgw/services/svc_finisher.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_FINISHER_H -#define CEPH_RGW_SERVICES_FINISHER_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -41,5 +42,3 @@ public: void schedule_context(Context *c); }; - -#endif diff --git a/src/rgw/services/svc_notify.cc b/src/rgw/services/svc_notify.cc index f48b497b7fb..bf61d137839 100644 --- a/src/rgw/services/svc_notify.cc +++ b/src/rgw/services/svc_notify.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "include/random.h" #include "common/errno.h" diff --git a/src/rgw/services/svc_notify.h b/src/rgw/services/svc_notify.h index 306a5f337a4..85780d36617 100644 --- a/src/rgw/services/svc_notify.h +++ b/src/rgw/services/svc_notify.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_NOTIFY_H -#define CEPH_RGW_SERVICES_NOTIFY_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -96,6 +97,3 @@ public: void register_watch_cb(CB *cb); }; - -#endif - diff --git a/src/rgw/services/svc_quota.cc b/src/rgw/services/svc_quota.cc index f2baac36b45..38f68ccae36 100644 --- a/src/rgw/services/svc_quota.cc +++ b/src/rgw/services/svc_quota.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_quota.h" #include "svc_zone.h" diff --git a/src/rgw/services/svc_quota.h b/src/rgw/services/svc_quota.h index 7dfbf19b612..01030e72384 100644 --- a/src/rgw/services/svc_quota.h +++ b/src/rgw/services/svc_quota.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_QUOTA_H -#define CEPH_RGW_SERVICES_QUOTA_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -19,5 +20,3 @@ public: const RGWQuotaInfo& get_bucket_quota() const; const RGWQuotaInfo& get_user_quota() const; }; - -#endif diff --git a/src/rgw/services/svc_rados.cc b/src/rgw/services/svc_rados.cc index 713068f4a93..6ec7376ff83 100644 --- a/src/rgw/services/svc_rados.cc +++ b/src/rgw/services/svc_rados.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_rados.h" #include "include/rados/librados.hpp" diff --git a/src/rgw/services/svc_rados.h b/src/rgw/services/svc_rados.h index 89817f317b0..ae9c2dcf91b 100644 --- a/src/rgw/services/svc_rados.h +++ b/src/rgw/services/svc_rados.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_RADOS_H -#define CEPH_RGW_SERVICES_RADOS_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -173,5 +174,3 @@ public: friend Pool; friend Pool::List; }; - -#endif diff --git a/src/rgw/services/svc_sync_modules.cc b/src/rgw/services/svc_sync_modules.cc index ca6a7a30350..252bfa1b282 100644 --- a/src/rgw/services/svc_sync_modules.cc +++ b/src/rgw/services/svc_sync_modules.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_sync_modules.h" #include "rgw/rgw_sync_module.h" diff --git a/src/rgw/services/svc_sync_modules.h b/src/rgw/services/svc_sync_modules.h index 19c4ec57f7a..6b5b224eaf7 100644 --- a/src/rgw/services/svc_sync_modules.h +++ b/src/rgw/services/svc_sync_modules.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_SYNC_MODULES_H -#define CEPH_RGW_SERVICES_SYNC_MODULES_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -21,6 +22,3 @@ public: void init(); }; - -#endif - diff --git a/src/rgw/services/svc_sys_obj.cc b/src/rgw/services/svc_sys_obj.cc index 8fd8530cc4b..998dd2181e5 100644 --- a/src/rgw/services/svc_sys_obj.cc +++ b/src/rgw/services/svc_sys_obj.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_sys_obj.h" #include "svc_sys_obj_core.h" #include "svc_rados.h" diff --git a/src/rgw/services/svc_sys_obj.h b/src/rgw/services/svc_sys_obj.h index cce06131cdb..462b94db1c6 100644 --- a/src/rgw/services/svc_sys_obj.h +++ b/src/rgw/services/svc_sys_obj.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_SYS_OBJ_H -#define CEPH_RGW_SERVICES_SYS_OBJ_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -269,6 +270,3 @@ public: return sysobj_svc->get_obj(*this, obj); } }; - -#endif - diff --git a/src/rgw/services/svc_sys_obj_cache.cc b/src/rgw/services/svc_sys_obj_cache.cc index e2d41bfbedc..faa38af8d8c 100644 --- a/src/rgw/services/svc_sys_obj_cache.cc +++ b/src/rgw/services/svc_sys_obj_cache.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_sys_obj_cache.h" #include "svc_zone.h" #include "svc_notify.h" diff --git a/src/rgw/services/svc_sys_obj_cache.h b/src/rgw/services/svc_sys_obj_cache.h index b8ff7039c9e..69c6e10436c 100644 --- a/src/rgw/services/svc_sys_obj_cache.h +++ b/src/rgw/services/svc_sys_obj_cache.h @@ -1,7 +1,7 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab -#ifndef CEPH_RGW_SERVICES_SYS_OBJ_CACHE_H -#define CEPH_RGW_SERVICES_SYS_OBJ_CACHE_H - +#pragma once #include "rgw/rgw_service.h" #include "rgw/rgw_cache.h" @@ -181,5 +181,3 @@ public: entries.clear(); } }; /* RGWChainedCacheImpl */ - -#endif diff --git a/src/rgw/services/svc_sys_obj_core.cc b/src/rgw/services/svc_sys_obj_core.cc index 6f715e9a655..18c2e0aaee8 100644 --- a/src/rgw/services/svc_sys_obj_core.cc +++ b/src/rgw/services/svc_sys_obj_core.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_sys_obj_core.h" #include "svc_rados.h" #include "svc_zone.h" diff --git a/src/rgw/services/svc_sys_obj_core.h b/src/rgw/services/svc_sys_obj_core.h index 38de7cfc883..fa4c7e01d1f 100644 --- a/src/rgw/services/svc_sys_obj_core.h +++ b/src/rgw/services/svc_sys_obj_core.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_SYS_OBJ_CORE_H -#define CEPH_RGW_SERVICES_SYS_OBJ_CORE_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -217,5 +218,3 @@ public: return zone_svc; } }; - -#endif diff --git a/src/rgw/services/svc_zone.cc b/src/rgw/services/svc_zone.cc index d3c3b371040..ca8335c61dd 100644 --- a/src/rgw/services/svc_zone.cc +++ b/src/rgw/services/svc_zone.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_zone.h" #include "svc_rados.h" #include "svc_sys_obj.h" diff --git a/src/rgw/services/svc_zone.h b/src/rgw/services/svc_zone.h index 8c8dbebad43..1672d6d9448 100644 --- a/src/rgw/services/svc_zone.h +++ b/src/rgw/services/svc_zone.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_ZONE_H -#define CEPH_RGW_SERVICES_ZONE_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -130,5 +131,3 @@ public: int list_periods(list& periods); int list_periods(const string& current_period, list& periods); }; - -#endif diff --git a/src/rgw/services/svc_zone_utils.cc b/src/rgw/services/svc_zone_utils.cc index ef9c9c88c33..dacc98cf10b 100644 --- a/src/rgw/services/svc_zone_utils.cc +++ b/src/rgw/services/svc_zone_utils.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include "svc_zone_utils.h" #include "svc_rados.h" #include "svc_zone.h" diff --git a/src/rgw/services/svc_zone_utils.h b/src/rgw/services/svc_zone_utils.h index 158d2a92685..e2a2a4c3255 100644 --- a/src/rgw/services/svc_zone_utils.h +++ b/src/rgw/services/svc_zone_utils.h @@ -1,6 +1,7 @@ -#ifndef CEPH_RGW_SERVICES_ZONEUTILS_H -#define CEPH_RGW_SERVICES_ZONEUTILS_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once #include "rgw/rgw_service.h" @@ -35,5 +36,3 @@ public: string unique_trans_id(const uint64_t unique_num); }; - -#endif -- 2.47.3