Commit 434ced69 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

windowscodecs: Use the ARRAY_SIZE() macro.

parent 135d458d
......@@ -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))
{
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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))
{
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment