From: Danny Al-Gaaf Date: Mon, 27 Oct 2014 11:01:56 +0000 (+0100) Subject: msg/async/Event.cc: use static_cast instead of c-style cast X-Git-Tag: v0.88~22^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4f5d1f48b94495127190930a087ebf3016b4c4f7;p=ceph.git msg/async/Event.cc: use static_cast instead of c-style cast Signed-off-by: Danny Al-Gaaf --- diff --git a/src/msg/async/Event.cc b/src/msg/async/Event.cc index d09a13bd13d8..3fe427a44b1e 100644 --- a/src/msg/async/Event.cc +++ b/src/msg/async/Event.cc @@ -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(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(realloc(file_events, sizeof(FileEvent)*new_size)); if (!new_events) { lderr(cct) << __func__ << " failed to realloc file_events" << cpp_strerror(errno) << dendl; return -errno;