Eric Pouech : windowscodecs: Use correct integral type.
Alexandre Julliard
julliard at winehq.org
Fri Feb 4 16:08:36 CST 2022
Module: wine
Branch: master
Commit: 0adcd7d1fb38d875cd5a3efe7b040cd2bbff7b2d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0adcd7d1fb38d875cd5a3efe7b040cd2bbff7b2d
Author: Eric Pouech <eric.pouech at gmail.com>
Date: Thu Feb 3 11:49:36 2022 +0100
windowscodecs: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Esme Povirk <esme at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/windowscodecs/bmpdecode.c | 3 ++-
dlls/windowscodecs/ddsformat.c | 3 ++-
dlls/windowscodecs/decoder.c | 2 +-
dlls/windowscodecs/info.c | 26 ++++++++++++++------------
dlls/windowscodecs/wincodecs_private.h | 4 ++--
5 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c
index a01dc78c616..888f41a6138 100644
--- a/dlls/windowscodecs/bmpdecode.c
+++ b/dlls/windowscodecs/bmpdecode.c
@@ -1217,7 +1217,8 @@ void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown)
if (This->read_data_func == BmpFrameDecode_ReadUncompressed)
{
/* RGB or BITFIELDS data */
- ULONG width, height, bytesperrow, datasize;
+ UINT width, height;
+ ULONG bytesperrow, datasize;
IWICBitmapFrameDecode_GetSize(&This->IWICBitmapFrameDecode_iface, &width, &height);
bytesperrow = (((width * This->bitsperpixel)+31)/32)*4;
datasize = bytesperrow * height;
diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c
index f94f6708c2b..5a947a898b9 100644
--- a/dlls/windowscodecs/ddsformat.c
+++ b/dlls/windowscodecs/ddsformat.c
@@ -1331,7 +1331,8 @@ static HRESULT WINAPI DdsDecoder_Dds_GetFrame(IWICDdsDecoder *iface,
LARGE_INTEGER seek;
UINT width, height, depth, block_width, block_height, width_in_blocks, height_in_blocks, size;
UINT frame_width = 0, frame_height = 0, frame_width_in_blocks = 0, frame_height_in_blocks = 0, frame_size = 0;
- UINT bytes_per_block, bytesread, i;
+ UINT bytes_per_block, i;
+ DWORD bytesread;
DdsFrameDecode *frame_decode = NULL;
TRACE("(%p,%u,%u,%u,%p)\n", iface, arrayIndex, mipLevel, sliceIndex, bitmapFrame);
diff --git a/dlls/windowscodecs/decoder.c b/dlls/windowscodecs/decoder.c
index 2c72cdfc1b5..2cd5a2d148f 100644
--- a/dlls/windowscodecs/decoder.c
+++ b/dlls/windowscodecs/decoder.c
@@ -250,7 +250,7 @@ typedef struct {
DWORD frame;
struct decoder_frame decoder_frame;
BOOL metadata_initialized;
- ULONG metadata_count;
+ UINT metadata_count;
struct decoder_block* metadata_blocks;
} CommonDecoderFrame;
diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index cbe8aae572d..7a9ecf52b5a 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -101,8 +101,8 @@ static HRESULT ComponentInfo_GetGUIDValue(HKEY classkey, LPCWSTR value,
return hr;
}
-static HRESULT ComponentInfo_GetDWORDValue(HKEY classkey, LPCWSTR value,
- DWORD *result)
+static HRESULT ComponentInfo_GetUINTValue(HKEY classkey, LPCWSTR value,
+ UINT *result)
{
LONG ret;
DWORD cbdata = sizeof(DWORD);
@@ -111,7 +111,7 @@ static HRESULT ComponentInfo_GetDWORDValue(HKEY classkey, LPCWSTR value,
return E_INVALIDARG;
ret = RegGetValueW(classkey, NULL, value, RRF_RT_DWORD, NULL,
- result, &cbdata);
+ (DWORD *)result, &cbdata);
if (ret == ERROR_FILE_NOT_FOUND)
{
@@ -179,7 +179,7 @@ static HRESULT ComponentInfo_GetGuidList(HKEY classkey, LPCWSTR subkeyname,
}
else
{
- ret = RegQueryInfoKeyW(subkey, NULL, NULL, NULL, actual_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret = RegQueryInfoKeyW(subkey, NULL, NULL, NULL, (DWORD *)actual_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
if (ret != ERROR_SUCCESS)
hr = HRESULT_FROM_WIN32(ret);
}
@@ -552,7 +552,8 @@ static const IWICBitmapDecoderInfoVtbl BitmapDecoderInfo_Vtbl = {
static void read_bitmap_patterns(BitmapDecoderInfo *info)
{
- UINT pattern_count=0, patterns_size=0;
+ DWORD pattern_count=0;
+ UINT patterns_size=0;
WCHAR subkeyname[11];
LONG res;
HKEY patternskey, patternkey;
@@ -1353,7 +1354,7 @@ static HRESULT WINAPI PixelFormatInfo_GetBitsPerPixel(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%p)\n", iface, puiBitsPerPixel);
- return ComponentInfo_GetDWORDValue(This->classkey, L"BitLength", puiBitsPerPixel);
+ return ComponentInfo_GetUINTValue(This->classkey, L"BitLength", puiBitsPerPixel);
}
static HRESULT WINAPI PixelFormatInfo_GetChannelCount(IWICPixelFormatInfo2 *iface,
@@ -1363,7 +1364,7 @@ static HRESULT WINAPI PixelFormatInfo_GetChannelCount(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%p)\n", iface, puiChannelCount);
- return ComponentInfo_GetDWORDValue(This->classkey, L"ChannelCount", puiChannelCount);
+ return ComponentInfo_GetUINTValue(This->classkey, L"ChannelCount", puiChannelCount);
}
static HRESULT WINAPI PixelFormatInfo_GetChannelMask(IWICPixelFormatInfo2 *iface,
@@ -1413,7 +1414,7 @@ static HRESULT WINAPI PixelFormatInfo_SupportsTransparency(IWICPixelFormatInfo2
TRACE("(%p,%p)\n", iface, pfSupportsTransparency);
- return ComponentInfo_GetDWORDValue(This->classkey, L"SupportsTransparency", (DWORD*)pfSupportsTransparency);
+ return ComponentInfo_GetUINTValue(This->classkey, L"SupportsTransparency", (UINT *)pfSupportsTransparency);
}
static HRESULT WINAPI PixelFormatInfo_GetNumericRepresentation(IWICPixelFormatInfo2 *iface,
@@ -1423,7 +1424,7 @@ static HRESULT WINAPI PixelFormatInfo_GetNumericRepresentation(IWICPixelFormatIn
TRACE("(%p,%p)\n", iface, pNumericRepresentation);
- return ComponentInfo_GetDWORDValue(This->classkey, L"NumericRepresentation", pNumericRepresentation);
+ return ComponentInfo_GetUINTValue(This->classkey, L"NumericRepresentation", pNumericRepresentation);
}
static const IWICPixelFormatInfo2Vtbl PixelFormatInfo_Vtbl = {
@@ -1682,7 +1683,7 @@ static HRESULT WINAPI MetadataReaderInfo_DoesRequireFullStream(IWICMetadataReade
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, param);
- return ComponentInfo_GetDWORDValue(This->classkey, L"RequiresFullStream", (DWORD *)param);
+ return ComponentInfo_GetUINTValue(This->classkey, L"RequiresFullStream", (UINT *)param);
}
static HRESULT WINAPI MetadataReaderInfo_DoesSupportPadding(IWICMetadataReaderInfo *iface,
@@ -1690,7 +1691,7 @@ static HRESULT WINAPI MetadataReaderInfo_DoesSupportPadding(IWICMetadataReaderIn
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, param);
- return ComponentInfo_GetDWORDValue(This->classkey, L"SupportsPadding", (DWORD *)param);
+ return ComponentInfo_GetUINTValue(This->classkey, L"SupportsPadding", (UINT *)param);
}
static HRESULT WINAPI MetadataReaderInfo_DoesRequireFixedSize(IWICMetadataReaderInfo *iface,
@@ -1826,7 +1827,8 @@ static const IWICMetadataReaderInfoVtbl MetadataReaderInfo_Vtbl = {
static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_guid,
struct metadata_container *container)
{
- UINT pattern_count=0, patterns_size=0;
+ DWORD pattern_count=0;
+ UINT patterns_size=0;
WCHAR subkeyname[11], guidkeyname[39];
LONG res;
HKEY containers_key, guid_key, patternkey;
diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h
index 5fb7720781c..72227cf0cd2 100644
--- a/dlls/windowscodecs/wincodecs_private.h
+++ b/dlls/windowscodecs/wincodecs_private.h
@@ -265,7 +265,7 @@ struct decoder_info
struct decoder_stat
{
DWORD flags;
- DWORD frame_count;
+ UINT frame_count;
};
struct decoder_frame
@@ -361,7 +361,7 @@ struct encoder_frame
UINT bpp;
BOOL indexed;
DOUBLE dpix, dpiy;
- DWORD num_colors;
+ UINT num_colors;
WICColor palette[256];
/* encoder options */
BOOL interlace;
More information about the wine-cvs
mailing list