This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IO.xs: fix compiler warning
authorDavid Mitchell <davem@iabyn.com>
Wed, 13 Nov 2013 16:48:11 +0000 (16:48 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Nov 2013 17:38:43 +0000 (17:38 +0000)
PerlIO_unread() returns SSize_t, although from its sparse documentation
it doesn't seem that it would ever return a negative value. So cast away
the 'comparison between signed and unsigned integer' warning.

dist/IO/IO.pm
dist/IO/IO.xs

index 21583f5..6edf83c 100644 (file)
@@ -7,7 +7,7 @@ use Carp;
 use strict;
 use warnings;
 
-our $VERSION = "1.29";
+our $VERSION = "1.30";
 XSLoader::load 'IO', $VERSION;
 
 sub import {
index 5ae41ae..efb0ed6 100644 (file)
@@ -350,7 +350,7 @@ ungetc(handle, c)
                  * above-Unicodes */
                 end = uvchr_to_utf8_flags(buf, v, 0);
                 len = end - buf;
-                if (PerlIO_unread(handle, &buf, len) == len)
+                if ((Size_t)PerlIO_unread(handle, &buf, len) == len)
                     XSRETURN_UV(v);
                 else
                     RETVAL = EOF;