diff options
| author | William M. Brack <wbrack@src.gnome.org> | 2003-08-05 15:52:22 +0000 |
|---|---|---|
| committer | William M. Brack <wbrack@src.gnome.org> | 2003-08-05 15:52:22 +0000 |
| commit | c193956ee1c3b229556301cf09f6ff1b6eb9cb70 (patch) | |
| tree | 5f0751c73fbcb2bf0d1e1860e0f23a31102d9aae | |
| parent | c758c229b4f9669ff61a7ce1af3e4f74b11e2cb0 (diff) | |
| download | android_external_libxml2-c193956ee1c3b229556301cf09f6ff1b6eb9cb70.tar.gz android_external_libxml2-c193956ee1c3b229556301cf09f6ff1b6eb9cb70.tar.bz2 android_external_libxml2-c193956ee1c3b229556301cf09f6ff1b6eb9cb70.zip | |
small changes to syntax to get rid of compiler warnings. No changes to
* error.c HTMLparser.c testC14N.c testHTML.c testURI.c
xmlcatalog.c xmlmemory.c xmlreader.c xmlschemastypes.c
python/libxml.c include/libxml/xmlmemory.h: small changes
to syntax to get rid of compiler warnings. No changes
to logic.
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | HTMLparser.c | 4 | ||||
| -rw-r--r-- | error.c | 17 | ||||
| -rw-r--r-- | include/libxml/xmlmemory.h | 7 | ||||
| -rw-r--r-- | python/libxml.c | 6 | ||||
| -rw-r--r-- | testC14N.c | 8 | ||||
| -rw-r--r-- | testHTML.c | 2 | ||||
| -rw-r--r-- | testURI.c | 4 | ||||
| -rw-r--r-- | xmlcatalog.c | 10 | ||||
| -rw-r--r-- | xmlmemory.c | 4 | ||||
| -rw-r--r-- | xmlreader.c | 16 | ||||
| -rw-r--r-- | xmlschemastypes.c | 6 |
12 files changed, 43 insertions, 49 deletions
@@ -1,3 +1,11 @@ +Tue Aug 5 23:51:21 HKT 2003 William Brack <wbrack@mmm.com.hk> + + * error.c HTMLparser.c testC14N.c testHTML.c testURI.c + xmlcatalog.c xmlmemory.c xmlreader.c xmlschemastypes.c + python/libxml.c include/libxml/xmlmemory.h: small changes + to syntax to get rid of compiler warnings. No changes + to logic. + Mon Aug 4 22:40:54 CEST 2003 Daniel Veillard <daniel@veillard.com> * doc/libxml2-api.xml doc/html/*: rebuilt the API and docs. diff --git a/HTMLparser.c b/HTMLparser.c index d45eac26..0aa00411 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -4331,7 +4331,7 @@ htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding ATTRIBUTE_UNUSED) { */ static int htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first, - xmlChar next, xmlChar third, int comment) { + xmlChar next, xmlChar third, int iscomment) { int base, len; htmlParserInputPtr in; const xmlChar *buf; @@ -4354,7 +4354,7 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first, if (third) len -= 2; else if (next) len --; for (;base < len;base++) { - if (!incomment && (base + 4 < len) && !comment) { + if (!incomment && (base + 4 < len) && !iscomment) { if ((buf[base] == '<') && (buf[base + 1] == '!') && (buf[base + 2] == '-') && (buf[base + 3] == '-')) { incomment = 1; @@ -11,6 +11,7 @@ #include <stdarg.h> #include <libxml/parser.h> +#include <libxml/parserInternals.h> /* for char constants */ #include <libxml/xmlerror.h> #include <libxml/xmlmemory.h> #include <libxml/globals.h> @@ -149,7 +150,7 @@ xmlParserPrintFileInfo(xmlParserInputPtr input) { void xmlParserPrintFileContext(xmlParserInputPtr input) { const xmlChar *cur, *base; - int n, col; + unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ xmlChar content[81]; /* space for 80 chars + line terminator */ xmlChar *ctnt; @@ -157,21 +158,23 @@ xmlParserPrintFileContext(xmlParserInputPtr input) { cur = input->cur; base = input->base; /* skip backwards over any end-of-lines */ - while ((cur > base) && ((*cur == '\n') || (*cur == '\r'))) { + while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) { cur--; } n = 0; /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < sizeof(content)-1) && (cur > base) && (*cur != '\n') && (*cur != '\r')) + while ((n++ < (sizeof(content)-1)) && (cur > base) && + (*(cur) != '\n') && (*(cur) != '\r')) cur--; - if ((*cur == '\n') || (*cur == '\r')) cur++; + if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; /* calculate the error position in terms of the current position */ col = input->cur - cur; /* search forward for end-of-line (to max buff size) */ n = 0; ctnt = content; /* copy selected text to our buffer */ - while ((*cur != 0) && (*cur != '\n') && (*cur != '\r') && (n < sizeof(content)-1)) { + while ((*cur != 0) && (*(cur) != '\n') && + (*(cur) != '\r') && (n < sizeof(content)-1)) { *ctnt++ = *cur++; n++; } @@ -183,8 +186,8 @@ xmlParserPrintFileContext(xmlParserInputPtr input) { ctnt = content; /* (leave buffer space for pointer + line terminator) */ while ((n<col) && (n++ < sizeof(content)-2) && (*ctnt != 0)) { - if (*ctnt!='\t') - *ctnt = ' '; + if (*(ctnt) != '\t') + *(ctnt) = ' '; *ctnt++; } *ctnt++ = '^'; diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h index f35ffffb..16ec60fd 100644 --- a/include/libxml/xmlmemory.h +++ b/include/libxml/xmlmemory.h @@ -121,7 +121,7 @@ int xmlGcMemGet (xmlFreeFunc *freeFunc, int xmlInitMemory (void); /* - * Those are specific to the XML debug memory wrapper. + * These are specific to the XML debug memory wrapper. */ int xmlMemUsed (void); void xmlMemDisplay (FILE *fp); @@ -131,6 +131,11 @@ void * xmlMemMalloc (size_t size); void * xmlMemRealloc (void *ptr,size_t size); void xmlMemFree (void *ptr); char * xmlMemoryStrdup (const char *str); +void * xmlMallocLoc (size_t size, const char *file, int line); +void * xmlReallocLoc (void *ptr, size_t size, const char *file, int line); +void * xmlMallocAtomicLoc (size_t size, const char *file, int line); +char * xmlMemStrdupLoc (const char *str, const char *file, int line); + #ifdef DEBUG_MEMORY_LOCATION /** diff --git a/python/libxml.c b/python/libxml.c index ea0aed74..5edc0396 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -469,7 +469,7 @@ pythonExternalEntityLoader(const char *URL, const char *ID, if (result == NULL) { Py_DECREF(ret); } else if (URL != NULL) { - result->filename = xmlStrdup((const xmlChar *)URL); + result->filename = (char *) xmlStrdup((const xmlChar *)URL); result->directory = xmlParserGetDirectory((const char *) URL); } } @@ -2690,7 +2690,7 @@ libxml_xmlRelaxNGSetValidErrors(ATTRIBUTE_UNUSED PyObject * self, PyObject * arg #endif ctxt = PyrelaxNgValidCtxt_Get(pyobj_ctx); - if (xmlRelaxNGGetValidErrors(ctxt, NULL, NULL, &pyCtxt) == -1) + if (xmlRelaxNGGetValidErrors(ctxt, NULL, NULL, (void **) &pyCtxt) == -1) { py_retval = libxml_intWrap(-1); return(py_retval); @@ -2736,7 +2736,7 @@ libxml_xmlRelaxNGFreeValidCtxt(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) return(NULL); ctxt = (xmlRelaxNGValidCtxtPtr) PyrelaxNgValidCtxt_Get(pyobj_ctxt); - if (xmlRelaxNGGetValidErrors(ctxt, NULL, NULL, &pyCtxt) == 0) + if (xmlRelaxNGGetValidErrors(ctxt, NULL, NULL, (void **) &pyCtxt) == 0) { if (pyCtxt != NULL) { @@ -46,7 +46,7 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename); static xmlChar **parse_list(xmlChar *str); -static void print_xpath_nodes(xmlNodeSetPtr nodes); +/* static void print_xpath_nodes(xmlNodeSetPtr nodes); */ static int test_c14n(const char* xml_filename, int with_comments, int exclusive, @@ -313,6 +313,7 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { return(xpath); } +/* static void print_xpath_nodes(xmlNodeSetPtr nodes) { xmlNodePtr cur; @@ -343,10 +344,7 @@ print_xpath_nodes(xmlNodeSetPtr nodes) { } } } - - - - +*/ #else #include <stdio.h> @@ -376,7 +376,7 @@ startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar outlen = sizeof output - 1; htmlEncodeEntities(output, &outlen, att, &attlen, '\''); output[outlen] = 0; - fprintf(stdout, "%s", output); + fprintf(stdout, "%s", (char *) output); att += attlen; } fprintf(stdout, "'"); @@ -35,7 +35,7 @@ static void handleURI(const char *str) { if (escape != 0) { parsed = xmlSaveUri(uri); res = xmlURIEscape(parsed); - printf("%s\n", res); + printf("%s\n", (char *) res); } else { xmlPrintURI(stdout, uri); @@ -45,7 +45,7 @@ static void handleURI(const char *str) { } else { res = xmlBuildURI((xmlChar *)str, (xmlChar *) base); if (res != NULL) { - printf("%s\n", res); + printf("%s\n", (char *) res); } else printf("::ERROR::\n"); diff --git a/xmlcatalog.c b/xmlcatalog.c index 1830f5e2..0e320fe5 100644 --- a/xmlcatalog.c +++ b/xmlcatalog.c @@ -194,7 +194,7 @@ static void usershell(void) { if (ans == NULL) { printf("No entry for PUBLIC %s\n", argv[0]); } else { - printf("%s\n", ans); + printf("%s\n", (char *) ans); xmlFree(ans); } } @@ -206,7 +206,7 @@ static void usershell(void) { if (ans == NULL) { printf("No entry for SYSTEM %s\n", argv[0]); } else { - printf("%s\n", ans); + printf("%s\n", (char *) ans); xmlFree(ans); } } @@ -256,7 +256,7 @@ static void usershell(void) { if (ans == NULL) { printf("Resolver failed to find an answer\n"); } else { - printf("%s\n", ans); + printf("%s\n", (char *) ans); xmlFree(ans); } } @@ -539,7 +539,7 @@ int main(int argc, char **argv) { printf("No entry for PUBLIC %s\n", argv[i]); exit_value = 4; } else { - printf("%s\n", ans); + printf("%s\n", (char *) ans); xmlFree(ans); } } else { @@ -549,7 +549,7 @@ int main(int argc, char **argv) { printf("No entry for SYSTEM %s\n", argv[i]); exit_value = 4; } else { - printf("%s\n", ans); + printf("%s\n", (char *) ans); xmlFree(ans); } } diff --git a/xmlmemory.c b/xmlmemory.c index 38cb6599..b4651feb 100644 --- a/xmlmemory.c +++ b/xmlmemory.c @@ -44,10 +44,6 @@ #include <libxml/xmlerror.h> void xmlMallocBreakpoint(void); -void * xmlMemMalloc(size_t size); -void * xmlMemRealloc(void *ptr,size_t size); -void xmlMemFree(void *ptr); -char * xmlMemoryStrdup(const char *str); /************************************************************************ * * diff --git a/xmlreader.c b/xmlreader.c index 2348af0e..cdc4f9ec 100644 --- a/xmlreader.c +++ b/xmlreader.c @@ -235,17 +235,12 @@ static void xmlTextReaderStartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlParserCtxtPtr origctxt; xmlTextReaderPtr reader = ctxt->_private; #ifdef DEBUG_CALLBACKS printf("xmlTextReaderStartElement(%s)\n", fullname); #endif if ((reader != NULL) && (reader->startElement != NULL)) { - /* - * when processing an entity, the context may have been changed - */ - origctxt = reader->ctxt; reader->startElement(ctx, fullname, atts); if ((ctxt->node != NULL) && (ctxt->input != NULL) && (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') && @@ -266,18 +261,12 @@ xmlTextReaderStartElement(void *ctx, const xmlChar *fullname, static void xmlTextReaderEndElement(void *ctx, const xmlChar *fullname) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlParserCtxtPtr origctxt; xmlTextReaderPtr reader = ctxt->_private; #ifdef DEBUG_CALLBACKS printf("xmlTextReaderEndElement(%s)\n", fullname); #endif if ((reader != NULL) && (reader->endElement != NULL)) { - /* - * when processing an entity, the context may have been changed - */ - origctxt = reader->ctxt; - reader->endElement(ctx, fullname); } } @@ -294,7 +283,6 @@ static void xmlTextReaderCharacters(void *ctx, const xmlChar *ch, int len) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlParserCtxtPtr origctxt; xmlTextReaderPtr reader = ctxt->_private; #ifdef DEBUG_CALLBACKS @@ -302,10 +290,6 @@ xmlTextReaderCharacters(void *ctx, const xmlChar *ch, int len) #endif if ((reader != NULL) && (reader->characters != NULL)) { reader->characters(ctx, ch, len); - /* - * when processing an entity, the context may have been changed - */ - origctxt = reader->ctxt; } } diff --git a/xmlschemastypes.c b/xmlschemastypes.c index 7bd8a6eb..8103f7ad 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -123,8 +123,8 @@ struct _xmlSchemaValDecimal { unsigned long hi; unsigned int extra; unsigned int sign:1; - int frac:7; - int total:8; + unsigned int frac:7; + unsigned int total:8; }; typedef struct _xmlSchemaValQName xmlSchemaValQName; @@ -1413,7 +1413,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar *value, goto return0; case XML_SCHEMAS_DECIMAL: { const xmlChar *cur = value, *tmp; - int frac = 0, len, neg = 0; + unsigned int frac = 0, len, neg = 0; unsigned long base = 0; if (cur == NULL) goto return1; |
