]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/Event.cc: use static_cast instead of c-style cast
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 27 Oct 2014 11:01:56 +0000 (12:01 +0100)
committerSage Weil <sage@redhat.com>
Mon, 27 Oct 2014 19:44:26 +0000 (12:44 -0700)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/msg/async/Event.cc

index d09a13bd13d83ac916e5c56e7efa9c11a8cf0e59..3fe427a44b1edcfa5f881478ab4a8b932e16bf3c 100644 (file)
@@ -74,7 +74,7 @@ int EventCenter::init(int n)
 
   notify_receive_fd = fds[0];
   notify_send_fd = fds[1];
-  file_events = (FileEvent *)malloc(sizeof(FileEvent)*n);
+  file_events = static_cast<FileEvent *>(malloc(sizeof(FileEvent)*n));
   memset(file_events, 0, sizeof(FileEvent)*n);
 
   nevent = n;
@@ -106,7 +106,7 @@ int EventCenter::create_file_event(int fd, int mask, EventCallbackRef ctxt)
       lderr(cct) << __func__ << " event count is exceed." << dendl;
       return -ERANGE;
     }
-    FileEvent *new_events = (FileEvent *)realloc(file_events, sizeof(FileEvent)*new_size);
+    FileEvent *new_events = static_cast<FileEvent *>(realloc(file_events, sizeof(FileEvent)*new_size));
     if (!new_events) {
       lderr(cct) << __func__ << " failed to realloc file_events" << cpp_strerror(errno) << dendl;
       return -errno;