[PATCH] ddraw: Build without -DWINE_NO_LONG_TYPES.

Henri Verbeet hverbeet at gmail.com
Fri Apr 15 10:55:10 CDT 2022


Some comments below, mostly for what it's worth; I don't think any of
this makes things worse than they were before.

On Thu, 14 Apr 2022 at 15:28, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> @@ -2496,7 +2496,7 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
>              callback_sd.u1.lPitch = (callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount / 8) * mode.width;
>              callback_sd.u1.lPitch = (callback_sd.u1.lPitch + 3) & ~3;
>
> -            TRACE("Enumerating %dx%dx%d @%d\n", callback_sd.dwWidth, callback_sd.dwHeight, callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
> +            TRACE("Enumerating %ldx%ldx%ld @%ld\n", callback_sd.dwWidth, callback_sd.dwHeight, callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
>                callback_sd.u2.dwRefreshRate);

Ideally we'd use %u to print unsigned values. Ddraw has a couple of
other instances of that issue as well.

> @@ -1350,7 +1350,7 @@ static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIX
>
>      *D3DMatHandle = h + 1;
>
> -    TRACE(" returning matrix handle %d\n", *D3DMatHandle);
> +    TRACE(" returning matrix handle %lx\n", *D3DMatHandle);

%#lx, preferably. Like %d, above, this is hardly the only place in
ddraw that does this.

> @@ -1579,7 +1579,7 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons
>      RECT src_rect, dst_rect;
>      float scale_x, scale_y;
>      const RECT *clip_rect;
> -    UINT clip_list_size;
> +    DWORD clip_list_size;

I'd prefer this change (and the one in
viewport_alloc_active_light_index()) as a separate patch.

> @@ -469,7 +469,7 @@ enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *DDPix
>                      return WINED3DFMT_L8_UNORM;
>
>                  default:
> -                    WARN("Unknown luminance-only bit depth 0x%x.\n", DDPixelFormat->u1.dwLuminanceBitCount);
> +                    WARN("Unknown luminance-only bit depth 0x%lx.\n", DDPixelFormat->u1.dwLuminanceBitCount);

Printing a bit count with 0x%lx is a bit weird; %u seems fine for this.



More information about the wine-devel mailing list