xmllite: Use ARRAY_SIZE macro for reader too.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-02-22 09:01:43 +03:00 committed by Alexandre Julliard
parent 5ec6b8f807
commit 4a78b4da41
3 changed files with 6 additions and 6 deletions

View File

@ -168,7 +168,7 @@ const WCHAR *get_encoding_name(xml_encoding encoding)
xml_encoding get_encoding_from_codepage(UINT codepage)
{
int i;
for (i = 0; i < sizeof(xml_encoding_map)/sizeof(xml_encoding_map[0]); i++)
for (i = 0; i < ARRAY_SIZE(xml_encoding_map); i++)
{
if (xml_encoding_map[i].cp == codepage) return xml_encoding_map[i].enc;
}
@ -749,7 +749,7 @@ xml_encoding parse_encoding_name(const WCHAR *name, int len)
if (!name) return XmlEncoding_Unknown;
min = 0;
max = sizeof(xml_encoding_map)/sizeof(xml_encoding_map[0]) - 1;
max = ARRAY_SIZE(xml_encoding_map) - 1;
while (min <= max)
{
@ -3013,12 +3013,12 @@ static void reader_get_attribute_ns_uri(xmlreader *reader, struct attribute *att
strval_eq(reader, &attr->prefix, &strval_xmlns))
{
*uri = xmlns_uriW;
*len = sizeof(xmlns_uriW)/sizeof(xmlns_uriW[0]) - 1;
*len = ARRAY_SIZE(xmlns_uriW) - 1;
}
else if (strval_eq(reader, &attr->prefix, &strval_xml))
{
*uri = xml_uriW;
*len = sizeof(xml_uriW)/sizeof(xml_uriW[0]) - 1;
*len = ARRAY_SIZE(xml_uriW) - 1;
}
else
{

View File

@ -37,8 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(xmllite);
/* not defined in public headers */
DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a);
#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
static const WCHAR closeelementW[] = {'<','/'};
static const WCHAR closetagW[] = {' ','/','>'};
static const WCHAR closepiW[] = {'?','>'};

View File

@ -23,6 +23,8 @@
#include "wine/heap.h"
#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
static inline void *m_alloc(IMalloc *imalloc, size_t len)
{
if (imalloc)