[PATCH qxl-wddm-dod 10/12] Use C++ style for allocations for m_ModeInfo field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 qxldod/QxlDod.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 0e861c8..537feb9 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -2379,7 +2379,7 @@ VgaDevice::~VgaDevice(void)
 {
     PAGED_CODE();
     HWClose();
-    delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
+    delete [] m_ModeInfo;
     delete [] m_ModeNumbers;
     m_ModeInfo = NULL;
     m_ModeNumbers = NULL;
@@ -2510,12 +2510,12 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
 
     DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeCount %d\n", ModeCount));
 
-    delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
+    delete [] m_ModeInfo;
     delete [] m_ModeNumbers;
     m_ModeInfo = NULL;
     m_ModeNumbers = NULL;
 
-    m_ModeInfo = reinterpret_cast<PVIDEO_MODE_INFORMATION> (new (PagedPool) BYTE[sizeof (VIDEO_MODE_INFORMATION) * ModeCount]);
+    m_ModeInfo = new (PagedPool) VIDEO_MODE_INFORMATION[ModeCount];
     if (!m_ModeInfo)
     {
         Status = STATUS_NO_MEMORY;
@@ -3071,7 +3071,7 @@ QxlDevice::~QxlDevice(void)
 {
     PAGED_CODE();
     HWClose();
-    delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
+    delete [] m_ModeInfo;
     delete [] m_ModeNumbers;
     m_ModeInfo = NULL;
     m_ModeNumbers = NULL;
@@ -3152,13 +3152,13 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
         return STATUS_UNSUCCESSFUL;
     }
 
-    delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
+    delete [] m_ModeInfo;
     delete [] m_ModeNumbers;
     m_ModeInfo = NULL;
     m_ModeNumbers = NULL;
 
     ModeCount += 2;
-    m_ModeInfo = reinterpret_cast<PVIDEO_MODE_INFORMATION> (new (PagedPool) BYTE[sizeof (VIDEO_MODE_INFORMATION) * ModeCount]);
+    m_ModeInfo = new (PagedPool) VIDEO_MODE_INFORMATION[ModeCount];
     if (!m_ModeInfo)
     {
         Status = STATUS_NO_MEMORY;
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]