]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Get rid of some COOKIE_LEN preprocessor macros
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 11 Aug 2022 21:52:17 +0000 (17:52 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 11 Jan 2023 06:26:27 +0000 (01:26 -0500)
Sticking random #defines everywhere is just atrocious style.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/driver/rados/rgw_cr_rados.h
src/rgw/rgw_op.h

index 03c5303ebf79e86f4a53973c0c4a60edf13e2352..5a0f1db20a13d2dd343beec4b4335b86be2824ac 100644 (file)
@@ -772,7 +772,7 @@ public:
   int request_complete() override;
 
   static std::string gen_random_cookie(CephContext* cct) {
-#define COOKIE_LEN 16
+    static constexpr std::size_t COOKIE_LEN = 16;
     char buf[COOKIE_LEN + 1];
     gen_rand_alphanumeric(cct, buf, sizeof(buf) - 1);
     return buf;
index cc65a577632e997418bba3e645a1d4a7fc00537c..d0ff70b3132dd34646a8c62d01b8fa8cfe219273 100644 (file)
@@ -1659,7 +1659,7 @@ public:
   ~RGWPutLC() override {}
 
   void init(rgw::sal::Driver* driver, req_state *s, RGWHandler *dialect_handler) override {
-#define COOKIE_LEN 16
+    static constexpr std::size_t COOKIE_LEN = 16;
     char buf[COOKIE_LEN + 1];
 
     RGWOp::init(driver, s, dialect_handler);