diff options
Diffstat (limited to 'contrib/expat/examples/elements.c')
-rw-r--r-- | contrib/expat/examples/elements.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/expat/examples/elements.c b/contrib/expat/examples/elements.c index 6b8f855..0ca1abd 100644 --- a/contrib/expat/examples/elements.c +++ b/contrib/expat/examples/elements.c @@ -27,6 +27,8 @@ startElement(void *userData, const char *name, const char **atts) { int i; int *depthPtr = (int *)userData; + (void)atts; + for (i = 0; i < *depthPtr; i++) putchar('\t'); puts(name); @@ -37,6 +39,8 @@ static void XMLCALL endElement(void *userData, const char *name) { int *depthPtr = (int *)userData; + (void)name; + *depthPtr -= 1; } @@ -47,10 +51,13 @@ main(int argc, char *argv[]) XML_Parser parser = XML_ParserCreate(NULL); int done; int depth = 0; + (void)argc; + (void)argv; + XML_SetUserData(parser, &depth); XML_SetElementHandler(parser, startElement, endElement); do { - int len = (int)fread(buf, 1, sizeof(buf), stdin); + size_t len = fread(buf, 1, sizeof(buf), stdin); done = len < sizeof(buf); if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { fprintf(stderr, |