summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-03-29 15:18:30 +0000
committerSteve Hay <SteveHay@planit.com>2005-03-29 15:18:30 +0000
commitfe2774edcceb29d7f31eb2b8407d2ab3df896594 (patch)
tree5f9e337ef31aaa5474897b7a94d6eefe9c923d79
parent1cb0ed9b77e4ba2e0bcbeb9a897574a0fe3f3e52 (diff)
downloadperl-fe2774edcceb29d7f31eb2b8407d2ab3df896594.tar.gz
Clean-up some warnings when compiling on Win32 with VC++
p4raw-id: //depot/perl@24096
-rw-r--r--hv.c2
-rw-r--r--mg.c2
-rw-r--r--op.c10
-rw-r--r--pp_pack.c6
-rw-r--r--pp_sort.c2
-rw-r--r--pp_sys.c2
-rw-r--r--utf8.c2
-rw-r--r--util.c2
8 files changed, 14 insertions, 14 deletions
diff --git a/hv.c b/hv.c
index 6879e55e6b..8c6ec39c3a 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 f7300e477a..b1830b1271 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 02d4f17c88..54d4c014b6 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 1e470b73bc..98f1bed837 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 b48c180946..850b44b969 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 5c1cc64ffe..cf188f0a49 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 61e4432222..4f41a97c82 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 ab39df9130..010507d9b0 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])