]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/admin: avoid using C-style cast
authorKefu Chai <kchai@redhat.com>
Tue, 9 Mar 2021 14:23:59 +0000 (22:23 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 9 Mar 2021 14:32:36 +0000 (22:32 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/admin/admin_socket.cc

index 0c05ce73302b7b83c0bf94994724866f40f9f12c..f8ba8de140fb93b5f8dadf2ef21e069410d39c03 100644 (file)
@@ -119,7 +119,8 @@ seastar::future<> AdminSocket::finalize_response(
   uint32_t response_length = htonl(outbuf_cont.length());
   logger().info("asok response length: {}", outbuf_cont.length());
 
-  return out.write((char*)&response_length, sizeof(uint32_t))
+  return out.write(reinterpret_cast<char*>(&response_length),
+                   sizeof(response_length))
     .then([&out, outbuf_cont] { return out.write(outbuf_cont.c_str()); });
 }