]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
add some cppcheck-suppress noExplicitConstructor comments 6100/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 16:19:33 +0000 (17:19 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 22:48:59 +0000 (23:48 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
15 files changed:
src/common/DecayCounter.h
src/common/WorkQueue.h
src/common/buffer.cc
src/include/buffer.h
src/include/object.h
src/include/types.h
src/mon/MonCap.h
src/msg/msg_types.h
src/osd/OSD.h
src/osd/OSDCap.h
src/osd/PGLog.h
src/osd/osd_types.h
src/rgw/rgw_basic_types.h
src/rgw/rgw_common.h
src/test/objectstore_bench.cc

index 529e50a30b3ded6654917c1687835067e8d32a8f..5abbeb394b39d2019855816214b711c7c847b073 100644 (file)
@@ -35,6 +35,7 @@ class DecayRate {
 
 public:
   DecayRate() : k(0) {}
+  // cppcheck-suppress noExplicitConstructor
   DecayRate(double hl) { set_halflife(hl); }
   void set_halflife(double hl) {
     k = ::log(.5) / hl;
index 67c1a87b783b8d3cbeb170f82c7c88b7dd0d6229..097942af4ff908764637dc0c86cf09f5b4049902 100644 (file)
@@ -443,6 +443,7 @@ private:
   // threads
   struct WorkThread : public Thread {
     ThreadPool *pool;
+    // cppcheck-suppress noExplicitConstructor
     WorkThread(ThreadPool *p) : pool(p) {}
     void *entry() {
       pool->worker(this);
index bd97b01cd88f3eab8307e9dd9760b40592ff7b21..cbb9549c3e340683218d88c39f011e3bdb4ff9e0 100644 (file)
@@ -176,6 +176,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     virtual ~raw() {}
 
     // no copying.
+    // cppcheck-suppress noExplicitConstructor
     raw(const raw &other);
     const raw& operator=(const raw &other);
 
index 5a8b05f5125f9b9bbd673a8f832fdaece25efb0a..9bbe79d039aca43dcdbc2b5dca281ea9ce23576a 100644 (file)
@@ -168,7 +168,9 @@ namespace buffer CEPH_BUFFER_API {
 
   public:
     ptr() : _raw(0), _off(0), _len(0) {}
+    // cppcheck-suppress noExplicitConstructor
     ptr(raw *r);
+    // cppcheck-suppress noExplicitConstructor
     ptr(unsigned l);
     ptr(const char *d, unsigned l);
     ptr(const ptr& p);
@@ -354,6 +356,7 @@ namespace buffer CEPH_BUFFER_API {
   public:
     // cons/des
     list() : _len(0), _memcopy_count(0), last_p(this) {}
+    // cppcheck-suppress noExplicitConstructor
     list(unsigned prealloc) : _len(0), _memcopy_count(0), last_p(this) {
       append_buffer = buffer::create(prealloc);
       append_buffer.set_length(0);   // unused, so far.
@@ -543,6 +546,7 @@ namespace buffer CEPH_BUFFER_API {
 
   public:
     hash() : crc(0) { }
+    // cppcheck-suppress noExplicitConstructor
     hash(uint32_t init) : crc(init) { }
 
     void update(buffer::list& bl) {
index 0f511435b9b64a4b0b574400ea729574dda454f1..bdc15b52cbc2cb097e2395ae3d5faf93c5a9dc25 100644 (file)
@@ -33,7 +33,9 @@ struct object_t {
   string name;
 
   object_t() {}
+  // cppcheck-suppress noExplicitConstructor
   object_t(const char *s) : name(s) {}
+  // cppcheck-suppress noExplicitConstructor
   object_t(const string& s) : name(s) {}
 
   void swap(object_t& o) {
@@ -110,6 +112,7 @@ struct file_object_t {
 
 struct snapid_t {
   uint64_t val;
+  // cppcheck-suppress noExplicitConstructor
   snapid_t(uint64_t v=0) : val(v) {}
   snapid_t operator+=(snapid_t o) { val += o.val; return *this; }
   snapid_t operator++() { ++val; return *this; }
index aebdc5237f7bb525b155989bb91aab6ecfbf8e82..19982db6d2a1e7a4baf3520314e95647ee036cf3 100644 (file)
@@ -280,6 +280,7 @@ typedef __u32 epoch_t;       // map epoch  (32bits -> 13 epochs/second for 10 ye
 struct client_t {
   int64_t v;
 
+  // cppcheck-suppress noExplicitConstructor
   client_t(int64_t _v = -2) : v(_v) {}
   
   void encode(bufferlist& bl) const {
@@ -315,6 +316,7 @@ typedef uint64_t _inodeno_t;
 struct inodeno_t {
   _inodeno_t val;
   inodeno_t() : val(0) {}
+  // cppcheck-suppress noExplicitConstructor
   inodeno_t(_inodeno_t v) : val(v) {}
   inodeno_t operator+=(inodeno_t o) { val += o.val; return *this; }
   operator _inodeno_t() const { return val; }
@@ -366,6 +368,7 @@ void dump(const ceph_dir_layout& l, ceph::Formatter *f);
 
 struct prettybyte_t {
   uint64_t v;
+  // cppcheck-suppress noExplicitConstructor
   prettybyte_t(uint64_t _v) : v(_v) {}
 };
 
@@ -389,6 +392,7 @@ inline ostream& operator<<(ostream& out, const prettybyte_t& b)
 
 struct si_t {
   uint64_t v;
+  // cppcheck-suppress noExplicitConstructor
   si_t(uint64_t _v) : v(_v) {}
 };
 
@@ -412,6 +416,7 @@ inline ostream& operator<<(ostream& out, const si_t& b)
 
 struct pretty_si_t {
   uint64_t v;
+  // cppcheck-suppress noExplicitConstructor
   pretty_si_t(uint64_t _v) : v(_v) {}
 };
 
@@ -435,6 +440,7 @@ inline ostream& operator<<(ostream& out, const pretty_si_t& b)
 
 struct kb_t {
   uint64_t v;
+  // cppcheck-suppress noExplicitConstructor
   kb_t(uint64_t _v) : v(_v) {}
 };
 
@@ -483,6 +489,7 @@ inline ostream& operator<<(ostream &oss, health_status_t status) {
 
 struct weightf_t {
   float v;
+  // cppcheck-suppress noExplicitConstructor
   weightf_t(float _v) : v(_v) {}
 };
 
@@ -530,6 +537,7 @@ struct errorcode32_t {
   int32_t code;
 
   errorcode32_t() {}
+  // cppcheck-suppress noExplicitConstructor
   errorcode32_t(int32_t i) : code(i) {}
 
   operator int() const { return code; }
index 400a4bbbe3ecd623d0fef32d93b3f6e9350eb42b..2501f442af6c3aa3009edef27d5afe53fca109f2 100644 (file)
@@ -21,6 +21,7 @@ static const __u8 MON_CAP_ANY   = 0xff;          // *
 struct mon_rwxa_t {
   __u8 val;
 
+  // cppcheck-suppress noExplicitConstructor
   mon_rwxa_t(__u8 v = 0) : val(v) {}
   mon_rwxa_t& operator=(__u8 v) {
     val = v;
@@ -79,8 +80,10 @@ struct MonCapGrant {
   void expand_profile(EntityName name) const;
 
   MonCapGrant() : allow(0) {}
+  // cppcheck-suppress noExplicitConstructor
   MonCapGrant(mon_rwxa_t a) : allow(a) {}
   MonCapGrant(string s, mon_rwxa_t a) : service(s), allow(a) {}
+  // cppcheck-suppress noExplicitConstructor  
   MonCapGrant(string c) : command(c) {}
   MonCapGrant(string c, string a, StringConstraint co) : command(c) {
     command_args[a] = co;
index 55a865b7454ba473b18adde76b953f679454881d..3acad775ff7337db5449d7f00f11c03cce494bfa 100644 (file)
@@ -424,6 +424,7 @@ struct entity_inst_t {
   entity_addr_t addr;
   entity_inst_t() {}
   entity_inst_t(entity_name_t n, const entity_addr_t& a) : name(n), addr(a) {}
+  // cppcheck-suppress noExplicitConstructor
   entity_inst_t(const ceph_entity_inst& i) : name(i.name), addr(i.addr) { }
   entity_inst_t(const ceph_entity_name& n, const ceph_entity_addr &a) : name(n), addr(a) {}
   operator ceph_entity_inst() {
index 9e149032a4ad7296c416f1e4124af07989e38a4b..7561d133f71f261ae52afab6748987c75545b9a4 100644 (file)
@@ -364,6 +364,7 @@ class PGQueueable {
     void operator()(PGScrub &op);
   };
 public:
+  // cppcheck-suppress noExplicitConstructor
   PGQueueable(OpRequestRef op)
     : qvariant(op), cost(op->get_req()->get_cost()),
       priority(op->get_req()->get_priority()),
index 55f362692fc09fa519a5a50820c8cf8ac24eb670..55d7e9cc65b3a9218389673ba93cf53938656954 100644 (file)
@@ -42,6 +42,7 @@ static const __u8 OSD_CAP_ANY   = 0xff;          // *
 struct osd_rwxa_t {
   __u8 val;
 
+  // cppcheck-suppress noExplicitConstructor
   osd_rwxa_t(__u8 v = 0) : val(v) {}
   osd_rwxa_t& operator=(__u8 v) {
     val = v;
index 87e7ab26bbc053884496c648eafbac58bf13fc08..3a9b6979125a226229eaa9fb4a01de3f03cbb3f2 100644 (file)
@@ -478,6 +478,7 @@ protected:
     check();
   }
 public:
+  // cppcheck-suppress noExplicitConstructor
   PGLog(CephContext *cct = 0) :
     dirty_from(eversion_t::max()),
     writeout_from(eversion_t::max()), 
index 5b1330608c1b9e01a8218b83f41e240b65b0f93f..84770d3e92afb199adeb95936d573c6aa87bd4a1 100644 (file)
@@ -303,9 +303,11 @@ struct pg_t {
   pg_t() : m_pool(0), m_seed(0), m_preferred(-1) {}
   pg_t(ps_t seed, uint64_t pool, int pref=-1) :
     m_pool(pool), m_seed(seed), m_preferred(pref) {}
+  // cppcheck-suppress noExplicitConstructor
   pg_t(const ceph_pg& cpg) :
     m_pool(cpg.pool), m_seed(cpg.ps), m_preferred((__s16)cpg.preferred) {}
 
+  // cppcheck-suppress noExplicitConstructor
   pg_t(const old_pg_t& opg) {
     *this = opg.v;
   }
@@ -712,6 +714,7 @@ public:
   eversion_t() : version(0), epoch(0), __pad(0) {}
   eversion_t(epoch_t e, version_t v) : version(v), epoch(e), __pad(0) {}
 
+  // cppcheck-suppress noExplicitConstructor
   eversion_t(const ceph_eversion& ce) : 
     version(ce.version),
     epoch(ce.epoch),
@@ -2100,6 +2103,7 @@ struct pg_info_t {
       last_backfill(hobject_t::get_max()),
       last_backfill_bitwise(false)
   { }
+  // cppcheck-suppress noExplicitConstructor
   pg_info_t(spg_t p)
     : pgid(p),
       last_epoch_started(0), last_user_version(0),
index 4a9c42cbe103ececa7b7f6dc16c00f06d3b0ab62..8538af643705f4932cfdafa22705d29f364e9ef8 100644 (file)
@@ -10,6 +10,7 @@ struct rgw_user {
   std::string id;
 
   rgw_user() {}
+  // cppcheck-suppress noExplicitConstructor
   rgw_user(const std::string& s) {
     from_str(s);
   }
index 302767eb14c53806b85cf7bcbb73fc16bdacbb54..85405de51fcb4e2c6864b14c69c5251db68d8f70 100644 (file)
@@ -622,10 +622,12 @@ struct rgw_bucket {
                     */
 
   rgw_bucket() { }
+  // cppcheck-suppress noExplicitConstructor
   rgw_bucket(const cls_user_bucket& b) : name(b.name), data_pool(b.data_pool),
                                         data_extra_pool(b.data_extra_pool),
                                         index_pool(b.index_pool), marker(b.marker),
                                         bucket_id(b.bucket_id) {}
+  // cppcheck-suppress noExplicitConstructor
   rgw_bucket(const char *n) : name(n) {
     assert(*n == '.'); // only rgw private buckets should be initialized without pool
     data_pool = index_pool = n;
@@ -986,6 +988,7 @@ struct rgw_obj_key {
   string instance;
 
   rgw_obj_key() {}
+  // cppcheck-suppress noExplicitConstructor
   rgw_obj_key(const string& n) {
     set(n);
   }
@@ -993,6 +996,7 @@ struct rgw_obj_key {
     set(n, i);
   }
 
+  // cppcheck-suppress noExplicitConstructor
   rgw_obj_key(const cls_rgw_obj_key& k) {
     set(k);
   }
index 9754cecf999f26a56ef7c2d74092db617ab0d48d..d8cd16675b9edd6347457eec7dc344da28892c12 100644 (file)
@@ -36,6 +36,7 @@ static void usage()
 // helper class for bytes with units
 struct byte_units {
   size_t v;
+  // cppcheck-suppress noExplicitConstructor
   byte_units(size_t v) : v(v) {}
 
   bool parse(const std::string &val, std::string *err);