[vlc-commits] demux/adaptive: Downloader: prefer static_cast

Filip Roséen git at videolan.org
Thu May 18 21:08:05 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Thu May 18 12:02:15 2017 +0200| [85766bf3c27f047bd88fa5b3eef268717d8532b3] | committer: Jean-Baptiste Kempf

demux/adaptive: Downloader: prefer static_cast

There is no need to use reinterpret_cast when the destination or
source type is pointer-to-void, static_cast is more accurate (and
safer).

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=85766bf3c27f047bd88fa5b3eef268717d8532b3
---

 modules/demux/adaptive/http/Downloader.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/http/Downloader.cpp b/modules/demux/adaptive/http/Downloader.cpp
index 164ad743dc..8d0d20c765 100644
--- a/modules/demux/adaptive/http/Downloader.cpp
+++ b/modules/demux/adaptive/http/Downloader.cpp
@@ -40,7 +40,7 @@ bool Downloader::start()
 {
     if(!thread_handle_valid &&
        vlc_clone(&thread_handle, downloaderThread,
-                 reinterpret_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT))
+                 static_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT))
     {
         return false;
     }
@@ -74,7 +74,7 @@ void Downloader::cancel(HTTPChunkBufferedSource *source)
 
 void * Downloader::downloaderThread(void *opaque)
 {
-    Downloader *instance = reinterpret_cast<Downloader *>(opaque);
+    Downloader *instance = static_cast<Downloader *>(opaque);
     int canc = vlc_savecancel();
     instance->Run();
     vlc_restorecancel( canc );



More information about the vlc-commits mailing list