From 536bdfde27f2967ac944c83885384a4d3ec52c0b Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 8 Feb 2013 10:34:39 +0100 Subject: [PATCH] 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 6900e87e14b..865d139ccd8 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 caa60804836..86e8b448710 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 5dd7c381e07..f516e4a0449 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))