qthread_win.cpp: Fix compiler warnings by MSVC2015 (64bit).
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Fri, 31 Jul 2015 13:52:11 +0000 (15:52 +0200)
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Tue, 18 Aug 2015 20:03:35 +0000 (20:03 +0000)
thread\qthread_win.cpp(121): warning C4312: 'reinterpret_cast': conversion from 'DWORD' to 'Qt::HANDLE' of greater size
thread\qthread_win.cpp(343): warning C4312: 'reinterpret_cast': conversion from 'DWORD' to 'Qt::HANDLE' of greater size
thread\qthread_win.cpp(416): warning C4312: 'reinterpret_cast': conversion from 'DWORD' to 'Qt::HANDLE' of greater size

Change-Id: I5e60e4bb91a32491562748755d34a2c5a1e264b4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
src/corelib/thread/qthread_win.cpp

index c16a2e958c6befce29502b89f38eea0b26ff106f..57eeb10b7d26feca62d8db34186ff3b8de2c9f9c 100644 (file)
@@ -118,7 +118,7 @@ QThreadData *QThreadData::current(bool createIfNecessary)
         }
         threadData->deref();
         threadData->isAdopted = true;
-        threadData->threadId = reinterpret_cast<Qt::HANDLE>(GetCurrentThreadId());
+        threadData->threadId = reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
 
         if (!QCoreApplicationPrivate::theMainThread) {
             QCoreApplicationPrivate::theMainThread = threadData->thread;
@@ -340,7 +340,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
 
     qt_create_tls();
     TlsSetValue(qt_current_thread_data_tls_index, data);
-    data->threadId = reinterpret_cast<Qt::HANDLE>(GetCurrentThreadId());
+    data->threadId = reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
 
     QThread::setTerminationEnabled(false);
 
@@ -413,7 +413,7 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway)
 
 Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
 {
-    return reinterpret_cast<Qt::HANDLE>(GetCurrentThreadId());
+    return reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
 }
 
 int QThread::idealThreadCount() Q_DECL_NOTHROW