Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/windowscodecs/bitmap.c | 2 +- dlls/windowscodecs/bmpencode.c | 2 +- dlls/windowscodecs/jpegformat.c | 2 +- dlls/windowscodecs/metadataquery.c | 10 +++++----- dlls/windowscodecs/pngformat.c | 4 ++-- dlls/windowscodecs/tiffformat.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c index f8414962f2..116fd3134a 100644 --- a/dlls/windowscodecs/bitmap.c +++ b/dlls/windowscodecs/bitmap.c @@ -555,7 +555,7 @@ static HRESULT WINAPI IMILBitmapImpl_GetPixelFormat(IMILBitmapSource *iface,
*format = 0;
- for (i = 0; i < sizeof(pixel_fmt_map)/sizeof(pixel_fmt_map[0]); i++) + for (i = 0; i < ARRAY_SIZE(pixel_fmt_map); i++) { if (IsEqualGUID(pixel_fmt_map[i].WIC_format, &This->pixelformat)) { diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index 97f30d7197..aa65675a98 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -529,7 +529,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
if (ppIEncoderOptions) { - hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions); + hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions); if (FAILED(hr)) return hr; }
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index f05663f070..d24af6dc9e 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -1463,7 +1463,7 @@ static HRESULT WINAPI JpegEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
if (ppIEncoderOptions) { - hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions); + hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions); if (FAILED(hr)) { LeaveCriticalSection(&This->lock); diff --git a/dlls/windowscodecs/metadataquery.c b/dlls/windowscodecs/metadataquery.c index e33884881b..2d7c918921 100644 --- a/dlls/windowscodecs/metadataquery.c +++ b/dlls/windowscodecs/metadataquery.c @@ -164,7 +164,7 @@ static VARTYPE map_type(struct string_t *str) { UINT i;
- for (i = 0; i < sizeof(str2vt)/sizeof(str2vt[0]); i++) + for (i = 0; i < ARRAY_SIZE(str2vt); i++) { if (str2vt[i].len == str->len) { @@ -743,7 +743,7 @@ HRESULT WINAPI WICMapGuidToShortName(REFGUID guid, UINT len, WCHAR *name, UINT *
if (!guid) return E_INVALIDARG;
- for (i = 0; i < sizeof(guid2name)/sizeof(guid2name[0]); i++) + for (i = 0; i < ARRAY_SIZE(guid2name); i++) { if (IsEqualGUID(guid, guid2name[i].guid)) { @@ -774,7 +774,7 @@ HRESULT WINAPI WICMapShortNameToGuid(PCWSTR name, GUID *guid)
if (!name || !guid) return E_INVALIDARG;
- for (i = 0; i < sizeof(guid2name)/sizeof(guid2name[0]); i++) + for (i = 0; i < ARRAY_SIZE(guid2name); i++) { if (!lstrcmpiW(name, guid2name[i].name)) { @@ -884,7 +884,7 @@ static const WCHAR *map_shortname_to_schema(const GUID *format, const WCHAR *nam !IsEqualGUID(format, &GUID_MetadataFormatXMPStruct)) return NULL;
- for (i = 0; i < sizeof(name2schema)/sizeof(name2schema[0]); i++) + for (i = 0; i < ARRAY_SIZE(name2schema); i++) { if (!lstrcmpW(name2schema[i].name, name)) return name2schema[i].schema; @@ -909,7 +909,7 @@ HRESULT WINAPI WICMapSchemaToName(REFGUID format, LPWSTR schema, UINT len, WCHAR !IsEqualGUID(format, &GUID_MetadataFormatXMPStruct)) return WINCODEC_ERR_PROPERTYNOTFOUND;
- for (i = 0; i < sizeof(name2schema)/sizeof(name2schema[0]); i++) + for (i = 0; i < ARRAY_SIZE(name2schema); i++) { if (!lstrcmpW(name2schema[i].schema, schema)) { diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index fd0d197bb3..6b13112130 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -1441,7 +1441,7 @@ static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
if (pIEncoderOptions) { - hr = IPropertyBag2_Read(pIEncoderOptions, sizeof(opts)/sizeof(opts[0]), opts, NULL, opt_values, opt_hres); + hr = IPropertyBag2_Read(pIEncoderOptions, ARRAY_SIZE(opts), opts, NULL, opt_values, opt_hres);
if (FAILED(hr)) return hr; @@ -2046,7 +2046,7 @@ static HRESULT WINAPI PngEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
if (ppIEncoderOptions) { - hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions); + hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions); if (FAILED(hr)) { LeaveCriticalSection(&This->lock); diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 2b2f84f859..966ab3eb4b 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -1956,7 +1956,7 @@ static HRESULT WINAPI TiffEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
if (ppIEncoderOptions && SUCCEEDED(hr)) { - hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions); + hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions); if (SUCCEEDED(hr)) { VARIANT v;