1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-31 06:50:06 +03:00

more cleanups based on sparse reports, added "make sparse" Daniel

* Makefile.am globals.c parserInternals.c xmlreader.c xmlunicode.c
  xmlwriter.c: more cleanups based on sparse reports, added
  "make sparse"
Daniel
This commit is contained in:
Daniel Veillard 2005-07-29 22:02:24 +00:00
parent 4ea89f04cc
commit 75e389d4e0
7 changed files with 23 additions and 14 deletions

View File

@ -1,3 +1,9 @@
Sat Jul 30 00:00:46 CEST 2005 Daniel Veillard <daniel@veillard.com>
* Makefile.am globals.c parserInternals.c xmlreader.c xmlunicode.c
xmlwriter.c: more cleanups based on sparse reports, added
"make sparse"
Fri Jul 29 12:11:25 CEST 2005 Daniel Veillard <daniel@veillard.com>
* python/libxml.c: don't output any message on failed resolver lookups,

View File

@ -1135,3 +1135,6 @@ install-data-local:
tst: tst.c
$(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz
sparse: clean
$(MAKE) CC=cgcc

View File

@ -44,7 +44,7 @@ static xmlMutexPtr xmlThrDefMutex = NULL;
*
* Additional initialisation for multi-threading
*/
void xmlInitGlobals()
void xmlInitGlobals(void)
{
xmlThrDefMutex = xmlNewMutex();
}
@ -54,7 +54,7 @@ void xmlInitGlobals()
*
* Additional cleanup for multi-threading
*/
void xmlCleanupGlobals()
void xmlCleanupGlobals(void)
{
if (xmlThrDefMutex != NULL) {
xmlFreeMutex(xmlThrDefMutex);

View File

@ -1794,7 +1794,7 @@ xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
*/
xmlParserCtxtPtr
xmlNewParserCtxt()
xmlNewParserCtxt(void)
{
xmlParserCtxtPtr ctxt;

View File

@ -598,14 +598,14 @@ xmlTextReaderEntPop(xmlTextReaderPtr reader)
xmlNodePtr ret;
if (reader->entNr <= 0)
return (0);
return (NULL);
reader->entNr--;
if (reader->entNr > 0)
reader->ent = reader->entTab[reader->entNr - 1];
else
reader->ent = NULL;
ret = reader->entTab[reader->entNr];
reader->entTab[reader->entNr] = 0;
reader->entTab[reader->entNr] = NULL;
return (ret);
}
@ -2172,7 +2172,7 @@ xmlFreeTextReader(xmlTextReaderPtr reader) {
if ((reader->ctxt->vctxt.vstateTab != NULL) &&
(reader->ctxt->vctxt.vstateMax > 0)){
xmlFree(reader->ctxt->vctxt.vstateTab);
reader->ctxt->vctxt.vstateTab = 0;
reader->ctxt->vctxt.vstateTab = NULL;
reader->ctxt->vctxt.vstateMax = 0;
}
if (reader->allocs & XML_TEXTREADER_CTXT)

View File

@ -926,8 +926,8 @@ static xmlChSRange xmlZS[] = {{0x20, 0x20}, {0xa0, 0xa0}, {0x1680, 0x1680},
{0x205f, 0x205f}, {0x3000, 0x3000} };
static xmlChRangeGroup xmlZG = {9,0,xmlZS,NULL};
xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, 128};
xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, 36};
static xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, 128};
static xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, 36};
/**
* xmlUnicodeLookup:

View File

@ -739,7 +739,7 @@ xmlTextWriterStartComment(xmlTextWriterPtr writer)
return -1;
}
p->name = 0;
p->name = NULL;
p->state = XML_TEXTWRITER_COMMENT;
xmlListPushFront(writer->nodes, p);
@ -1018,7 +1018,7 @@ xmlTextWriterStartElementNS(xmlTextWriterPtr writer,
if ((writer == NULL) || (name == NULL) || (*name == '\0'))
return -1;
buf = 0;
buf = NULL;
if (prefix != 0) {
buf = xmlStrdup(prefix);
buf = xmlStrcat(buf, BAD_CAST ":");
@ -1745,7 +1745,7 @@ xmlTextWriterStartAttributeNS(xmlTextWriterPtr writer,
if ((writer == NULL) || (name == NULL) || (*name == '\0'))
return -1;
buf = 0;
buf = NULL;
if (prefix != 0) {
buf = xmlStrdup(prefix);
buf = xmlStrcat(buf, BAD_CAST ":");
@ -2063,7 +2063,7 @@ xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer,
if ((writer == NULL) || (name == NULL) || (*name == '\0'))
return -1;
buf = 0;
buf = NULL;
if (prefix != NULL) {
buf = xmlStrdup(prefix);
buf = xmlStrcat(buf, BAD_CAST ":");
@ -2078,7 +2078,7 @@ xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer,
sum += count;
if (namespaceURI != NULL) {
buf = 0;
buf = NULL;
buf = xmlStrdup(BAD_CAST "xmlns");
if (prefix != NULL) {
buf = xmlStrcat(buf, BAD_CAST ":");
@ -2587,7 +2587,7 @@ xmlTextWriterStartCDATA(xmlTextWriterPtr writer)
return -1;
}
p->name = 0;
p->name = NULL;
p->state = XML_TEXTWRITER_CDATA;
xmlListPushFront(writer->nodes, p);