From: Eric Pouech eric.pouech@gmail.com
Note: choice of UINT is consistent with internal field's type in struct wined3d_texture and parameter in wined3d_texture_create(); but isn't with adapter_create_texture() methods which rather use unsigned int.
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/texture.c | 8 ++++---- include/wine/wined3d.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 641bf0355eb..436f61acf64 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1734,10 +1734,10 @@ void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture, width, height, row_pitch, slice_pitch); }
-DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) +UINT CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, UINT lod) { struct wined3d_resource *resource; - DWORD old = texture->lod; + UINT old = texture->lod;
TRACE("texture %p, lod %u.\n", texture, lod);
@@ -1771,14 +1771,14 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) return old; }
-DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture) +UINT CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture) { TRACE("texture %p, returning %u.\n", texture, texture->lod);
return texture->lod; }
-DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture) +UINT CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture) { TRACE("texture %p, returning %u.\n", texture, texture->level_count);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 1660b424441..8178ce60d75 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2846,8 +2846,8 @@ HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const stru struct wined3d_texture * __cdecl wined3d_texture_from_resource(struct wined3d_resource *resource); ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc); -DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture); -DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture); +UINT __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture); +UINT __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_get_overlay_position(const struct wined3d_texture *texture, unsigned int sub_resource_idx, LONG *x, LONG *y); void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture); @@ -2861,7 +2861,7 @@ ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc); HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture, uint32_t flags, const struct wined3d_color_key *color_key); -DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod); +UINT __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, UINT lod); HRESULT __cdecl wined3d_texture_set_overlay_position(struct wined3d_texture *texture, unsigned int sub_resource_idx, LONG x, LONG y); void __cdecl wined3d_texture_set_sub_resource_parent(struct wined3d_texture *texture,
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 436f61acf64..8104ed9b8c0 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -138,7 +138,7 @@ GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) return GL_BACK; }
-static DWORD wined3d_resource_access_from_location(uint32_t location) +static uint32_t wined3d_resource_access_from_location(uint32_t location) { switch (location) { @@ -796,7 +796,7 @@ BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
if (WARN_ON(d3d)) { - DWORD required_access = wined3d_resource_access_from_location(location); + uint32_t required_access = wined3d_resource_access_from_location(location); if ((texture->resource.access & required_access) != required_access) WARN("Operation requires %#x access, but texture only has %#x.\n", required_access, texture->resource.access);
From: Eric Pouech eric.pouech@gmail.com
Note: didn't change the x/y overlay positions' type as they're part of ddraw's surface interface. --- dlls/wined3d/texture.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 8104ed9b8c0..6c162caddb2 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -19,7 +19,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES /* temporary */
#include "wined3d_private.h"
@@ -429,7 +428,7 @@ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_cont &src_staging_texture); if (FAILED(hr)) { - ERR("Failed to create staging texture, hr %#x.\n", hr); + ERR("Failed to create staging texture, hr %#lx.\n", hr); goto done; }
@@ -468,7 +467,7 @@ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_cont &dst_texture); if (FAILED(hr)) { - ERR("Failed to create staging texture, hr %#x.\n", hr); + ERR("Failed to create staging texture, hr %#lx.\n", hr); goto done; }
@@ -1177,7 +1176,7 @@ static void wined3d_texture_create_dc(void *object) DeleteDC(desc.hDeviceDc); if (status) { - WARN("Failed to create DC, status %#x.\n", status); + WARN("Failed to create DC, status %#lx.\n", status); return; }
@@ -1219,7 +1218,7 @@ static void wined3d_texture_destroy_dc(void *object) destroy_desc.hDc = dc_info->dc; destroy_desc.hBitmap = dc_info->bitmap; if ((status = D3DKMTDestroyDCFromMemory(&destroy_desc))) - ERR("Failed to destroy dc, status %#x.\n", status); + ERR("Failed to destroy dc, status %#lx.\n", status); dc_info->dc = NULL; dc_info->bitmap = NULL;
@@ -3988,7 +3987,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc && desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !once++) ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n");
- WARN("Failed to initialize resource, returning %#x\n", hr); + WARN("Failed to initialize resource, returning %#lx\n", hr); return hr; } wined3d_resource_update_draw_binding(&texture->resource); @@ -4087,7 +4086,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc if (FAILED(hr = device_parent->ops->texture_sub_resource_created(device_parent, desc->resource_type, texture, i, &sub_resource->parent, &sub_resource->parent_ops))) { - WARN("Failed to create sub-resource parent, hr %#x.\n", hr); + WARN("Failed to create sub-resource parent, hr %#lx.\n", hr); sub_resource->parent = NULL; wined3d_texture_cleanup_sync(texture); return hr; @@ -4199,7 +4198,7 @@ HRESULT CDECL wined3d_texture_get_overlay_position(const struct wined3d_texture *x = overlay->dst_rect.left; *y = overlay->dst_rect.top;
- TRACE("Returning position %d, %d.\n", *x, *y); + TRACE("Returning position %ld, %ld.\n", *x, *y);
return WINED3D_OK; } @@ -4210,7 +4209,7 @@ HRESULT CDECL wined3d_texture_set_overlay_position(struct wined3d_texture *textu struct wined3d_overlay_info *overlay; LONG w, h;
- TRACE("texture %p, sub_resource_idx %u, x %d, y %d.\n", texture, sub_resource_idx, x, y); + TRACE("texture %p, sub_resource_idx %u, x %ld, y %ld.\n", texture, sub_resource_idx, x, y);
if (!(texture->resource.usage & WINED3DUSAGE_OVERLAY) || !wined3d_texture_validate_sub_resource_idx(texture, sub_resource_idx)) @@ -6224,7 +6223,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit if (FAILED(hr = wined3d_texture_create(device, &desc, 1, 1, 0, NULL, NULL, &wined3d_null_parent_ops, &staging_texture))) { - ERR("Failed to create staging texture, hr %#x.\n", hr); + ERR("Failed to create staging texture, hr %#lx.\n", hr); return dst_location; }
@@ -6839,7 +6838,7 @@ static void vk_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_dev unsigned int i;
TRACE("blitter %p, device %p, rt_count %u, fb %p, rect_count %u, clear_rects %p, " - "draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#x.\n", + "draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#lx.\n", blitter, device, rt_count, fb, rect_count, clear_rects, wine_dbgstr_rect(draw_rect), flags, debug_color(colour), depth, stencil);
From patch 1/3:
Note: choice of UINT is consistent with internal field's type in struct wined3d_texture and parameter in wined3d_texture_create(); but isn't with adapter_create_texture() methods which rather use unsigned int.
Yes, but we'd rather replace UINT with unsigned int anyway. [Note of course it doesn't have to be done all at once unless we're dealing with pointer types. Implicit casting from e.g. DWORD to unsigned int is fine.]
From patch 3/3:
TRACE("blitter %p, device %p, rt_count %u, fb %p, rect_count %u, clear_rects %p, "
"draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#x.\n",
"draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#lx.\n",
We can change the stencil argument to blitter_clear().