Skip to content

Commit

Permalink
misc: mark functions with 'override' specifier
Browse files Browse the repository at this point in the history
Fix for:

[src/*/*.h:XX] -> [src/*/*.h:XX]: (style) The function 'XYZ' overrides a
 function in a base class but is not marked with a 'override' specifier.

Signed-off-by: Danny Al-Gaaf <[email protected]>
  • Loading branch information
dalgaaf committed May 2, 2018
1 parent 7810dde commit 76b82e6
Show file tree
Hide file tree
Showing 30 changed files with 133 additions and 133 deletions.
4 changes: 2 additions & 2 deletions src/erasure-code/ErasureCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ namespace ceph {

int create_rule(const std::string &name,
CrushWrapper &crush,
std::ostream *ss) const;
std::ostream *ss) const override;

int sanity_check_k(int k, std::ostream *ss);

unsigned int get_coding_chunk_count() const override {
return get_chunk_count() - get_data_chunk_count();
}

virtual int get_sub_chunk_count() {
virtual int get_sub_chunk_count() override {
return 1;
}

Expand Down
24 changes: 12 additions & 12 deletions src/kv/KineticStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class KineticStore : public KeyValueDB {
/// Creates underlying db if missing and opens it
int create_and_open(ostream &out, const std::vector<ColumnFamily>& = {}) override;

void close();
void close() override;

enum KineticOpType {
KINETIC_OP_WRITE,
Expand Down Expand Up @@ -91,15 +91,15 @@ class KineticStore : public KeyValueDB {
void rm_range_keys(
const string &prefix,
const string &start,
const string &end);
const string &end) override;
};

KeyValueDB::Transaction get_transaction() {
KeyValueDB::Transaction get_transaction() override {
return std::make_shared<KineticTransactionImpl>(this);
}

int submit_transaction(KeyValueDB::Transaction t);
int submit_transaction_sync(KeyValueDB::Transaction t);
int submit_transaction(KeyValueDB::Transaction t) override;
int submit_transaction_sync(KeyValueDB::Transaction t) override;
int get(
const string &prefix,
const std::set<string> &key,
Expand All @@ -117,22 +117,22 @@ class KineticStore : public KeyValueDB {
explicit KineticWholeSpaceIteratorImpl(kinetic::BlockingKineticConnection *conn);
virtual ~KineticWholeSpaceIteratorImpl() { }

int seek_to_first() {
int seek_to_first() override {
return seek_to_first("");
}
int seek_to_first(const string &prefix);
int seek_to_last();
int seek_to_last() override;
int seek_to_last(const string &prefix);
int upper_bound(const string &prefix, const string &after);
int lower_bound(const string &prefix, const string &to);
bool valid();
int next();
int prev();
bool valid() override;
int next() override;
int prev() override;
string key();
pair<string,string> raw_key();
bool raw_key_is_prefixed(const string &prefix);
bufferlist value();
int status();
bufferlist value() override;
int status() override;
};

/// Utility
Expand Down
6 changes: 3 additions & 3 deletions src/kv/RocksDBStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1405,13 +1405,13 @@ class CFIteratorImpl : public KeyValueDB::IteratorImpl {
dbiter->Seek(slice_bound);
return dbiter->status().ok() ? 0 : -1;
}
int next(bool validate=true) {
int next(bool validate=true) override {
if (valid()) {
dbiter->Next();
}
return dbiter->status().ok() ? 0 : -1;
}
int prev(bool validate=true) {
int prev(bool validate=true) override {
if (valid()) {
dbiter->Prev();
}
Expand All @@ -1423,7 +1423,7 @@ class CFIteratorImpl : public KeyValueDB::IteratorImpl {
string key() override {
return dbiter->key().ToString();
}
std::pair<std::string, std::string> raw_key() {
std::pair<std::string, std::string> raw_key() override {
return make_pair(prefix, key());
}
bufferlist value() override {
Expand Down
2 changes: 1 addition & 1 deletion src/librbd/cache/PassthroughImageCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PassthroughImageCache : public ImageCache {
void aio_write(Extents&& image_extents, ceph::bufferlist&& bl,
int fadvise_flags, Context *on_finish) override;
void aio_discard(uint64_t offset, uint64_t length,
bool skip_partial_discard, Context *on_finish);
bool skip_partial_discard, Context *on_finish) override;
void aio_flush(Context *on_finish) override;
void aio_writesame(uint64_t offset, uint64_t length,
ceph::bufferlist&& bl,
Expand Down
2 changes: 1 addition & 1 deletion src/msg/async/dpdk/EventDPDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DPDKDriver : public EventDriver {
int del_event(int fd, int cur_mask, int del_mask) override;
int resize_events(int newsize) override;
int event_wait(vector<FiredFileEvent> &fired_events, struct timeval *tp) override;
bool need_wakeup() { return false; }
bool need_wakeup() override { return false; }
};

#endif //CEPH_EVENTDPDK_H
2 changes: 1 addition & 1 deletion src/msg/async/rdma/RDMAStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class RDMAStack : public NetworkStack {
explicit RDMAStack(CephContext *cct, const string &t);
virtual ~RDMAStack();
virtual bool support_zero_copy_read() const override { return false; }
virtual bool nonblock_connect_need_writable_event() const { return false; }
virtual bool nonblock_connect_need_writable_event() const override { return false; }

virtual void spawn_worker(unsigned i, std::function<void ()> &&func) override;
virtual void join_worker(unsigned i) override;
Expand Down
4 changes: 2 additions & 2 deletions src/osd/PrimaryLogPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
const PGLog &get_log() const override {
return pg_log;
}
void add_local_next_event(const pg_log_entry_t& e) {
void add_local_next_event(const pg_log_entry_t& e) override {
pg_log.missing_add_next_entry(e);
}
bool pgb_is_primary() const override {
Expand Down Expand Up @@ -1095,7 +1095,7 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
PGBackend::RecoveryHandle *h,
bool *work_started);

void finish_degraded_object(const hobject_t& oid);
void finish_degraded_object(const hobject_t& oid) override;

// Cancels/resets pulls from peer
void check_recovery_sources(const OSDMapRef& map) override ;
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_bucket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ class RGWBucketMetadataHandler : public RGWMetadataHandler {
delete info;
}

string get_marker(void *handle) {
string get_marker(void *handle) override {
list_keys_info *info = static_cast<list_keys_info *>(handle);
return info->store->list_raw_objs_get_cursor(info->ctx);
}
Expand Down Expand Up @@ -2442,7 +2442,7 @@ class RGWBucketInstanceMetadataHandler : public RGWMetadataHandler {
delete info;
}

string get_marker(void *handle) {
string get_marker(void *handle) override {
list_keys_info *info = static_cast<list_keys_info *>(handle);
return info->store->list_raw_objs_get_cursor(info->ctx);
}
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_cr_rados.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ class RGWRadosRemoveCR : public RGWSimpleCoroutine {
public:
RGWRadosRemoveCR(RGWRados *store, const rgw_raw_obj& obj);

int send_request();
int request_complete();
int send_request() override;
int request_complete() override;
};

class RGWSimpleRadosLockCR : public RGWSimpleCoroutine {
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_cr_rest.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class RGWStreamReadHTTPResourceCRF : public RGWStreamReadResourceCRF {
int read(bufferlist *data, uint64_t max, bool *need_retry) override; /* reentrant */
int decode_rest_obj(map<string, string>& headers, bufferlist& extra_data) override;
bool has_attrs() override;
void get_attrs(std::map<string, string> *attrs);
void get_attrs(std::map<string, string> *attrs) override;
bool is_done();
virtual bool need_extra_data() { return false; }

Expand Down Expand Up @@ -532,7 +532,7 @@ class RGWStreamSpliceCR : public RGWCoroutine {
std::shared_ptr<RGWStreamWriteHTTPResourceCRF>& _out_crf);
~RGWStreamSpliceCR();

int operate();
int operate() override;
};

#endif
6 changes: 3 additions & 3 deletions src/rgw/rgw_data_sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ class RGWDataSyncShardMarkerTrack : public RGWSyncShardMarkerTrack<string, strin
return true;
}

RGWOrderCallCR *allocate_order_control_cr() {
RGWOrderCallCR *allocate_order_control_cr() override {
return new RGWLastCallerWinsCR(sync_env->cct);
}
};
Expand Down Expand Up @@ -2456,7 +2456,7 @@ class RGWBucketFullSyncShardMarkerTrack : public RGWSyncShardMarkerTrack<rgw_obj
attrs);
}

RGWOrderCallCR *allocate_order_control_cr() {
RGWOrderCallCR *allocate_order_control_cr() override {
return new RGWLastCallerWinsCR(sync_env->cct);
}
};
Expand Down Expand Up @@ -2532,7 +2532,7 @@ class RGWBucketIncSyncShardMarkerTrack : public RGWSyncShardMarkerTrack<string,
return (key_to_marker.find(key) == key_to_marker.end());
}

RGWOrderCallCR *allocate_order_control_cr() {
RGWOrderCallCR *allocate_order_control_cr() override {
return new RGWLastCallerWinsCR(sync_env->cct);
}
};
Expand Down
18 changes: 9 additions & 9 deletions src/rgw/rgw_es_query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ESQueryNode_Bool : public ESQueryNode {
delete second;
}

void dump(Formatter *f) const {
void dump(Formatter *f) const override {
f->open_object_section("bool");
const char *section = (op == "and" ? "must" : "should");
f->open_array_section(section);
Expand Down Expand Up @@ -177,7 +177,7 @@ class ESQueryNodeLeafVal_Str : public ESQueryNodeLeafVal {
val = str_val;
return true;
}
void encode_json(const string& field, Formatter *f) const {
void encode_json(const string& field, Formatter *f) const override {
::encode_json(field.c_str(), val.c_str(), f);
}
};
Expand All @@ -195,7 +195,7 @@ class ESQueryNodeLeafVal_Int : public ESQueryNodeLeafVal {
}
return true;
}
void encode_json(const string& field, Formatter *f) const {
void encode_json(const string& field, Formatter *f) const override {
::encode_json(field.c_str(), val, f);
}
};
Expand All @@ -211,7 +211,7 @@ class ESQueryNodeLeafVal_Date : public ESQueryNodeLeafVal {
}
return true;
}
void encode_json(const string& field, Formatter *f) const {
void encode_json(const string& field, Formatter *f) const override {
string s;
rgw_to_iso8601(val, &s);
::encode_json(field.c_str(), s, f);
Expand Down Expand Up @@ -274,7 +274,7 @@ class ESQueryNode_Op : public ESQueryNode {
allow_restricted = allow;
}

virtual void dump(Formatter *f) const = 0;
virtual void dump(Formatter *f) const override = 0;
};

class ESQueryNode_Op_Equal : public ESQueryNode_Op {
Expand All @@ -293,7 +293,7 @@ class ESQueryNode_Op_Equal : public ESQueryNode_Op {
return do_init(pnode, perr);
}

virtual void dump(Formatter *f) const {
virtual void dump(Formatter *f) const override {
f->open_object_section("term");
val->encode_json(field, f);
f->close_section();
Expand All @@ -305,7 +305,7 @@ class ESQueryNode_Op_Range : public ESQueryNode_Op {
public:
ESQueryNode_Op_Range(ESQueryCompiler *compiler, const string& rs) : ESQueryNode_Op(compiler), range_str(rs) {}

virtual void dump(Formatter *f) const {
virtual void dump(Formatter *f) const override {
f->open_object_section("range");
f->open_object_section(field.c_str());
val->encode_json(range_str, f);
Expand All @@ -332,7 +332,7 @@ class ESQueryNode_Op_Nested : public ESQueryNode_Op_Nested_Parent {
delete next;
}

virtual void dump(Formatter *f) const {
virtual void dump(Formatter *f) const override {
f->open_object_section("nested");
string s = string("meta.custom-") + type_str();
encode_json("path", s.c_str(), f);
Expand All @@ -353,7 +353,7 @@ class ESQueryNode_Op_Nested : public ESQueryNode_Op_Nested_Parent {
}

string type_str() const;
string get_custom_leaf_field_name() {
string get_custom_leaf_field_name() override {
return string("meta.custom-") + type_str() + ".value";
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_keystone.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class BarbicanTokenRequestVer2 : public AdminTokenRequest {
BarbicanTokenRequestVer2(CephContext * const _cct)
: cct(_cct) {
}
void dump(Formatter *f) const;
void dump(Formatter *f) const override;
};

class BarbicanTokenRequestVer3 : public AdminTokenRequest {
Expand All @@ -365,7 +365,7 @@ class BarbicanTokenRequestVer3 : public AdminTokenRequest {
BarbicanTokenRequestVer3(CephContext * const _cct)
: cct(_cct) {
}
void dump(Formatter *f) const;
void dump(Formatter *f) const override;
};


Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_lc_s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class LCMPExpiration_S3 : public LCExpiration, public XMLObj
LCMPExpiration_S3() {}
~LCMPExpiration_S3() {}

bool xml_end(const char *el);
bool xml_end(const char *el) override;
void to_xml(ostream& out) {
out << "<AbortIncompleteMultipartUpload>" << "<DaysAfterInitiation>" << days << "</DaysAfterInitiation>" << "</AbortIncompleteMultipartUpload>";
}
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class RGWMetadataTopHandler : public RGWMetadataHandler {
delete data;
}

virtual string get_marker(void *handle) {
virtual string get_marker(void *handle) override {
iter_data *data = static_cast<iter_data *>(handle);

if (data->iter != data->sections.end()) {
Expand Down
Loading

0 comments on commit 76b82e6

Please sign in to comment.