Commit 4a78b4da authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite: Use ARRAY_SIZE macro for reader too.

parent 5ec6b8f8
......@@ -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
{
......
......@@ -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[] = {'?','>'};
......
......@@ -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)
......
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