Commits

Shlomi Fish committed 0c80fb5

Fix warnings on clang. (RT #77802).

  • Participants
  • Parent commits 40914d0

Comments (0)

Files changed (5)

 Revision history for Perl extension XML::LibXML
-    
+
+    - Fix warnings that appear when compiling using the clang C compiler by
+    default.
+        - https://rt.cpan.org/Ticket/Display.html?id=77802
+        - Thanks to duvny for the report, and to seldon, doy and Zefram
+        for their assistance in fixing the warnings.
+
 1.99            Thu May 31 10:21:23 IDT 2012
     - Apply a patch from Mons Anderson ( mons@cpan.org ) for fixing the 
     overloading.
 
     results = POPs;
 
-    SvREFCNT_inc(results);
+    (void)SvREFCNT_inc(results);
 
     PUTBACK;
     FREETMPS;
     LibXML_configure_namespaces(ctxt);
 }
 
+extern void boot_XML__LibXML__Devel(pTHX_ CV*);
+
 MODULE = XML::LibXML         PACKAGE = XML::LibXML
 
 PROTOTYPES: DISABLE
 	const char * encoding = SvOK($arg) ? SvPV_nolen($arg) : NULL;
 	int options = SvOK($arg) ? SvIV($arg) : 0;
     CODE:
-        SvREFCNT_inc(fh); /* _dec'd by LibXML_close_perl */
+        (void)SvREFCNT_inc(fh); /* _dec'd by LibXML_close_perl */
         RETVAL = xmlReaderForIO((xmlInputReadCallback) LibXML_read_perl,
 				(xmlInputCloseCallback) LibXML_close_perl,
 				(void *) fh, url, encoding, options);
 MANIFEST
 perl-libxml-mm.c
 perl-libxml-mm.h
+perl-libxml-libxml.h
 perl-libxml-sax.c
 perl-libxml-sax.h
 ppport.h

File perl-libxml-mm.c

     int i;
     /* first check that the input is not ascii */
     /* since we do not want to recode ascii as, say, UTF-16 */
-    if (len<0) len=xmlStrlen(string);
+    if (len == 0)
+        len=xmlStrlen(string);
     for (i=0; i<len; i++) {
         if(!string[i] || string[i] & 0x80) {
             break;

File perl-libxml-sax.c

 		return;
 	}
 
-	if (p1 = buffer->head) {
+	if ((p1 = buffer->head)) {
 
 		while(p1) {
 			p2 = p1->next;
 		return;
 	}
 
-	if (p1 = buffer->head) {
+	if ((p1 = buffer->head)) {
 
 		while(p1) {
 			p2 = p1->next;