[PATCH 2/3] dlls/d3dx9_36: use correct integral type

Eric Pouech eric.pouech at gmail.com
Wed Apr 13 02:10:44 CDT 2022


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/d3dx9_36/d3dx9_private.h |    2 +-
 dlls/d3dx9_36/mesh.c          |    2 +-
 dlls/d3dx9_36/shader.c        |    9 +++++----
 dlls/d3dx9_36/surface.c       |    6 +++---
 dlls/d3dx9_36/volume.c        |    2 +-
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
index 6972c1d0ce0f..713b5c65653b 100644
--- a/dlls/d3dx9_36/d3dx9_private.h
+++ b/dlls/d3dx9_36/d3dx9_private.h
@@ -230,7 +230,7 @@ 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 6cfe97492f3e..f74fba6e4240 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 2241455898ea..c534887ec7ee 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;
@@ -340,7 +340,7 @@ HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACR
         ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 {
     const void *buffer;
-    DWORD len;
+    UINT len;
     HRESULT hr;
     struct d3dx_include_from_file include_from_file;
     char *filename_a;
@@ -476,7 +476,8 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO
         ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
 {
     const void *buffer;
-    DWORD len, filename_len;
+    UINT len;
+    DWORD filename_len;
     HRESULT hr;
     struct d3dx_include_from_file include_from_file;
     char *filename_a;
@@ -604,7 +605,7 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMA
         ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 {
     const void *buffer;
-    DWORD len;
+    UINT len;
     HRESULT hr;
     struct d3dx_include_from_file include_from_file;
     char *filename_a;
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 2ca6f093b558..39733d3ef7eb 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 93afaa16b10d..5d1319f8df39 100644
--- a/dlls/d3dx9_36/volume.c
+++ b/dlls/d3dx9_36/volume.c
@@ -62,7 +62,7 @@ HRESULT WINAPI D3DXLoadVolumeFromFileW(IDirect3DVolume9 *dst_volume,
 {
     HRESULT hr;
     void *data;
-    UINT data_size;
+    DWORD data_size;
 
     TRACE("(%p, %p, %p, %s, %p, %#x, %#x, %p)\n",
             dst_volume, dst_palette, dst_box, debugstr_w(filename), src_box,




More information about the wine-devel mailing list