layers: Fix 32-bit Windows build
authorDustin Graves <dustin@lunarg.com>
Fri, 5 Feb 2016 23:06:21 +0000 (16:06 -0700)
committerDustin Graves <dustin@lunarg.com>
Fri, 5 Feb 2016 23:06:21 +0000 (16:06 -0700)
A reinterpret_cast from a non-dispatch handle to uint64_t was failing on
windows 32-bit where non-dispatch handles are defined as 'typdef uint64_t
object'.  Changed reinterpret_cast to a C-style cast, as is consistent
with the rest of the non-dispatch handle to uint64_t conversions in
draw_state.

layers/threading.h

index 0b8e947..a0b025f 100644 (file)
@@ -82,7 +82,7 @@ template <typename T> class counter {
             if (use_data->reader_count == 0) {
                 // There are no readers.  Two writers just collided.
                 if (use_data->thread != tid) {
-                    skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, reinterpret_cast<uint64_t>(object),
+                    skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object),
                         /*location*/ 0, THREADING_CHECKER_MULTIPLE_THREADS, "THREADING",
                         "THREADING ERROR : object of type %s is simultaneously used in thread %ld and thread %ld",
                         typeName, use_data->thread, tid);
@@ -109,7 +109,7 @@ template <typename T> class counter {
             } else {
                 // There are readers.  This writer collided with them.
                 if (use_data->thread != tid) {
-                    skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, reinterpret_cast<uint64_t>(object),
+                    skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object),
                         /*location*/ 0, THREADING_CHECKER_MULTIPLE_THREADS, "THREADING",
                         "THREADING ERROR : object of type %s is simultaneously used in thread %ld and thread %ld",
                         typeName, use_data->thread, tid);
@@ -163,7 +163,7 @@ template <typename T> class counter {
             use_data->thread = tid;
         } else if (uses[object].writer_count > 0 && uses[object].thread != tid) {
             // There is a writer of the object.
-            skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, reinterpret_cast<uint64_t>(object),
+            skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object),
                 /*location*/ 0, THREADING_CHECKER_MULTIPLE_THREADS, "THREADING",
                 "THREADING ERROR : object of type %s is simultaneously used in thread %ld and thread %ld",
                 typeName, uses[object].thread, tid);