Commits

Anonymous committed 97a7998

Modified Files:
LibXML.xs
+ less warnings

Comments (0)

Files changed (1)

     }
     /* this should be done by libxml2 !? */
     if (doc->encoding == NULL) {
-        doc->encoding = xmlStrdup("utf-8");
+        doc->encoding = xmlStrdup((const xmlChar*)"utf-8");
     }
 
     if ( directory == NULL ) {
         STRLEN len;
         SV * newURI = sv_2mortal(newSVpvf("unknown-%12.12d", (void*)doc));
-        doc->URL = xmlStrdup(SvPV(newURI, len));
+        doc->URL = xmlStrdup((const xmlChar*)SvPV(newURI, len));
     } else {
-        doc->URL = xmlStrdup(directory);
+        doc->URL = xmlStrdup((const xmlChar*)directory);
     }
     
     return doc;
         if ( directory == NULL ) {
             STRLEN len;
             SV * newURI = sv_2mortal(newSVpvf("unknown-%12.12d", (void*)real_dom));
-            real_dom->URL = xmlStrdup(SvPV(newURI, len));
+            real_dom->URL = xmlStrdup((const xmlChar*)SvPV(newURI, len));
         } else {
-            real_dom->URL = xmlStrdup(directory);
+            real_dom->URL = xmlStrdup((const xmlChar*)directory);
         }
 
         if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid && (real_dom->intSubset || real_dom->extSubset) )) {
         sv_setpvn(LibXML_error, "", 0);
         
         LibXML_init_parser(self);
-        real_dom = htmlParseDoc(ptr, NULL);
+        real_dom = htmlParseDoc((xmlChar*)ptr, NULL);
         LibXML_cleanup_callbacks();
         LibXML_cleanup_parser();        
 
         else {
             STRLEN n_a;
             SV * newURI = newSVpvf("unknown-%12.12d", real_dom);
-            real_dom->URL = xmlStrdup(SvPV(newURI, n_a));
+            real_dom->URL = xmlStrdup((const xmlChar*)SvPV(newURI, n_a));
             SvREFCNT_dec(newURI);
             RETVAL = nodeToSv((xmlNodePtr)real_dom);
             setSvNodeExtra(RETVAL,RETVAL);
         else {
             STRLEN n_a;
             SV * newURI = newSVpvf("unknown-%12.12d", real_dom);
-            real_dom->URL = xmlStrdup(SvPV(newURI, n_a));
+            real_dom->URL = xmlStrdup((const xmlChar*)SvPV(newURI, n_a));
             SvREFCNT_dec(newURI);
             RETVAL = nodeToSv((xmlNodePtr)real_dom);
             setSvNodeExtra(RETVAL,RETVAL);
         sv_setpvn(LibXML_error, "", 0);
         
         LibXML_init_parser(self);
-        real_dom = htmlParseFile(filename, NULL);
+        real_dom = htmlParseFile((char*)filename, NULL);
         LibXML_cleanup_callbacks();
         LibXML_cleanup_parser();
 
         }
 
         /* encode the chunk to UTF8 */
-        chunk = Sv2C(svchunk, encoding);
+        chunk = Sv2C(svchunk, (const xmlChar*)encoding);
 
         if ( chunk != NULL ) {
             LibXML_error = sv_2mortal(newSVpv("", 0));
 #ifdef HAVE_UTF8
         if ( SvUTF8(string) ) {
 #endif
-            realstring = Sv2C(string,"UTF8" );
+            realstring = Sv2C(string,(const xmlChar*)"UTF8" );
             if ( realstring != NULL ) {
-                tstr =  domDecodeString( encoding, realstring );
+                tstr =  (xmlChar*)domDecodeString( (const char*)encoding,
+                                                   (const xmlChar*)realstring );
                 if ( tstr != NULL ) {
-                    RETVAL = C2Sv(tstr,(xmlChar*)encoding);
+                    RETVAL = C2Sv((const xmlChar*)tstr,(const xmlChar*)encoding);
                     xmlFree( tstr );
                 }
                 else {
         xmlDocPtr doc
         char * new_URI
     CODE:
-        RETVAL = xmlStrdup( doc->URL );
+        RETVAL = xmlStrdup(doc->URL );
         if (new_URI) {
-            xmlFree( (char*) doc->URL);
-            doc->URL = xmlStrdup(new_URI);
+            xmlFree( (xmlChar*) doc->URL);
+            doc->URL = xmlStrdup((xmlChar*)new_URI);
         }
     OUTPUT:
         RETVAL
         encname = nodeSv2C( qname , (xmlNodePtr) real_dom );
         if ( nsURI != NULL && strlen( nsURI ) != 0 ){
             lname = xmlSplitQName2(encname, &prefix);
-            ns = domNewNs (0 , prefix , nsURI);
+            ns = domNewNs (0 , prefix , (xmlChar*)nsURI);
         }
         else{
             lname = encname;
         SV* self
     CODE:
         if( self != NULL && self!=&PL_sv_undef) {
-            RETVAL = xmlStrdup(((xmlDocPtr)getSvNode(self))->encoding );
+            RETVAL = xmlStrdup((xmlChar*)((xmlDocPtr)getSvNode(self))->encoding );
         }
     OUTPUT:
         RETVAL
 isEqual( self, other )
         xmlNodePtr self
         xmlNodePtr other
+    ALIAS:
+        XML::LibXML::Node::isSameNode = 1
     CODE:
         RETVAL = 0;
         if( self == other ) {
         node = getSvNode( elem );
         name = nodeSv2C( pname, node );
         content = xmlGetProp( node , name );
-        if ( content != NULL ) {
-            
+        if ( content != NULL ) {     
             RETVAL  = C2Sv(content, NULL );
             xmlFree( content );
         }