]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
c++11: remove hash_namespace.h and default to std
authorCasey Bodley <cbodley@redhat.com>
Fri, 31 Jul 2015 15:50:57 +0000 (11:50 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 7 Aug 2015 15:42:58 +0000 (11:42 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/hobject.h
src/common/lockdep.cc
src/include/Makefile.am
src/include/hash_namespace.h [deleted file]
src/include/object.h
src/include/types.h
src/mds/mdstypes.h
src/msg/msg_types.h
src/osd/osd_types.h

index 4f07cca3bca57fdd0585030da1e814b3fb2dbef4..1b7c3db2831b43abc0ac189922a56cc744ef91dc 100644 (file)
@@ -153,7 +153,7 @@ public:
   /* Do not use when a particular hash function is needed */
   explicit hobject_t(const sobject_t &o) :
     oid(o.oid), snap(o.snap), max(false), pool(POOL_META) {
-    set_hash(CEPH_HASH_NAMESPACE::hash<sobject_t>()(o));
+    set_hash(std::hash<sobject_t>()(o));
   }
 
   // maximum sorted value.
@@ -235,7 +235,7 @@ public:
 };
 WRITE_CLASS_ENCODER(hobject_t)
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<hobject_t> {
     size_t operator()(const hobject_t &r) const {
       static hash<object_t> H;
@@ -243,7 +243,7 @@ CEPH_HASH_NAMESPACE_START
       return H(r.oid) ^ I(r.snap);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 ostream& operator<<(ostream& out, const hobject_t& o);
 
@@ -364,7 +364,7 @@ public:
 };
 WRITE_CLASS_ENCODER(ghobject_t)
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<ghobject_t> {
     size_t operator()(const ghobject_t &r) const {
       static hash<object_t> H;
@@ -372,7 +372,7 @@ CEPH_HASH_NAMESPACE_START
       return H(r.hobj.oid) ^ I(r.hobj.snap);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 ostream& operator<<(ostream& out, const ghobject_t& o);
 
index 5f9fa191a07d0a3df955b18575e0d299ac0809f3..79fd56c61ba70058a4a745284fce29333dfaa854 100644 (file)
 #include "lockdep.h"
 
 #include "include/unordered_map.h"
-#include "include/hash_namespace.h"
 
 #if defined(__FreeBSD__) && defined(__LP64__)  // On FreeBSD pthread_t is a pointer.
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<>
     struct hash<pthread_t>
     {
@@ -30,7 +29,7 @@ CEPH_HASH_NAMESPACE_START
       operator()(pthread_t __x) const
       { return (uintptr_t)__x; }
     };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 #endif
 
 /******* Constants **********/
index c07aa9f5800be1c71722ad6fc14d5f9c716264cf..b3ceb24bf1a58b62b4b9c5fe7f92407b018e8cef 100644 (file)
@@ -111,6 +111,5 @@ noinst_HEADERS += \
        include/on_exit.h \
        include/memory.h \
        include/rados/memory.h \
-       include/hash_namespace.h \
        include/unordered_set.h \
        include/unordered_map.h
diff --git a/src/include/hash_namespace.h b/src/include/hash_namespace.h
deleted file mode 100644 (file)
index 5a3dbe8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef CEPH_HASH_NAMESPACE_H
-#define CEPH_HASH_NAMESPACE_H
-
-#include <ciso646>
-
-#include <functional>
-
-#define CEPH_HASH_NAMESPACE_START namespace std {
-#define CEPH_HASH_NAMESPACE_END }
-#define CEPH_HASH_NAMESPACE std
-
-#endif
index 57f099a57b6d525481dbf644c3ee1ca0bdf2fc44..0f511435b9b64a4b0b574400ea729574dda454f1 100644 (file)
@@ -23,7 +23,6 @@
 using namespace std;
 
 #include "include/unordered_map.h"
-#include "include/hash_namespace.h"
 
 #include "hash.h"
 #include "encoding.h"
@@ -75,7 +74,7 @@ inline ostream& operator<<(ostream& out, const object_t& o) {
   return out << o.name;
 }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<object_t> {
     size_t operator()(const object_t& r) const { 
       //static hash<string> H;
@@ -83,7 +82,7 @@ CEPH_HASH_NAMESPACE_START
       return ceph_str_hash_linux(r.name.c_str(), r.name.length());
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 struct file_object_t {
@@ -176,7 +175,7 @@ inline bool operator<=(const sobject_t &l, const sobject_t &r) {
 inline ostream& operator<<(ostream& out, const sobject_t &o) {
   return out << o.oid << "/" << o.snap;
 }
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<sobject_t> {
     size_t operator()(const sobject_t &r) const {
       static hash<object_t> H;
@@ -184,6 +183,6 @@ CEPH_HASH_NAMESPACE_START
       return H(r.oid) ^ I(r.snap);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 #endif
index ddb0e9aed729fa3d3d4b2136180d65f669ef3621..5cbcfc00c854fef7a48a7110d13c0a1e05b2efc5 100644 (file)
@@ -62,7 +62,6 @@ extern "C" {
 using namespace std;
 
 #include "include/unordered_map.h"
-#include "include/hash_namespace.h"
 
 #include "object.h"
 #include "intarith.h"
@@ -303,7 +302,7 @@ inline ostream& operator<<(ostream& out, inodeno_t ino) {
   return out << hex << ino.val << dec;
 }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash< inodeno_t >
   {
     size_t operator()( const inodeno_t& x ) const
@@ -312,7 +311,7 @@ CEPH_HASH_NAMESPACE_START
       return H(x.val);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 // file modes
index e0a421fdd85fe2a69afca342669a65982963aabd..9ed51e2499389c055f4a5b5c802d4322d4d1b26a 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <boost/pool/pool.hpp>
 #include "include/assert.h"
-#include "include/hash_namespace.h"
 #include <boost/serialization/strong_typedef.hpp>
 
 
@@ -301,7 +300,7 @@ inline bool operator==(const quota_info_t &l, const quota_info_t &r) {
 
 ostream& operator<<(ostream &out, const quota_info_t &n);
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<vinodeno_t> {
     size_t operator()(const vinodeno_t &vino) const { 
       hash<inodeno_t> H;
@@ -309,7 +308,7 @@ CEPH_HASH_NAMESPACE_START
       return H(vino.ino) ^ I(vino.snapid);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 
@@ -811,14 +810,14 @@ inline bool operator<=(const metareqid_t& l, const metareqid_t& r) {
 inline bool operator>(const metareqid_t& l, const metareqid_t& r) { return !(l <= r); }
 inline bool operator>=(const metareqid_t& l, const metareqid_t& r) { return !(l < r); }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<metareqid_t> {
     size_t operator()(const metareqid_t &r) const { 
       hash<uint64_t> H;
       return H(r.name.num()) ^ H(r.name.type()) ^ H(r.tid);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 // cap info for client reconnect
@@ -936,7 +935,7 @@ inline bool operator==(dirfrag_t l, dirfrag_t r) {
   return l.ino == r.ino && l.frag == r.frag;
 }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<dirfrag_t> {
     size_t operator()(const dirfrag_t &df) const { 
       static rjhash<uint64_t> H;
@@ -944,7 +943,7 @@ CEPH_HASH_NAMESPACE_START
       return H(df.ino) ^ I(df.frag);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 
index 4f4629b2d67d94f684bba5d5c9a29de10e679e09..62deacffffa58a6eddc8ff40a098b035de703d32 100644 (file)
@@ -20,7 +20,6 @@
 #include "include/types.h"
 #include "include/blobhash.h"
 #include "include/encoding.h"
-#include "include/hash_namespace.h"
 
 namespace ceph {
   class Formatter;
@@ -133,7 +132,7 @@ inline std::ostream& operator<<(std::ostream& out, const ceph_entity_name& addr)
   return out << *(const entity_name_t*)&addr;
 }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash< entity_name_t >
   {
     size_t operator()( const entity_name_t &m ) const
@@ -141,7 +140,7 @@ CEPH_HASH_NAMESPACE_START
       return rjhash32(m.type() ^ m.num());
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 
@@ -353,7 +352,7 @@ inline bool operator<=(const entity_addr_t& a, const entity_addr_t& b) { return
 inline bool operator>(const entity_addr_t& a, const entity_addr_t& b) { return memcmp(&a, &b, sizeof(a)) > 0; }
 inline bool operator>=(const entity_addr_t& a, const entity_addr_t& b) { return memcmp(&a, &b, sizeof(a)) >= 0; }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash< entity_addr_t >
   {
     size_t operator()( const entity_addr_t& x ) const
@@ -362,7 +361,7 @@ CEPH_HASH_NAMESPACE_START
       return H((const char*)&x, sizeof(x));
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 /*
@@ -407,7 +406,7 @@ inline bool operator<=(const entity_inst_t& a, const entity_inst_t& b) {
 inline bool operator>(const entity_inst_t& a, const entity_inst_t& b) { return b < a; }
 inline bool operator>=(const entity_inst_t& a, const entity_inst_t& b) { return b <= a; }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash< entity_inst_t >
   {
     size_t operator()( const entity_inst_t& x ) const
@@ -417,7 +416,7 @@ CEPH_HASH_NAMESPACE_START
       return H(x.name) ^ I(x.addr);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 inline ostream& operator<<(ostream& out, const entity_inst_t &i)
index 0c45f413ebc052b5b57bcdf0681009bb4743dce6..a87d9ed97e9bf298c817baf751b2c1baeb397770 100644 (file)
@@ -134,14 +134,14 @@ inline bool operator<=(const osd_reqid_t& l, const osd_reqid_t& r) {
 inline bool operator>(const osd_reqid_t& l, const osd_reqid_t& r) { return !(l <= r); }
 inline bool operator>=(const osd_reqid_t& l, const osd_reqid_t& r) { return !(l < r); }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<osd_reqid_t> {
     size_t operator()(const osd_reqid_t &r) const { 
       static hash<uint64_t> H;
       return H(r.name.num() ^ r.tid ^ r.inc);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 
 // -----
@@ -399,7 +399,7 @@ inline bool operator>=(const pg_t& l, const pg_t& r) {
 
 ostream& operator<<(ostream& out, const pg_t &pg);
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash< pg_t >
   {
     size_t operator()( const pg_t& x ) const
@@ -408,7 +408,7 @@ CEPH_HASH_NAMESPACE_START
       return H((x.pool() & 0xffffffff) ^ (x.pool() >> 32) ^ x.ps() ^ x.preferred());
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 struct spg_t {
   pg_t pgid;
@@ -480,7 +480,7 @@ WRITE_CLASS_ENCODER(spg_t)
 WRITE_EQ_OPERATORS_2(spg_t, pgid, shard)
 WRITE_CMP_OPERATORS_2(spg_t, pgid, shard)
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash< spg_t >
   {
     size_t operator()( const spg_t& x ) const
@@ -489,7 +489,7 @@ CEPH_HASH_NAMESPACE_START
       return H(hash<pg_t>()(x.pgid) ^ x.shard);
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 ostream& operator<<(ostream& out, const spg_t &pg);
 
@@ -623,7 +623,7 @@ inline ostream& operator<<(ostream& out, const coll_t& c) {
   return out;
 }
 
-CEPH_HASH_NAMESPACE_START
+namespace std {
   template<> struct hash<coll_t> {
     size_t operator()(const coll_t &c) const { 
       size_t h = 0;
@@ -640,7 +640,7 @@ CEPH_HASH_NAMESPACE_START
       return h;
     }
   };
-CEPH_HASH_NAMESPACE_END
+} // namespace std
 
 inline ostream& operator<<(ostream& out, const ceph_object_layout &ol)
 {