]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerJos Collin <jcollin@redhat.com>
Fri, 12 Jul 2019 10:22:54 +0000 (15:52 +0530)
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>
src/rgw/rgw_rest_s3.cc

index bce2ca9457698f0c394b48799762129508b84328..ec2afd5b939d7c8cd8b5831192fc4de183bdfd87 100644 (file)
@@ -3579,13 +3579,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()
 {