From: Martin Ettl Date: Mon, 22 Mar 2010 20:50:30 +0000 (-0700) Subject: mds: style fixes (from cppcheck) X-Git-Tag: v0.20~225 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=032fd323923d54b3d1c8aa0ca06b8f88494e7009;p=ceph.git mds: style fixes (from cppcheck) --- diff --git a/src/mds/Capability.h b/src/mds/Capability.h index b86413668d2e..80928458a91a 100644 --- a/src/mds/Capability.h +++ b/src/mds/Capability.h @@ -183,7 +183,7 @@ public: } void _calc_issued() { _issued = _pending; - for (list::iterator p = _revokes.begin(); p != _revokes.end(); p++) + for (list::iterator p = _revokes.begin(); p != _revokes.end(); ++p) _issued |= p->before; } void confirm_receipt(ceph_seq_t seq, unsigned caps) { diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 533ec4f65d17..2def08595569 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -220,7 +220,7 @@ public: unsigned n = 0; for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); p != mds_info.end(); - p++) + ++p) if (p->second.state == state) ++n; return n; } @@ -234,7 +234,7 @@ public: void get_up_mds_set(set& s) { for (map::const_iterator p = up.begin(); p != up.end(); - p++) + ++p) s.insert(p->first); } void get_active_mds_set(set& s) { @@ -244,7 +244,7 @@ public: s = failed; } int get_failed() { - if (failed.size()) return *failed.begin(); + if (!failed.empty()) return *failed.begin(); return -1; } void get_stopped_mds_set(set& s) { @@ -254,14 +254,14 @@ public: s = failed; for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); p != mds_info.end(); - p++) + ++p) if (p->second.state >= STATE_REPLAY && p->second.state <= STATE_STOPPING) s.insert(p->second.rank); } void get_mds_set(set& s, int state) { for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); p != mds_info.end(); - p++) + ++p) if (p->second.state == state) s.insert(p->second.rank); } @@ -278,7 +278,7 @@ public: __u64 find_standby_for(int mds, string& name) { for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); p != mds_info.end(); - p++) { + ++p) { if (p->second.rank == -1 && (p->second.standby_for_rank == mds || p->second.standby_for_name == name) && @@ -289,7 +289,7 @@ public: } for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); p != mds_info.end(); - p++) { + ++p) { if (p->second.rank == -1 && p->second.standby_for_rank < 0 && p->second.standby_for_name.length() == 0 && diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 2cf6cadeb049..eaf56e74c9e8 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -387,7 +387,7 @@ struct inode_t { __u64 max = 0; for (map::const_iterator p = client_ranges.begin(); p != client_ranges.end(); - p++) + ++p) if (p->second.last > max) max = p->second.last; return max; @@ -398,7 +398,7 @@ struct inode_t { } else { for (map::iterator p = client_ranges.begin(); p != client_ranges.end(); - p++) + ++p) p->second.last = new_max; } } @@ -1327,7 +1327,7 @@ protected: } for (multimap<__u64,Context*>::iterator p = waiting.lower_bound(min); p != waiting.end(); - p++) { + ++p) { if (p->first & mask) return true; if (p->first > mask) return false; }