From c8ca98ed02b38d11672ee7f86ebf977289cdf403 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 30 Apr 2017 02:04:51 +0800 Subject: [PATCH] crush: pass by const reference to kill compiling error i have following error when compiling with gcc-6 on armhf ceph/src/crush/CrushCompiler.cc: In member function 'int CrushCompiler::decompile(std::ostream&)': ceph/src/crush/CrushCompiler.cc:462:45: error: invalid initialization of non-const reference of type 'std::pair&' from an rvalue of type 'std::pair' int ret = decompile_choose_args(i, out); Signed-off-by: Kefu Chai --- src/crush/CrushCompiler.cc | 2 +- src/crush/CrushCompiler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc index 4e0df956b6527..ac5599250ca14 100644 --- a/src/crush/CrushCompiler.cc +++ b/src/crush/CrushCompiler.cc @@ -287,7 +287,7 @@ int CrushCompiler::decompile_choose_arg_map(crush_choose_arg_map arg_map, return 0; } -int CrushCompiler::decompile_choose_args(std::pair &i, +int CrushCompiler::decompile_choose_args(const std::pair &i, ostream &out) { out << "choose_args " << i.first << " {\n"; diff --git a/src/crush/CrushCompiler.h b/src/crush/CrushCompiler.h index 3a93085597c34..5146480683b0f 100644 --- a/src/crush/CrushCompiler.h +++ b/src/crush/CrushCompiler.h @@ -36,7 +36,7 @@ class CrushCompiler { ostream &out); int decompile_choose_arg_map(crush_choose_arg_map arg_map, ostream &out); - int decompile_choose_args(std::pair &i, + int decompile_choose_args(const std::pair &i, ostream &out); int decompile_bucket_impl(int i, ostream &out); int decompile_bucket(int cur, -- 2.39.5