New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: put-to operator function - const input cleanup #15364

Merged
merged 1 commit into from Jun 1, 2017

Conversation

Projects
None yet
3 participants
@joscollin
Member

joscollin commented May 30, 2017

Fixed the instances of the issue specified in Tracker#3977 inside src/ folder utmost, by adding
const input. This fix avoids the following directories inside src: rocksdb/ zstd/ boost/ rapidjson/ googletest/ Beast/.

Fixes: http://tracker.ceph.com/issues/3977

Signed-off-by: Jos Collin jcollin@redhat.com

@gregsfortytwo

I love const cleanups! In this case though I think several of them are integer types where it's slightly more appropriate to just copy them instead of dereferencing them. Can/did you check?

@@ -27,7 +27,7 @@
code_environment_t g_code_env = CODE_ENVIRONMENT_UTILITY;
extern "C" const char *code_environment_to_str(enum code_environment_t e)
extern "C" const char *code_environment_to_str(const enum code_environment_t &e)
{

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -119,7 +119,7 @@ struct LogSummary {
};
WRITE_CLASS_ENCODER_FEATURES(LogSummary)
inline ostream& operator<<(ostream& out, clog_type t)
inline ostream& operator<<(ostream& out, const clog_type& t)

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -148,7 +148,7 @@ class frag_t {
}
};
inline std::ostream& operator<<(std::ostream& out, frag_t hb)
inline std::ostream& operator<<(std::ostream& out, const frag_t& hb)

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -44,7 +44,7 @@ struct denc_traits<inodeno_t> {
}
};
inline ostream& operator<<(ostream& out, inodeno_t ino) {
inline ostream& operator<<(ostream& out, const inodeno_t& ino) {

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -139,7 +139,7 @@ struct denc_traits<snapid_t> {
}
};
inline ostream& operator<<(ostream& out, snapid_t s) {
inline ostream& operator<<(ostream& out, const snapid_t& s) {

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -418,7 +418,7 @@ enum health_status_t {
};
#ifdef __cplusplus
inline ostream& operator<<(ostream &oss, health_status_t status) {
inline ostream& operator<<(ostream &oss, const health_status_t& status) {

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -44,7 +44,7 @@ using std::vector;
#define dout_subsys ceph_subsys_mon
ostream& operator<<(ostream& out, mon_rwxa_t p)
ostream& operator<<(ostream& out, const mon_rwxa_t& p)

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@@ -24,7 +24,7 @@
using std::ostream;
using std::vector;
ostream& operator<<(ostream& out, osd_rwxa_t p)
ostream& operator<<(ostream& out, const osd_rwxa_t& p)

This comment has been minimized.

@gregsfortytwo

gregsfortytwo May 30, 2017

Member

Integer type?

@joscollin

This comment has been minimized.

Member

joscollin commented May 31, 2017

@gregsfortytwo Thanks for the review.

Fixed your review comments in:
src/common/code_environment.cc
src/common/LogEntry.h
src/include/types.h

The others are either classes or structs.

@gregsfortytwo

This comment has been minimized.

Member

gregsfortytwo commented May 31, 2017

Cool, LGTM.
...or would, if it didn't have a build error? :)

src: put-to operator function - const input cleanup
Fixed the instances of the issue specified in Tracker#3977 inside src/ folder utmost, by adding
const input. This fix avoids the following directories inside src: rocksdb/ zstd/ boost/ rapidjson/ googletest/ Beast/.

Fixes: http://tracker.ceph.com/issues/3977

Signed-off-by: Jos Collin <jcollin@redhat.com>
@joscollin

This comment has been minimized.

Member

joscollin commented May 31, 2017

@gregsfortytwo Sorry, missed to update code_environment.h accordingly.

Fixed it. Please review now. Thanks.

@gregsfortytwo

Reviewed-by: Greg Farnum gfarnum@redhat.com

@liewegas liewegas merged commit aee60f2 into ceph:master Jun 1, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@joscollin joscollin deleted the joscollin:wip-cleanup-putto-operator-const branch Jun 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment