[vlc-devel] [PATCH 2/7] demux/adaptive: PlaylistManager: prefer static_cast

Filip Roséen filip at atch.se
Thu May 18 12:02:14 CEST 2017


There is no need to use reinterpret_cast when the source or
destination type is pointer-to-void, static_cast is more accurate (and
safer).
---
 modules/demux/adaptive/PlaylistManager.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 7180b66a12..8fcb53edad 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -163,7 +163,7 @@ bool PlaylistManager::start()
     updateControlsPosition();
 
     b_thread = !vlc_clone(&thread, managerThread,
-                          reinterpret_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT);
+                          static_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT);
     if(!b_thread)
         return false;
 
@@ -674,7 +674,7 @@ void PlaylistManager::Run()
 
 void * PlaylistManager::managerThread(void *opaque)
 {
-    (reinterpret_cast<PlaylistManager *>(opaque))->Run();
+    static_cast<PlaylistManager *>(opaque)->Run();
     return NULL;
 }
 
-- 
2.12.2


More information about the vlc-devel mailing list