From: Charles Bailey Date: Wed, 9 Feb 2000 09:29:06 +0000 (+0000) Subject: Minor fixes to assuage picky compilers (unsigned comparisons and X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=32da55abecac94dc6a18cbca78eb8321199543f1;p=p5sagit%2Fp5-mst-13.2.git Minor fixes to assuage picky compilers (unsigned comparisons and alias rules lead to compilation warnings) p4raw-id: //depot/vmsperl@5050 --- diff --git a/av.c b/av.c index 29afaff..dffabe4 100644 --- a/av.c +++ b/av.c @@ -393,7 +393,7 @@ Perl_av_clear(pTHX_ register AV *av) SV** ary; #ifdef DEBUGGING - if (SvREFCNT(av) <= 0 && ckWARN_d(WARN_DEBUGGING)) { + if (SvREFCNT(av) == 0 && ckWARN_d(WARN_DEBUGGING)) { Perl_warner(aTHX_ WARN_DEBUGGING, "Attempt to clear deleted array"); } #endif diff --git a/mg.h b/mg.h index baedde5..ad50f5a 100644 --- a/mg.h +++ b/mg.h @@ -40,7 +40,7 @@ struct magic { #define MgTAINTEDDIR_on(mg) (mg->mg_flags |= MGf_TAINTEDDIR) #define MgTAINTEDDIR_off(mg) (mg->mg_flags &= ~MGf_TAINTEDDIR) -#define MgPV(mg,lp) (((lp = (mg)->mg_len) == HEf_SVKEY) ? \ +#define MgPV(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \ SvPV((SV*)((mg)->mg_ptr),lp) : \ (mg)->mg_ptr) diff --git a/pp_sys.c b/pp_sys.c index a9292a1..75206c5 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -1091,7 +1091,7 @@ PP(pp_getc) GV *gv; MAGIC *mg; - if (MAXARG <= 0) + if (MAXARG == 0) gv = PL_stdingv; else gv = (GV*)POPs; @@ -1701,7 +1701,7 @@ PP(pp_eof) GV *gv; MAGIC *mg; - if (MAXARG <= 0) { + if (MAXARG == 0) { if (PL_op->op_flags & OPf_SPECIAL) { /* eof() */ IO *io; gv = PL_last_in_gv = PL_argvgv; @@ -1745,7 +1745,7 @@ PP(pp_tell) GV *gv; MAGIC *mg; - if (MAXARG <= 0) + if (MAXARG == 0) gv = PL_last_in_gv; else gv = PL_last_in_gv = (GV*)POPs; @@ -1980,7 +1980,7 @@ PP(pp_flock) #ifdef FLOCK argtype = POPi; - if (MAXARG <= 0) + if (MAXARG == 0) gv = PL_last_in_gv; else gv = (GV*)POPs; diff --git a/scope.c b/scope.c index 0f56854..4bcc669 100644 --- a/scope.c +++ b/scope.c @@ -316,7 +316,7 @@ Perl_save_ary(pTHX_ GV *gv) av = GvAVn(gv); if (SvMAGIC(oav)) { SvMAGIC(av) = SvMAGIC(oav); - SvFLAGS(av) |= SvMAGICAL(oav); + SvFLAGS((SV*)av) |= SvMAGICAL(oav); SvMAGICAL_off(oav); SvMAGIC(oav) = 0; PL_localizing = 1; @@ -341,7 +341,7 @@ Perl_save_hash(pTHX_ GV *gv) hv = GvHVn(gv); if (SvMAGIC(ohv)) { SvMAGIC(hv) = SvMAGIC(ohv); - SvFLAGS(hv) |= SvMAGICAL(ohv); + SvFLAGS((SV*)hv) |= SvMAGICAL(ohv); SvMAGICAL_off(ohv); SvMAGIC(ohv) = 0; PL_localizing = 1; @@ -715,7 +715,7 @@ Perl_leave_scope(pTHX_ I32 base) if (GvAV(gv)) { AV *goner = GvAV(gv); SvMAGIC(av) = SvMAGIC(goner); - SvFLAGS(av) |= SvMAGICAL(goner); + SvFLAGS((SV*)av) |= SvMAGICAL(goner); SvMAGICAL_off(goner); SvMAGIC(goner) = 0; SvREFCNT_dec(goner); diff --git a/vms/vms.c b/vms/vms.c index aee410d..a3b0306 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -3979,7 +3979,7 @@ static time_t toutc_dst(time_t loc) { if (rsltmp->tm_isdst) loc -= 3600; return loc; } -#define _toutc(secs) ((secs) == -1 ? -1 : \ +#define _toutc(secs) ((secs) == (time_t) -1 ? (time_t) -1 : \ ((gmtime_emulation_type || my_time(NULL)), \ (gmtime_emulation_type == 1 ? toutc_dst(secs) : \ ((secs) - utc_offset_secs)))) @@ -3992,7 +3992,7 @@ static time_t toloc_dst(time_t utc) { if (rsltmp->tm_isdst) utc += 3600; return utc; } -#define _toloc(secs) ((secs) == -1 ? -1 : \ +#define _toloc(secs) ((secs) == (time_t) -1 ? (time_t) -1 : \ ((gmtime_emulation_type || my_time(NULL)), \ (gmtime_emulation_type == 1 ? toloc_dst(secs) : \ ((secs) + utc_offset_secs))))