summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-10-06 22:17:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 22:17:33 -0700
commitc60dbbc3880c0d4c4f81d95fb1d70b608f96a645 (patch)
tree8c27ae687782db5088cf0fd5d43f2b88d82b20ef /hv.c
parent51a1303ca5c496ad5fb0bb3bc37f2b3584e845b9 (diff)
downloadperl-c60dbbc3880c0d4c4f81d95fb1d70b608f96a645.tar.gz
Cast to signed before negating, to avoid compiler warnings
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hv.c b/hv.c
index 2004d3dcd0..01b073df26 100644
--- a/hv.c
+++ b/hv.c
@@ -2081,7 +2081,7 @@ Perl_hv_name_set(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
spot = &iter->xhv_name_u.xhvnameu_name;
}
PERL_HASH(hash, name, len);
- *spot = name ? share_hek(name, flags & SVf_UTF8 ? -len : len, hash) : NULL;
+ *spot = name ? share_hek(name, flags & SVf_UTF8 ? -(I32)len : (I32)len, hash) : NULL;
}
/*
@@ -2149,7 +2149,7 @@ Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
if (count < 0) aux->xhv_name_count--, count = -count;
else aux->xhv_name_count++;
Renew(aux->xhv_name_u.xhvnameu_names, count + 1, HEK *);
- (aux->xhv_name_u.xhvnameu_names)[count] = share_hek(name, (flags & SVf_UTF8 ? -len : len), hash);
+ (aux->xhv_name_u.xhvnameu_names)[count] = share_hek(name, (flags & SVf_UTF8 ? -(I32)len : (I32)len), hash);
}
else {
HEK *existing_name = aux->xhv_name_u.xhvnameu_name;
@@ -2163,7 +2163,7 @@ Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
Newx(aux->xhv_name_u.xhvnameu_names, 2, HEK *);
aux->xhv_name_count = existing_name ? 2 : -2;
*aux->xhv_name_u.xhvnameu_names = existing_name;
- (aux->xhv_name_u.xhvnameu_names)[1] = share_hek(name, (flags & SVf_UTF8 ? -len : len), hash);
+ (aux->xhv_name_u.xhvnameu_names)[1] = share_hek(name, (flags & SVf_UTF8 ? -(I32)len : (I32)len), hash);
}
}