1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-04-24 18:50:07 +03:00

Fixed typo in xmlCharEncFirstLine pointed out by Mark Rowe (bug #440159)

* encoding.c: Fixed typo in xmlCharEncFirstLine pointed out
  by Mark Rowe (bug #440159)
* include/libxml/xmlversion.h.in: Added check for definition of
  _POSIX_C_SOURCE to avoid warnings on Apple OS/X (patch from
  Wendy Doyle and Mark Rowe, bug #346675)
* schematron.c, testapi.c, tree.c, xmlIO.c, xmlsave.c: minor
  changes to fix compilation warnings - no change to logic.

svn path=/trunk/; revision=3618
This commit is contained in:
William M. Brack 2007-05-22 16:00:06 +00:00
parent e882765aa4
commit 38d452ac1c
8 changed files with 26 additions and 11 deletions

View File

@ -1,3 +1,13 @@
Tue May 22 08:59:48 PDT 2007 William Brack <wbrack@mmm.com.hk>
* encoding.c: Fixed typo in xmlCharEncFirstLine pointed out
by Mark Rowe (bug #440159)
* include/libxml/xmlversion.h.in: Added check for definition of
_POSIX_C_SOURCE to avoid warnings on Apple OS/X (patch from
Wendy Doyle and Mark Rowe, bug #346675)
* schematron.c, testapi.c, tree.c, xmlIO.c, xmlsave.c: minor
changes to fix compilation warnings - no change to logic.
Tue May 15 22:18:08 PDT 2007 William Brack <wbrack@mmm.com.hk>
* nanohttp.c: small enhancement to last fix, pointed out

View File

@ -1761,19 +1761,20 @@ xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
if (out == NULL) return(-1);
if (in == NULL) return(-1);
/* calculate space available */
written = out->size - out->use;
toconv = in->use;
if (toconv * 2 >= written) {
xmlBufferGrow(out, toconv);
written = out->size - out->use - 1;
}
/*
* echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
* 45 chars should be sufficient to reach the end of the encoding
* declaration without going too far inside the document content.
*/
written = 45;
if (toconv > 45)
toconv = 45;
if (toconv * 2 >= written) {
xmlBufferGrow(out, toconv);
written = out->size - out->use - 1;
}
if (handler->input != NULL) {
ret = handler->input(&out->content[out->use], &written,

View File

@ -91,7 +91,8 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Whether the thread support is configured in
*/
#if @WITH_THREADS@
#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >= 199506L)
#if defined(_REENTRANT) || defined(__MT__) || \
(defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
#define LIBXML_THREAD_ENABLED
#endif
#endif

View File

@ -714,6 +714,7 @@ xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt)
xmlFree(ctxt);
}
#if 0
/**
* xmlSchematronPushInclude:
* @ctxt: the schema parser context
@ -782,6 +783,7 @@ xmlSchematronPopInclude(xmlSchematronParserCtxtPtr ctxt)
return(xmlSchematronPopInclude(ctxt));
return(ret);
}
#endif
/**
* xmlSchematronAddNamespace:
@ -987,6 +989,7 @@ xmlSchematronParsePattern(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr pat)
}
}
#if 0
/**
* xmlSchematronLoadInclude:
* @ctxt: a schema validation context
@ -1051,6 +1054,7 @@ done:
xmlFree(URI);
return(ret);
}
#endif
/**
* xmlSchematronParse:

View File

@ -128,7 +128,7 @@ int main(int argc, char **argv) {
int blocks, mem;
/* access to the proxy can slow up regression tests a lot */
putenv("http_proxy=");
putenv((char *) "http_proxy=");
memset(chartab, 0, sizeof(chartab));
strncpy((char *) chartab, " chartab\n", 20);

2
tree.c
View File

@ -4848,7 +4848,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
fixed = xmlPathToURI(uri);
if (fixed != NULL) {
xmlSetNsProp(cur, ns, BAD_CAST "base", fixed);
xmlFree(fixed);
xmlFree((xmlChar *)fixed);
} else {
xmlSetNsProp(cur, ns, BAD_CAST "base", uri);
}

View File

@ -3638,7 +3638,7 @@ static int xmlNoNetExists(const char *URL) {
*
* Returns a new allocated URL, or NULL.
*/
xmlChar *
static xmlChar *
xmlResolveResourceFromCatalog(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlChar *resource = NULL;

View File

@ -834,7 +834,6 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
xmlCharEncodingOutputFunc oldescape = ctxt->escape;
xmlCharEncodingOutputFunc oldescapeAttr = ctxt->escapeAttr;
xmlOutputBufferPtr buf = ctxt->buf;
xmlCharEncodingHandlerPtr handler = NULL;
xmlCharEncoding enc;
xmlInitParser();