From: Jos Collin Date: Mon, 1 Jul 2019 09:02:33 +0000 (+0530) Subject: rgw: Silence warning: control reaches end of non-void function X-Git-Tag: v15.1.0~2188^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=abb2451dd5164e6b610589207b900a6464e21282;p=ceph-ci.git rgw: Silence warning: control reaches end of non-void function 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 --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index bce2ca94576..ec2afd5b939 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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() {