]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: convert string constant to string_view
authorKefu Chai <kchai@redhat.com>
Sun, 13 Sep 2020 15:12:02 +0000 (23:12 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 13 Sep 2020 15:32:10 +0000 (23:32 +0800)
instead of converting string constant to char*, construct string_views
from string constants

to silence GCC warnings like:

src/rgw/services/svc_sys_obj_cache.cc:512:7: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  512 |     { "cache list name=filter,type=CephString,req=false",
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/services/svc_sys_obj_cache.cc

index bce50a115b5acfa856336eee49f04993e9f76930..5407dace4c65968784a406275b3478afc8a7902b 100644 (file)
@@ -508,7 +508,7 @@ static void cache_list_dump_helper(Formatter* f,
 class RGWSI_SysObj_Cache_ASocketHook : public AdminSocketHook {
   RGWSI_SysObj_Cache *svc;
 
-  static constexpr char* admin_commands[][2] = {
+  static constexpr std::string_view admin_commands[][2] = {
     { "cache list name=filter,type=CephString,req=false",
       "cache list [filter_str]: list object cache, possibly matching substrings" },
     { "cache inspect name=target,type=CephString,req=true",