#include <proto/expat.h>
#endif
+#ifdef XML_LARGE_SIZE
+#define XML_FMT_INT_MOD "ll"
+#else
+#define XML_FMT_INT_MOD "l"
+#endif
static XML_Parser parser;
{
char buffer[1024];
sprintf(buffer,
- "\n %s (line %d, offset %d)\n reported from %s, line %d",
+ "\n %s (line %" XML_FMT_INT_MOD "u, offset %"\
+ XML_FMT_INT_MOD "u)\n reported from %s, line %d",
XML_ErrorString(XML_GetErrorCode(parser)),
XML_GetCurrentLineNumber(parser),
XML_GetCurrentColumnNumber(parser),
"<tag>\n"
"\n"
"\n</tag>";
- int lineno;
+ XML_Size lineno;
if (XML_Parse(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
lineno = XML_GetCurrentLineNumber(parser);
if (lineno != 4) {
char buffer[100];
- sprintf(buffer, "expected 4 lines, saw %d", lineno);
+ sprintf(buffer,
+ "expected 4 lines, saw %" XML_FMT_INT_MOD "u", lineno);
fail(buffer);
}
}
START_TEST(test_column_number_after_parse)
{
char *text = "<tag></tag>";
- int colno;
+ XML_Size colno;
if (XML_Parse(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
colno = XML_GetCurrentColumnNumber(parser);
if (colno != 11) {
char buffer[100];
- sprintf(buffer, "expected 11 columns, saw %d", colno);
+ sprintf(buffer,
+ "expected 11 columns, saw %" XML_FMT_INT_MOD "u", colno);
fail(buffer);
}
}
CharData *storage = (CharData *) userData;
char buffer[100];
- sprintf(buffer, "<%s> at col:%d line:%d\n", name,
+ sprintf(buffer,
+ "<%s> at col:%" XML_FMT_INT_MOD "u line:%"\
+ XML_FMT_INT_MOD "u\n", name,
XML_GetCurrentColumnNumber(parser),
XML_GetCurrentLineNumber(parser));
CharData_AppendString(storage, buffer);
CharData *storage = (CharData *) userData;
char buffer[100];
- sprintf(buffer, "</%s> at col:%d line:%d\n", name,
+ sprintf(buffer,
+ "</%s> at col:%" XML_FMT_INT_MOD "u line:%"\
+ XML_FMT_INT_MOD "u\n", name,
XML_GetCurrentColumnNumber(parser),
XML_GetCurrentLineNumber(parser));
CharData_AppendString(storage, buffer);
"<a>\n"
" <b>\n"
" </a>"; /* missing </b> */
- int lineno;
+ XML_Size lineno;
if (XML_Parse(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR)
fail("Expected a parse error");
lineno = XML_GetCurrentLineNumber(parser);
if (lineno != 3) {
char buffer[100];
- sprintf(buffer, "expected 3 lines, saw %d", lineno);
+ sprintf(buffer, "expected 3 lines, saw %" XML_FMT_INT_MOD "u", lineno);
fail(buffer);
}
}
"<a>\n"
" <b>\n"
" </a>"; /* missing </b> */
- int colno;
+ XML_Size colno;
if (XML_Parse(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR)
fail("Expected a parse error");
colno = XML_GetCurrentColumnNumber(parser);
if (colno != 4) {
char buffer[100];
- sprintf(buffer, "expected 4 columns, saw %d", colno);
+ sprintf(buffer,
+ "expected 4 columns, saw %" XML_FMT_INT_MOD "u", colno);
fail(buffer);
}
}