]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: pass by const reference to kill compiling error
authorKefu Chai <kchai@redhat.com>
Sat, 29 Apr 2017 18:04:51 +0000 (02:04 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 1 May 2017 07:45:42 +0000 (15:45 +0800)
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<const long unsigned int,
crush_choo
se_arg_map>&' from an rvalue of type 'std::pair<const long unsigned int,
crush_choose_arg_map>'
       int ret = decompile_choose_args(i, out);

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crush/CrushCompiler.cc
src/crush/CrushCompiler.h

index 4e0df956b6527ce675e92bb30b22955683091184..ac5599250ca148913bb6255d24a0bc0d42cae090 100644 (file)
@@ -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<const long unsigned int, crush_choose_arg_map> &i,
+int CrushCompiler::decompile_choose_args(const std::pair<const long unsigned int, crush_choose_arg_map> &i,
                                          ostream &out)
 {
   out << "choose_args " << i.first << " {\n";
index 3a93085597c34f242c2d93bef1c964c5d564b1e7..5146480683b0f8fb8377b69ce43ef01f91355cf6 100644 (file)
@@ -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<const long unsigned int, crush_choose_arg_map> &i,
+  int decompile_choose_args(const std::pair<const long unsigned int, crush_choose_arg_map> &i,
                            ostream &out);
   int decompile_bucket_impl(int i, ostream &out);
   int decompile_bucket(int cur,