Michael Stefaniuc : d3d9: Remove ERR() on HeapAlloc failure for small sizes known at compile time.

Alexandre Julliard julliard at winehq.org
Thu Feb 7 14:07:23 CST 2013


Module: wine
Branch: master
Commit: d86ecd4bb4471590231b31e307d573518c8e398a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d86ecd4bb4471590231b31e307d573518c8e398a

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Thu Feb  7 12:55:34 2013 +0100

d3d9: Remove ERR() on HeapAlloc failure for small sizes known at compile time.

---

 dlls/d3d9/d3d9_main.c         |    6 ------
 dlls/d3d9/device.c            |   25 -------------------------
 dlls/d3d9/directx.c           |    6 ------
 dlls/d3d9/swapchain.c         |    3 ---
 dlls/d3d9/vertexdeclaration.c |    3 ---
 5 files changed, 0 insertions(+), 43 deletions(-)

diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c
index 065a37e..ad2e330 100644
--- a/dlls/d3d9/d3d9_main.c
+++ b/dlls/d3d9/d3d9_main.c
@@ -40,10 +40,7 @@ IDirect3D9 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT sdk_version)
     TRACE("sdk_version %#x.\n", sdk_version);
 
     if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
-    {
-        ERR("Failed to allocate d3d9 object memory.\n");
         return NULL;
-    }
 
     if (!d3d9_init(object, FALSE))
     {
@@ -64,10 +61,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT sdk_version, IDirect3D9E
     TRACE("sdk_version %#x, d3d9ex %p.\n", sdk_version, d3d9ex);
 
     if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
-    {
-        ERR("Failed to allocate d3d9 object memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     if (!d3d9_init(object, TRUE))
     {
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 91543b5..7b53790 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -734,10 +734,7 @@ static HRESULT WINAPI d3d9_device_CreateTexture(IDirect3DDevice9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate texture memory.\n");
         return D3DERR_OUTOFVIDEOMEMORY;
-    }
 
     hr = texture_init(object, device, width, height, levels, usage, format, pool);
     if (FAILED(hr))
@@ -781,10 +778,7 @@ static HRESULT WINAPI d3d9_device_CreateVolumeTexture(IDirect3DDevice9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate volume texture memory.\n");
         return D3DERR_OUTOFVIDEOMEMORY;
-    }
 
     hr = volumetexture_init(object, device, width, height, depth, levels, usage, format, pool);
     if (FAILED(hr))
@@ -816,10 +810,7 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate cube texture memory.\n");
         return D3DERR_OUTOFVIDEOMEMORY;
-    }
 
     hr = cubetexture_init(object, device, edge_length, levels, usage, format, pool);
     if (FAILED(hr))
@@ -851,10 +842,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexBuffer(IDirect3DDevice9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate buffer memory.\n");
         return D3DERR_OUTOFVIDEOMEMORY;
-    }
 
     hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
     if (FAILED(hr))
@@ -886,10 +874,7 @@ static HRESULT WINAPI d3d9_device_CreateIndexBuffer(IDirect3DDevice9Ex *iface, U
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate buffer memory.\n");
         return D3DERR_OUTOFVIDEOMEMORY;
-    }
 
     hr = indexbuffer_init(object, device, size, usage, format, pool);
     if (FAILED(hr))
@@ -1559,10 +1544,7 @@ static HRESULT WINAPI d3d9_device_CreateStateBlock(IDirect3DDevice9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate stateblock memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = stateblock_init(object, device, type, NULL);
     if (FAILED(hr))
@@ -1613,7 +1595,6 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
     {
-        ERR("Failed to allocate stateblock memory.\n");
         wined3d_mutex_lock();
         wined3d_stateblock_decref(wined3d_stateblock);
         wined3d_mutex_unlock();
@@ -2413,10 +2394,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate vertex shader memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = vertexshader_init(object, device, byte_code);
     if (FAILED(hr))
@@ -2896,10 +2874,7 @@ static HRESULT WINAPI d3d9_device_CreateQuery(IDirect3DDevice9Ex *iface, D3DQUER
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate query memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = query_init(object, device, type);
     if (FAILED(hr))
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index a97ff57..a335375 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -456,10 +456,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_CreateDevice(IDirect3D9Ex *iface, U
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate device memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = device_init(object, d3d9, d3d9->wined3d, adapter, device_type, focus_window, flags, parameters, NULL);
     if (FAILED(hr))
@@ -567,10 +564,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_CreateDeviceEx(IDirect3D9Ex *iface,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate device memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = device_init(object, d3d9, d3d9->wined3d, adapter, device_type, focus_window, flags, parameters, mode);
     if (FAILED(hr))
diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c
index 3b32346..8177336 100644
--- a/dlls/d3d9/swapchain.c
+++ b/dlls/d3d9/swapchain.c
@@ -278,10 +278,7 @@ HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapcha
     HRESULT hr;
 
     if (!(object = HeapAlloc(GetProcessHeap(),  HEAP_ZERO_MEMORY, sizeof(*object))))
-    {
-        ERR("Failed to allocate swapchain memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     if (FAILED(hr = swapchain_init(object, device, desc)))
     {
diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c
index 4fe1189..502b7d3 100644
--- a/dlls/d3d9/vertexdeclaration.c
+++ b/dlls/d3d9/vertexdeclaration.c
@@ -419,10 +419,7 @@ HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device,
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate vertex declaration memory.\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = vertexdeclaration_init(object, device, elements);
     if (FAILED(hr))




More information about the wine-cvs mailing list