From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dx9_36/d3dx9_private.h | 3 ++- dlls/d3dx9_36/mesh.c | 2 +- dlls/d3dx9_36/shader.c | 21 +++++++++++---------- dlls/d3dx9_36/surface.c | 6 +++--- dlls/d3dx9_36/volume.c | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index 44bcda0271a..7ee754b104a 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -230,7 +230,8 @@ static inline BOOL is_param_type_sampler(D3DXPARAMETER_TYPE type) /* Returns the smallest power of 2 which is greater than or equal to num */ static inline uint32_t make_pow2(uint32_t num) { - uint32_t index; + DWORD index; + return BitScanReverse(&index, num - 1) ? 1u << (index + 1) : 1; }
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 6cfe97492f3..f74fba6e424 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -54,7 +54,7 @@ struct d3dx9_mesh IDirect3DVertexBuffer9 *vertex_buffer; IDirect3DIndexBuffer9 *index_buffer; DWORD *attrib_buffer; - int attrib_buffer_lock_count; + LONG attrib_buffer_lock_count; DWORD attrib_table_size; D3DXATTRIBUTERANGE *attrib_table; }; diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 2241455898e..eae01674c0a 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -281,7 +281,7 @@ static HRESULT WINAPI d3dx_include_from_file_open(ID3DXInclude *iface, D3DXINCLU if(!buffer) goto error; *buffer = pathname; - if(!ReadFile(file, buffer + 1, size, bytes, NULL)) + if (!ReadFile(file, buffer + 1, size, (DWORD *)bytes, NULL)) goto error;
*data = buffer + 1; @@ -339,11 +339,11 @@ HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages) { - const void *buffer; - DWORD len; - HRESULT hr; struct d3dx_include_from_file include_from_file; + const void *buffer; + unsigned int len; char *filename_a; + HRESULT hr;
TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n", debugstr_w(filename), defines, include, flags, shader, error_messages); @@ -475,11 +475,12 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table) { - const void *buffer; - DWORD len, filename_len; - HRESULT hr; struct d3dx_include_from_file include_from_file; + unsigned int filename_len; + const void *buffer; char *filename_a; + HRESULT hr; + UINT len;
TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, " "flags %#x, shader %p, error_messages %p, constant_table %p.\n", @@ -603,11 +604,11 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileA(const char *filename, const D3DXMAC HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages) { - const void *buffer; - DWORD len; - HRESULT hr; struct d3dx_include_from_file include_from_file; + const void *buffer; char *filename_a; + HRESULT hr; + UINT len;
TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n", debugstr_w(filename), defines, include, shader, error_messages); diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 2ca6f093b55..39733d3ef7e 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1391,7 +1391,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileW(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const WCHAR *src_file, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) { - UINT data_size; + DWORD data_size; void *data; HRESULT hr;
@@ -1417,7 +1417,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) { - UINT data_size; + DWORD data_size; HRSRC resinfo; void *data;
@@ -1445,7 +1445,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const WCHAR *resource, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) { - UINT data_size; + DWORD data_size; HRSRC resinfo; void *data;
diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index 93afaa16b10..d601650cff5 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -60,9 +60,9 @@ HRESULT WINAPI D3DXLoadVolumeFromFileW(IDirect3DVolume9 *dst_volume, D3DCOLOR color_key, D3DXIMAGE_INFO *info) { + DWORD data_size; HRESULT hr; void *data; - UINT data_size;
TRACE("(%p, %p, %p, %s, %p, %#x, %#x, %p)\n", dst_volume, dst_palette, dst_box, debugstr_w(filename), src_box,