]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Silence warning: control reaches end of non-void function
authorJos Collin <jcollin@redhat.com>
Mon, 1 Jul 2019 09:02:33 +0000 (14:32 +0530)
committerNathan Cutler <ncutler@suse.com>
Tue, 19 Nov 2019 16:38:09 +0000 (17:38 +0100)
Build shows:
[ 53%] Building CXX object src/mds/CMakeFiles/mds.dir/JournalPointer.cc.o
ceph/src/rgw/rgw_rest_s3.cc: In member function ‘RGWOp* RGWHandler_REST_Bucket_S3::get_obj_op(bool)’:
ceph/src/rgw/rgw_rest_s3.cc:3588:5: warning: control reaches end of non-void function [-Wreturn-type]
   }   }
     ^
Fixes: 4ffc765c4c5debc665ade7769c4647c3a7278fd2
Fixes: http://tracker.ceph.com/issues/40747
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit abb2451dd5164e6b610589207b900a6464e21282)

src/rgw/rgw_rest_s3.cc

index 078fb51945bd32099d1007ca0d833f1bdb0a7fc2..5cd6f238b11d6ba9d9978fed847fbe8b6fa71d4d 100644 (file)
@@ -3528,13 +3528,19 @@ RGWOp *RGWHandler_REST_Bucket_S3::get_obj_op(bool get_data)
 
    // Non-website mode    // Non-website mode
   if (get_data) {   
-    if (list_type == 1) {
-       return new RGWListBucket_ObjStore_S3;     
-    } else if(list_type == 2) {
-      return new RGWListBucket_ObjStore_S3v2;
-    } } else {
-    return new RGWStatBucket_ObjStore_S3;    
-  }   }
+    switch (list_type) {
+      case 1:
+        return new RGWListBucket_ObjStore_S3;
+      case 2:
+        return new RGWListBucket_ObjStore_S3v2;
+      default:
+        ldpp_dout(s, 5) << __func__ << ": unsupported list-type " << list_type << dendl;
+        return new RGWListBucket_ObjStore_S3;
+    }
+  } else {
+    return new RGWStatBucket_ObjStore_S3;
+  }
+}
 
 RGWOp *RGWHandler_REST_Bucket_S3::op_get()
 {