mg.h: Suppress compiler warning
authorFather Chrysostomos <sprout@cpan.org>
Tue, 27 Aug 2013 20:00:24 +0000 (13:00 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 28 Aug 2013 03:28:58 +0000 (20:28 -0700)
GCC says:
pp_hot.c: In function 'Perl_pp_match':
pp_hot.c:1453: warning: signed and unsigned type in conditional expression

mg.h

diff --git a/mg.h b/mg.h
index 29e339f..81ed296 100644 (file)
--- a/mg.h
+++ b/mg.h
@@ -66,8 +66,8 @@ struct magic {
     SvPOK(sv) && !SvGMAGICAL(sv)                          \
        ? (mg)->mg_len = (off), (mg)->mg_flags |= MGf_BYTES \
        : ((mg)->mg_len = DO_UTF8(sv)                        \
-           ? utf8_length((U8 *)(pv), (U8 *)(pv)+(off))       \
-           : (off),                                           \
+           ? (SSize_t)utf8_length((U8 *)(pv), (U8 *)(pv)+(off)) \
+           : (SSize_t)(off),                                     \
           (mg)->mg_flags &= ~MGf_BYTES))
 #endif