This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix signed/unsigned mismatch in (M)EXTEND
[perl5.git] / pp.h
diff --git a/pp.h b/pp.h
index 003d7af..828b7a2 100644 (file)
--- a/pp.h
+++ b/pp.h
@@ -278,21 +278,21 @@ Does not use C<TARG>.  See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
                        } STMT_END
 /* Same thing, but update mark register too. */
 # define MEXTEND(p,n)   STMT_START {                                    \
-                            const int markoff = mark - PL_stack_base;   \
+                            const SSize_t markoff = mark - PL_stack_base; \
                             sp = stack_grow(sp,p,(SSize_t) (n));        \
                             mark = PL_stack_base + markoff;             \
                             PERL_UNUSED_VAR(sp);                        \
                         } STMT_END
 #else
 # define EXTEND(p,n)   STMT_START {                                     \
-                         if (UNLIKELY(PL_stack_max - p < (int)(n))) {   \
+                         if (UNLIKELY(PL_stack_max - p < (SSize_t)(n))) { \
                            sp = stack_grow(sp,p,(SSize_t) (n));         \
                            PERL_UNUSED_VAR(sp);                         \
                          } } STMT_END
 /* Same thing, but update mark register too. */
 # define MEXTEND(p,n)  STMT_START {                                     \
-                         if (UNLIKELY(PL_stack_max - p < (int)(n))) {   \
-                           const int markoff = mark - PL_stack_base;    \
+                         if (UNLIKELY(PL_stack_max - p < (SSize_t)(n))) { \
+                           const SSize_t markoff = mark - PL_stack_base;  \
                            sp = stack_grow(sp,p,(SSize_t) (n));         \
                            mark = PL_stack_base + markoff;              \
                            PERL_UNUSED_VAR(sp);                         \