From fc89c276386382f00f6e82697d4fdedd1b65698a Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 28 Aug 2014 13:40:34 +0100 Subject: [PATCH] messages: remove `using namespace std` in headers Avoid polluting global namespace: .cc files should do the `using` if they want it. Signed-off-by: John Spray --- src/messages/MClientReply.h | 3 --- src/messages/MDiscover.h | 4 +--- src/messages/MDiscoverReply.h | 12 +++++------- src/messages/MExportDirNotify.h | 2 -- src/messages/MExportDirNotifyAck.h | 2 -- src/messages/MMDSFragmentNotify.h | 2 -- 6 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/messages/MClientReply.h b/src/messages/MClientReply.h index 6507fa65321db..b381133f0d5bf 100644 --- a/src/messages/MClientReply.h +++ b/src/messages/MClientReply.h @@ -23,9 +23,6 @@ #include "include/ceph_features.h" #include "common/errno.h" -#include -using namespace std; - /*** * * MClientReply - container message for MDS reply to a client's MClientRequest diff --git a/src/messages/MDiscover.h b/src/messages/MDiscover.h index c37565dbef530..aab6ccb351e05 100644 --- a/src/messages/MDiscover.h +++ b/src/messages/MDiscover.h @@ -19,9 +19,7 @@ #include "msg/Message.h" #include "include/filepath.h" -#include #include -using namespace std; class MDiscover : public Message { @@ -40,7 +38,7 @@ class MDiscover : public Message { snapid_t get_snapid() { return snapid; } filepath& get_want() { return want; } - const string& get_dentry(int n) { return want[n]; } + const std::string& get_dentry(int n) { return want[n]; } bool wants_base_dir() { return want_base_dir; } bool wants_xlocked() { return want_xlocked; } diff --git a/src/messages/MDiscoverReply.h b/src/messages/MDiscoverReply.h index a28321ac4c5be..4c2527802b974 100644 --- a/src/messages/MDiscoverReply.h +++ b/src/messages/MDiscoverReply.h @@ -19,9 +19,7 @@ #include "msg/Message.h" #include "include/filepath.h" -#include #include -using namespace std; @@ -37,7 +35,7 @@ using namespace std; * they are false if there is no returned data, ie the first group is empty. * * we also return errors: - * error_flag_dn(string) - the specified dentry dne + * error_flag_dn(std::string) - the specified dentry dne * error_flag_dir - the last item wasn't a dir, so we couldn't continue. * * and sometimes, @@ -79,7 +77,7 @@ class MDiscoverReply : public Message { // and the response bool flag_error_dn; bool flag_error_dir; - string error_dentry; // dentry that was not found (to trigger waiters on asker) + std::string error_dentry; // dentry that was not found (to trigger waiters on asker) bool unsolicited; __s32 dir_auth_hint; @@ -99,7 +97,7 @@ class MDiscoverReply : public Message { bool is_flag_error_dn() { return flag_error_dn; } bool is_flag_error_dir() { return flag_error_dir; } - string& get_error_dentry() { return error_dentry; } + std::string& get_error_dentry() { return error_dentry; } int get_starts_with() { return starts_with; } @@ -160,7 +158,7 @@ public: } // void set_flag_forward() { flag_forward = true; } - void set_flag_error_dn(const string& dn) { + void set_flag_error_dn(const std::string& dn) { flag_error_dn = true; error_dentry = dn; } @@ -170,7 +168,7 @@ public: void set_dir_auth_hint(int a) { dir_auth_hint = a; } - void set_error_dentry(const string& dn) { + void set_error_dentry(const std::string& dn) { error_dentry = dn; } diff --git a/src/messages/MExportDirNotify.h b/src/messages/MExportDirNotify.h index 745cf95f709db..bd5c2330d11a3 100644 --- a/src/messages/MExportDirNotify.h +++ b/src/messages/MExportDirNotify.h @@ -16,8 +16,6 @@ #define CEPH_MEXPORTDIRNOTIFY_H #include "msg/Message.h" -#include -using namespace std; class MExportDirNotify : public Message { dirfrag_t base; diff --git a/src/messages/MExportDirNotifyAck.h b/src/messages/MExportDirNotifyAck.h index 7b52c4f607c9f..aa246597b0422 100644 --- a/src/messages/MExportDirNotifyAck.h +++ b/src/messages/MExportDirNotifyAck.h @@ -16,8 +16,6 @@ #define CEPH_MEXPORTDIRNOTIFYACK_H #include "msg/Message.h" -#include -using namespace std; class MExportDirNotifyAck : public Message { dirfrag_t dirfrag; diff --git a/src/messages/MMDSFragmentNotify.h b/src/messages/MMDSFragmentNotify.h index 46b883786c7be..d95751e348117 100644 --- a/src/messages/MMDSFragmentNotify.h +++ b/src/messages/MMDSFragmentNotify.h @@ -16,8 +16,6 @@ #define CEPH_MMDSFRAGMENTNOTIFY_H #include "msg/Message.h" -#include -using namespace std; class MMDSFragmentNotify : public Message { inodeno_t ino; -- 2.39.5