This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Silence some compiler warnings
authorKarl Williamson <khw@cpan.org>
Thu, 7 Nov 2019 17:41:28 +0000 (10:41 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 7 Nov 2019 17:49:55 +0000 (10:49 -0700)
These were introduced in the tr/// changes in the series
merged in 240494d6992696a7a350217c131e1d5dc1444a0c

doop.c
op.c

diff --git a/doop.c b/doop.c
index 5ac7942..6db986b 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -390,7 +390,7 @@ S_do_trans_invmap(pTHX_ SV * const sv, AV * const invmap)
     const bool delete_unfound = cBOOL(PL_op->op_private & OPpTRANS_DELETE);
     bool inplace = ! cBOOL(PL_op->op_private & OPpTRANS_GROWS);
     const UV* from_array = invlist_array(from_invlist);
     const bool delete_unfound = cBOOL(PL_op->op_private & OPpTRANS_DELETE);
     bool inplace = ! cBOOL(PL_op->op_private & OPpTRANS_GROWS);
     const UV* from_array = invlist_array(from_invlist);
-    UV final_map;
+    UV final_map = TR_OOB;
     bool out_is_utf8 = cBOOL(SvUTF8(sv));
     STRLEN s_len;
 
     bool out_is_utf8 = cBOOL(SvUTF8(sv));
     STRLEN s_len;
 
diff --git a/op.c b/op.c
index 468fc4c..db01996 100644 (file)
--- a/op.c
+++ b/op.c
@@ -7754,8 +7754,8 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
 
         tbl->map[tbl->size] = del
                               ? (short) TR_DELETE
 
         tbl->map[tbl->size] = del
                               ? (short) TR_DELETE
-                              : rlen
-                                ? final_map
+                              : (short) rlen
+                                ? (short) final_map
                                 : (short) TR_R_EMPTY;
 
         SvREFCNT_dec(t_invlist);
                                 : (short) TR_R_EMPTY;
 
         SvREFCNT_dec(t_invlist);