From: Jarkko Hietaniemi Date: Wed, 22 Nov 2000 23:59:15 +0000 (+0000) Subject: Fixes for signedness warnings noticed by VMSperlers. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=793db0cbf2a1f8691eefd9130892b47143e8795f;p=p5sagit%2Fp5-mst-13.2.git Fixes for signedness warnings noticed by VMSperlers. p4raw-id: //depot/perl@7824 --- diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs index f7c810a..a574c33 100644 --- a/ext/Storable/Storable.xs +++ b/ext/Storable/Storable.xs @@ -670,7 +670,7 @@ static char magicstr[] = "pst0"; /* Used as a magic number */ #define GETMARK(x) do { \ if (!cxt->fio) \ MBUF_GETC(x); \ - else if ((x = PerlIO_getc(cxt->fio)) == EOF) \ + else if ((int)(x = PerlIO_getc(cxt->fio)) == EOF) \ return (SV *) 0; \ } while (0) diff --git a/regcomp.c b/regcomp.c index 3b474b2..c906790 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3007,8 +3007,12 @@ tryagain: loopdone: RExC_parse = p - 1; nextchar(pRExC_state); - if (len < 0) - vFAIL("Internal disaster"); + { + /* len is STRLEN which is unsigned, need to copy to signed */ + IV iv = len; + if (iv < 0) + vFAIL("Internal disaster"); + } if (len > 0) *flagp |= HASWIDTH; if (len == 1) diff --git a/sv.c b/sv.c index 2cc3c43..acb0b82 100644 --- a/sv.c +++ b/sv.c @@ -2961,8 +2961,11 @@ void Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN len) { register char *dptr; - assert(len >= 0); /* STRLEN is probably unsigned, so this may - elicit a warning, but it won't hurt. */ + { + /* len is STRLEN which is unsigned, need to copy to signed */ + IV iv = len; + assert(iv >= 0); + } SV_CHECK_THINKFIRST(sv); if (!ptr) { (void)SvOK_off(sv);