[PATCH 6/8] include/xlist.h: fix C-style pointer casting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace C-style pointer casting with correct static_cast<>().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@xxxxxxxxx>
---
 src/include/xlist.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/include/xlist.h b/src/include/xlist.h
index 5c2bf03..5384561 100644
--- a/src/include/xlist.h
+++ b/src/include/xlist.h
@@ -132,8 +132,8 @@ public:
     assert((bool)_front == (bool)_size);
   }
 
-  T front() { return (T)_front->_item; }
-  T back() { return (T)_back->_item; }
+  T front() { return static_cast<T>(_front->_item); }
+  T back() { return static_cast<T>(_back->_item); }
 
   void pop_front() {
     assert(!empty());
@@ -149,7 +149,7 @@ public:
     item *cur;
   public:
     iterator(item *i = 0) : cur(i) {}
-    T operator*() { return (T)cur->_item; }
+    T operator*() { return static_cast<T>(cur->_item); }
     iterator& operator++() {
       assert(cur);
       assert(cur->_list);
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux