Skip Menu |
 

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 33754
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: RURBAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.66
Fixed in: (no value)



Subject: fix more use64bitint warnings
Download (untitled) / with headers
text/plain 1.5k
Attached patch fixes more of the spurious different size compiler warnings with use64bitint (cygwin). LibXML.xs: In function `XS_XML__LibXML__end_push': LibXML.xs:2294: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__end_sax_push': LibXML.xs:2339: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__ParserContext_DESTROY': LibXML.xs:2464: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__Document__setDocumentElement': LibXML.xs:3308: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__Document_adoptNode': LibXML.xs:3509: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__Node_DESTROY': LibXML.xs:3759: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__Node_insertBefore': LibXML.xs:4371: warning: cast to pointer from integer of different size LibXML.xs:4371: warning: cast to pointer from integer of different size LibXML.xs:4371: warning: cast to pointer from integer of different size LibXML.xs:4371: warning: cast to pointer from integer of different size LibXML.xs: In function `XS_XML__LibXML__Node_insertAfter': LibXML.xs:4401: warning: cast to pointer from integer of different size LibXML.xs:4401: warning: cast to pointer from integer of different size LibXML.xs:4401: warning: cast to pointer from integer of different size LibXML.xs:4401: warning: cast to pointer from integer of different size ... -- Reini Urban
Subject: XML-LibXML-1.66.patch
difforig XML-LibXML-1.66 2008-03-02 Reini Urban <rurban@x-ray.at> diff -ub XML-LibXML-1.66/LibXML.xs.orig --- XML-LibXML-1.66/LibXML.xs.orig 2008-01-29 21:01:49.000000000 +0000 +++ XML-LibXML-1.66/LibXML.xs 2008-03-02 17:10:28.375000000 +0000 @@ -889,7 +889,7 @@ AV * array_result; xmlXPathObjectPtr ret; - ret = (xmlXPathObjectPtr) xmlXPathNewNodeSet((xmlNodePtr) NULL); + ret = (xmlXPathObjectPtr) xmlXPathNewNodeSet(INT2PTR(xmlNodePtr,NULL)); array_result = (AV*)SvRV(perl_result); length = av_len(array_result); for( i = 0; i <= length ; i++ ) { @@ -897,7 +897,7 @@ if (pnode != NULL && sv_isobject(*pnode) && sv_derived_from(*pnode,"XML::LibXML::Node")) { xmlXPathNodeSetAdd(ret->nodesetval, - (xmlNodePtr)PmmSvNode(*pnode)); + INT2PTR(xmlNodePtr,PmmSvNode(*pnode))); if(ctxt) { LibXML_XPathContext_pool(ctxt->context, PmmSvNode(*pnode), *pnode); @@ -914,8 +914,8 @@ xmlNodePtr tmp_node; xmlXPathObjectPtr ret; - ret = (xmlXPathObjectPtr)xmlXPathNewNodeSet(NULL); - tmp_node = (xmlNodePtr)PmmSvNode(perl_result); + ret = INT2PTR(xmlXPathObjectPtr,xmlXPathNewNodeSet(NULL)); + tmp_node = INT2PTR(xmlNodePtr,PmmSvNode(perl_result)); xmlXPathNodeSetAdd(ret->nodesetval,tmp_node); if(ctxt) { LibXML_XPathContext_pool(ctxt->context, PmmSvNode(perl_result), @@ -1138,7 +1138,7 @@ for( j = 0 ; j < len; j++){ tnode = nodelist->nodeTab[j]; if( tnode != NULL && tnode->doc != NULL) { - owner = PmmOWNERPO(PmmNewNode((xmlNodePtr) tnode->doc)); + owner = PmmOWNERPO(PmmNewNode(INT2PTR(xmlNodePtr,tnode->doc))); } else { owner = NULL; } @@ -1438,7 +1438,7 @@ ( !xmlDoValidityCheckingDefaultValue || ( valid || ( real_doc->intSubset == NULL && real_doc->extSubset == NULL )))))) { - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } else { xmlFreeDoc(real_doc); } @@ -1591,7 +1591,7 @@ ( !xmlDoValidityCheckingDefaultValue || ( valid || ( real_doc->intSubset == NULL && real_doc->extSubset == NULL ))))) { - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } else { xmlFreeDoc(real_doc); } @@ -1738,7 +1738,7 @@ ( !xmlDoValidityCheckingDefaultValue || ( valid || ( real_doc->intSubset == NULL && real_doc->extSubset == NULL ))))) { - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } else { xmlFreeDoc(real_doc); } @@ -1846,7 +1846,7 @@ /* This HTML memory parser doesn't use a ctxt; there is no "well-formed" * distinction, and if it manages to parse the HTML, it returns non-null. */ - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } LibXML_cleanup_parser(); @@ -1902,7 +1902,7 @@ if (real_doc->URL) xmlFree((xmlChar*) real_doc->URL); real_doc->URL = xmlStrdup((const xmlChar*) URL); } - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } @@ -1996,7 +1996,7 @@ real_doc->URL = xmlStrdup((const xmlChar*)SvPV_nolen(newURI)); } - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } LibXML_cleanup_parser(); @@ -2295,7 +2295,7 @@ if ( real_doc != NULL ) { if ( restore || well_formed ) { - RETVAL = LibXML_NodeToSv( real_obj, (xmlNodePtr) real_doc ); + RETVAL = LibXML_NodeToSv( real_obj, INT2PTR(xmlNodePtr,real_doc) ); } else { xmlFreeDoc(real_doc); real_doc = NULL; @@ -2488,7 +2488,7 @@ if ( internalFlag && SvTRUE(internalFlag) ) { intSubset = xmlGetIntSubset( self ); if ( intSubset ) - xmlUnlinkNode( (xmlNodePtr)intSubset ); + xmlUnlinkNode( INT2PTR(xmlNodePtr,intSubset) ); } /* LibXML_init_error_ctx(saved_error); */ @@ -2507,10 +2507,10 @@ if ( intSubset != NULL ) { if (self->children == NULL) { - xmlAddChild((xmlNodePtr) self, (xmlNodePtr) intSubset); + xmlAddChild(INT2PTR(xmlNodePtr,self), INT2PTR(xmlNodePtr,intSubset)); } else { - xmlAddPrevSibling(self->children, (xmlNodePtr) intSubset); + xmlAddPrevSibling(self->children, INT2PTR(xmlNodePtr,intSubset)); } } @@ -2554,7 +2554,7 @@ if ( internalFlag && SvTRUE(internalFlag) ) { intSubset = xmlGetIntSubset( self ); if ( intSubset ) - xmlUnlinkNode( (xmlNodePtr)intSubset ); + xmlUnlinkNode( INT2PTR(xmlNodePtr,intSubset) ); } xmlRegisterDefaultOutputCallbacks(); @@ -2591,10 +2591,10 @@ if ( intSubset != NULL ) { if (self->children == NULL) { - xmlAddChild((xmlNodePtr) self, (xmlNodePtr) intSubset); + xmlAddChild(INT2PTR(xmlNodePtr,self), INT2PTR(xmlNodePtr,intSubset)); } else { - xmlAddPrevSibling(self->children, (xmlNodePtr) intSubset); + xmlAddPrevSibling(self->children, INT2PTR(xmlNodePtr,intSubset)); } } @@ -2708,7 +2708,7 @@ if (encoding && *encoding != 0) { doc->encoding = (const xmlChar*)xmlStrdup((const xmlChar*)encoding); } - RETVAL = PmmNodeToSv((xmlNodePtr)doc,NULL); + RETVAL = PmmNodeToSv(INT2PTR(xmlNodePtr,doc),NULL); OUTPUT: RETVAL diff -ub XML-LibXML-1.66/perl-libxml-mm.h.orig --- XML-LibXML-1.66/perl-libxml-mm.h.orig 2008-01-28 12:21:45.000000000 +0000 +++ XML-LibXML-1.66/perl-libxml-mm.h 2008-03-02 17:21:18.703125000 +0000 @@ -73,9 +73,9 @@ typedef ProxyNode* ProxyNodePtr; /* this my go only into the header used by the xs */ -#define SvPROXYNODE(x) ((ProxyNodePtr)SvIV(SvRV(x))) -#define PmmPROXYNODE(x) ((ProxyNodePtr)x->_private) -#define SvNAMESPACE(x) ((xmlNsPtr)SvIV(SvRV(x))) +#define SvPROXYNODE(x) (INT2PTR(ProxyNodePtr,SvIV(SvRV(x)))) +#define PmmPROXYNODE(x) (INT2PTR(ProxyNodePtr,x->_private)) +#define SvNAMESPACE(x) (INT2PTR(xmlNsPtr,SvIV(SvRV(x)))) #define PmmREFCNT(node) node->count #define PmmREFCNT_inc(node) node->count++ diff -ub XML-LibXML-1.66/typemap.orig --- XML-LibXML-1.66/typemap.orig 2006-11-15 23:31:46.000000000 +0000 +++ XML-LibXML-1.66/typemap 2008-03-02 17:23:28.406250000 +0000 @@ -13,7 +13,7 @@ INPUT O_OBJECT if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) - $var = ($type)SvIV((SV*)SvRV( $arg )); + $var = INT2PTR($type,SvIV((SV*)SvRV( $arg ))); else{ warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" ); XSRETURN_UNDEF; @@ -21,7 +21,7 @@ O_DOC_OBJECT if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) { - $var = ($type)PmmSvNode($arg); + $var = INT2PTR($type,PmmSvNode($arg)); if ( $var == NULL ) { croak( \"${Package}::$func_name() -- $var contains no data\" ); XSRETURN_UNDEF; @@ -34,7 +34,7 @@ O_NODE_OBJECT if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) { - $var = ($type)PmmSvNode($arg); + $var = INT2PTR($type,PmmSvNode($arg)); if ( $var == NULL ) { croak( \"${Package}::$func_name() -- $var contains no data\" ); XSRETURN_UNDEF;
Applied to the SVN. Thanks a lot. -- Petr


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.