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

Alexandre Julliard julliard at winehq.org
Fri Feb 8 14:13:45 CST 2013


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Feb  8 10:34:39 2013 +0100

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

---

 dlls/d3dcompiler_43/blob.c       |    3 ---
 dlls/d3dcompiler_43/compiler.c   |   12 +++---------
 dlls/d3dcompiler_43/reflection.c |    6 ------
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/dlls/d3dcompiler_43/blob.c b/dlls/d3dcompiler_43/blob.c
index 6900e87..865d139 100644
--- a/dlls/d3dcompiler_43/blob.c
+++ b/dlls/d3dcompiler_43/blob.c
@@ -148,10 +148,7 @@ HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate D3D blob object memory\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = d3dcompiler_blob_init(object, data_size);
     if (FAILED(hr))
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
index caa6080..86e8b44 100644
--- a/dlls/d3dcompiler_43/compiler.c
+++ b/dlls/d3dcompiler_43/compiler.c
@@ -84,10 +84,8 @@ static void wpp_write_message(const char *fmt, va_list args)
     {
         wpp_messages = HeapAlloc(GetProcessHeap(), 0, MESSAGEBUFFER_INITIAL_SIZE);
         if(wpp_messages == NULL)
-        {
-            ERR("Error allocating memory for parser messages\n");
             return;
-        }
+
         wpp_messages_capacity = MESSAGEBUFFER_INITIAL_SIZE;
     }
 
@@ -189,10 +187,8 @@ static void *wpp_open_mem(const char *filename, int type)
     if(current_include == NULL) return NULL;
     desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc));
     if(!desc)
-    {
-        ERR("Error allocating memory\n");
         return NULL;
-    }
+
     hr = ID3DInclude_Open(current_include,
                           type ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM,
                           filename, parent_include, (LPCVOID *)&desc->buffer,
@@ -275,10 +271,8 @@ static void wpp_write_mem(const char *buffer, unsigned int len)
     {
         wpp_output = HeapAlloc(GetProcessHeap(), 0, BUFFER_INITIAL_CAPACITY);
         if(!wpp_output)
-        {
-            ERR("Error allocating memory\n");
             return;
-        }
+
         wpp_output_capacity = BUFFER_INITIAL_CAPACITY;
     }
     if(len > wpp_output_capacity - wpp_output_size)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 5dd7c38..f516e4a 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -1282,10 +1282,7 @@ static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3d
 
     type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
     if (!type)
-    {
-        ERR("Failed to allocate type memory.\n");
         return NULL;
-    }
 
     type->ID3D11ShaderReflectionType_iface.lpVtbl = &d3dcompiler_shader_reflection_type_vtbl;
     type->id = offset;
@@ -1833,10 +1830,7 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
-    {
-        ERR("Failed to allocate D3D compiler shader reflection object memory\n");
         return E_OUTOFMEMORY;
-    }
 
     hr = d3dcompiler_shader_reflection_init(object, data, data_size);
     if (FAILED(hr))




More information about the wine-cvs mailing list