[libxml2] Cleanup encoding pointer comparison



commit e6ad10a5b9709d26b0988c258783835d063a3b08
Author: Nikolay Sivov <bunglehead gmail com>
Date:   Mon Nov 1 11:35:14 2010 +0100

    Cleanup encoding pointer comparison
    
    * parser.c: Compare encoding pointer with a NULL instead of
      xmlCharEncoding enum value 0 then casted to char * !

 parser.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/parser.c b/parser.c
index 1db706b..e8cd123 100644
--- a/parser.c
+++ b/parser.c
@@ -6609,7 +6609,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
     xmlDetectSAX2(ctxt);
     GROW;
 
-    if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) &&
+    if ((ctxt->encoding == NULL) &&
         (ctxt->input->end - ctxt->input->cur >= 4)) {
         xmlChar start[4];
 	xmlCharEncoding enc;
@@ -10105,7 +10105,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
     if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
         ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator);
 
-    if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) &&
+    if ((ctxt->encoding == NULL) &&
         ((ctxt->input->end - ctxt->input->cur) >= 4)) {
 	/* 
 	 * Get the 4 first bytes and decode the charset



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]