From: Steve Hay Date: Tue, 29 Mar 2005 15:18:30 +0000 (+0000) Subject: Clean-up some warnings when compiling on Win32 with VC++ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe2774edcceb29d7f31eb2b8407d2ab3df896594;p=p5sagit%2Fp5-mst-13.2.git Clean-up some warnings when compiling on Win32 with VC++ p4raw-id: //depot/perl@24096 --- diff --git a/hv.c b/hv.c index 6879e55..8c6ec39 100644 --- a/hv.c +++ b/hv.c @@ -1533,7 +1533,7 @@ Perl_hv_clear_placeholders(pTHX_ HV *hv) if (--items == 0) { /* Finished. */ - HvTOTALKEYS(hv) -= HvPLACEHOLDERS(hv); + HvTOTALKEYS(hv) -= (IV)HvPLACEHOLDERS(hv); if (HvKEYS(hv) == 0) HvHASKFLAGS_off(hv); HvPLACEHOLDERS(hv) = 0; diff --git a/mg.c b/mg.c index f7300e4..b1830b1 100644 --- a/mg.c +++ b/mg.c @@ -145,7 +145,7 @@ int Perl_mg_get(pTHX_ SV *sv) { const I32 mgs_ix = SSNEW(sizeof(MGS)); - const bool was_temp = SvTEMP(sv); + const bool was_temp = (bool)SvTEMP(sv); int new = 0; MAGIC *newmg, *head, *cur, *mg; /* guard against sv having being freed midway by holding a private diff --git a/op.c b/op.c index 02d4f17..54d4c01 100644 --- a/op.c +++ b/op.c @@ -2129,7 +2129,7 @@ Perl_convert(pTHX_ I32 type, I32 flags, OP *o) o->op_flags |= flags; o = CHECKOP(type, o); - if (o->op_type != type) + if (o->op_type != (unsigned)type) return o; return fold_constants(o); @@ -2146,7 +2146,7 @@ Perl_append_elem(pTHX_ I32 type, OP *first, OP *last) if (!last) return first; - if (first->op_type != type + if (first->op_type != (unsigned)type || (type == OP_LIST && (first->op_flags & OPf_PARENS))) { return newLISTOP(type, 0, first, last); @@ -2171,10 +2171,10 @@ Perl_append_list(pTHX_ I32 type, LISTOP *first, LISTOP *last) if (!last) return (OP*)first; - if (first->op_type != type) + if (first->op_type != (unsigned)type) return prepend_elem(type, (OP*)first, (OP*)last); - if (last->op_type != type) + if (last->op_type != (unsigned)type) return append_elem(type, (OP*)first, (OP*)last); first->op_last->op_sibling = last->op_first; @@ -2195,7 +2195,7 @@ Perl_prepend_elem(pTHX_ I32 type, OP *first, OP *last) if (!last) return first; - if (last->op_type == type) { + if (last->op_type == (unsigned)type) { if (type == OP_LIST) { /* already a PUSHMARK there */ first->op_sibling = ((LISTOP*)last)->op_first->op_sibling; ((LISTOP*)last)->op_first->op_sibling = first; diff --git a/pp_pack.c b/pp_pack.c index 1e470b7..98f1bed 100644 --- a/pp_pack.c +++ b/pp_pack.c @@ -585,7 +585,7 @@ uni_to_byte(pTHX_ char **s, const char *end, I32 datumtype) val &= 0xff; } *s += retlen; - return val; + return (U8)val; } #define SHIFT_BYTE(utf8, s, strend, datumtype) ((utf8) ? \ @@ -612,7 +612,7 @@ uni_to_bytes(pTHX_ char **s, char *end, char *buf, int buf_len, I32 datumtype) bad |= 2; val &= 0xff; } - *(U8 *)buf++ = val; + *(U8 *)buf++ = (U8)val; } /* We have enough characters for the buffer. Did we have problems ? */ if (bad) { @@ -2933,7 +2933,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) GROWING(0, cat, start, cur, len+1); end = start+SvLEN(cat)-1; } - *(U8 *) cur++ = auv; + *(U8 *) cur++ = (U8)auv; } } break; diff --git a/pp_sort.c b/pp_sort.c index b48c180..850b44b 100644 --- a/pp_sort.c +++ b/pp_sort.c @@ -1574,7 +1574,7 @@ PP(pp_sort) if (SvMAGICAL(av)) { MEXTEND(SP, max); p2 = SP; - for (i=0; i < (U32)max; i++) { + for (i=0; i < max; i++) { SV **svp = av_fetch(av, i, FALSE); *SP++ = (svp) ? *svp : Nullsv; } diff --git a/pp_sys.c b/pp_sys.c index 5c1cc64..cf188f0 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -1699,7 +1699,7 @@ PP(pp_sysread) read_target = sv_newmortal(); SvUPGRADE(read_target, SVt_PV); - buffer = SvGROW(read_target, length + 1); + buffer = SvGROW(read_target, (STRLEN)(length + 1)); } if (PL_op->op_type == OP_SYSREAD) { diff --git a/utf8.c b/utf8.c index 61e4432..4f41a97 100644 --- a/utf8.c +++ b/utf8.c @@ -1863,7 +1863,7 @@ Perl_pv_uni_display(pTHX_ SV *dsv, const U8 *spv, STRLEN len, STRLEN pvlim, UV f } u = utf8_to_uvchr((U8*)s, 0); if (u < 256) { - unsigned char c = u & 0xFF; + unsigned char c = (unsigned char)u & 0xFF; if (!ok && (flags & UNI_DISPLAY_BACKSLASH)) { switch (c) { case '\n': diff --git a/util.c b/util.c index ab39df9..010507d 100644 --- a/util.c +++ b/util.c @@ -2816,7 +2816,7 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch, const char **searc if (strEQ(scriptname, "-")) dosearch = 0; if (dosearch) { /* Look in '.' first. */ - char *cur = scriptname; + const char *cur = scriptname; #ifdef SEARCH_EXTS if ((curext = strrchr(scriptname,'.'))) /* possible current ext */ while (ext[i])