From 769109312172786080fe5b7cc32812135ca394f3 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Thu, 14 Dec 2017 14:13:07 -0500 Subject: [PATCH] [host] DEBUG_* string format fixes --- host/Capture/DXGI.cpp | 14 +++++++------- host/IVSHMEM.cpp | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 07ac3bdc..2cc44461 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -51,7 +51,7 @@ bool DXGI::Initialize(CaptureOptions * options) status = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void **)(&m_dxgiFactory)); if (FAILED(status)) { - DEBUG_ERROR("Failed to create DXGIFactory: %08x", status); + DEBUG_ERROR("Failed to create DXGIFactory: %08x", (int)status); return false; } @@ -150,7 +150,7 @@ bool DXGI::Initialize(CaptureOptions * options) if (FAILED(status)) { - DEBUG_ERROR("DuplicateOutput Failed: %08x", status); + DEBUG_ERROR("DuplicateOutput Failed: %08x", (int)status); DeInitialize(); return false; } @@ -172,7 +172,7 @@ bool DXGI::Initialize(CaptureOptions * options) status = m_device->CreateTexture2D(&texDesc, NULL, &m_texture); if (FAILED(status)) { - DEBUG_ERROR("Failed to create texture: %08x", status); + DEBUG_ERROR("Failed to create texture: %08x", (int)status); DeInitialize(); return false; } @@ -286,7 +286,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame) if (!SUCCEEDED(status)) { m_dup->ReleaseFrame(); - DEBUG_ERROR("Failed to get the new pointer shape: %08x", status); + DEBUG_ERROR("Failed to get the new pointer shape: %08x", (int)status); return GRAB_STATUS_ERROR; } @@ -350,7 +350,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame) default: // unknown failure - DEBUG_INFO("AcquireNextFrame failed: %08x", status); + DEBUG_INFO("AcquireNextFrame failed: %08x", (int)status); return GRAB_STATUS_ERROR; } } @@ -391,7 +391,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame) status = surface->Map(&rect, DXGI_MAP_READ); if (FAILED(status)) { - DEBUG_ERROR("Failed to map surface: %08x", status); + DEBUG_ERROR("Failed to map surface: %08x", (int)status); return GRAB_STATUS_ERROR; } @@ -408,7 +408,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame) if (FAILED(status)) { - DEBUG_ERROR("Failed to unmap surface: %08x", status); + DEBUG_ERROR("Failed to unmap surface: %08x", (int)status); return GRAB_STATUS_ERROR; } diff --git a/host/IVSHMEM.cpp b/host/IVSHMEM.cpp index b177637c..c54c2eed 100644 --- a/host/IVSHMEM.cpp +++ b/host/IVSHMEM.cpp @@ -112,7 +112,7 @@ void IVSHMEM::DeInitialize() if (m_gotMemory) { if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_RELEASE_MMAP, NULL, 0, NULL, 0, NULL, NULL)) - DEBUG_ERROR("DeviceIoControl failed: %d", GetLastError()); + DEBUG_ERROR("DeviceIoControl failed: %d", (int)GetLastError()); m_memory = NULL; } @@ -143,7 +143,7 @@ UINT64 IVSHMEM::GetSize() IVSHMEM_SIZE size; if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_REQUEST_SIZE, NULL, 0, &size, sizeof(IVSHMEM_SIZE), NULL, NULL)) { - DEBUG_ERROR("DeviceIoControl Failed: %d", GetLastError()); + DEBUG_ERROR("DeviceIoControl Failed: %d", (int)GetLastError()); return 0; } @@ -163,7 +163,7 @@ UINT16 IVSHMEM::GetPeerID() IVSHMEM_PEERID peerID; if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_REQUEST_SIZE, NULL, 0, &peerID, sizeof(IVSHMEM_PEERID), NULL, NULL)) { - DEBUG_ERROR("DeviceIoControl Failed: %d", GetLastError()); + DEBUG_ERROR("DeviceIoControl Failed: %d", (int)GetLastError()); return 0; } @@ -195,7 +195,7 @@ void * IVSHMEM::GetMemory() ZeroMemory(&map, sizeof(IVSHMEM_MMAP)); if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_REQUEST_MMAP, NULL, 0, &map, sizeof(IVSHMEM_MMAP), NULL, NULL)) { - DEBUG_ERROR("DeviceIoControl Failed: %d", GetLastError()); + DEBUG_ERROR("DeviceIoControl Failed: %d", (int)GetLastError()); return NULL; } @@ -219,7 +219,7 @@ HANDLE IVSHMEM::CreateVectorEvent(UINT16 vector) HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL); if (event == INVALID_HANDLE_VALUE) { - DEBUG_ERROR("CreateEvent Failed: %d", GetLastError()); + DEBUG_ERROR("CreateEvent Failed: %d", (int)GetLastError()); return INVALID_HANDLE_VALUE; } @@ -230,7 +230,7 @@ HANDLE IVSHMEM::CreateVectorEvent(UINT16 vector) if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_REGISTER_EVENT, &msg, sizeof(IVSHMEM_EVENT), NULL, 0, NULL, NULL)) { - DEBUG_ERROR("DeviceIoControl Failed: %d", GetLastError()); + DEBUG_ERROR("DeviceIoControl Failed: %d", (int)GetLastError()); CloseHandle(event); return INVALID_HANDLE_VALUE; } @@ -249,7 +249,7 @@ bool IVSHMEM::RingDoorbell(UINT16 peerID, UINT16 door) if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_RING_DOORBELL, &msg, sizeof(IVSHMEM_RING), NULL, 0, NULL, NULL)) { - DEBUG_ERROR("DeviceIoControl Failed: %d", GetLastError()); + DEBUG_ERROR("DeviceIoControl Failed: %d", (int)GetLastError()); return false; }