diff options
author | Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> | 2006-07-04 21:42:12 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-07-04 18:58:10 +0000 |
commit | ce809d1f7af78cdf1d563b34bb59d747f8e8945d (patch) | |
tree | 630685e9f432e3a555c02e4d69301303d3f106b3 /ext/Hash | |
parent | 3469222433b317d18cea77514faabef96011806b (diff) | |
download | perl-ce809d1f7af78cdf1d563b34bb59d747f8e8945d.tar.gz |
more warning-silencing in FieldHash
Message-Id: <CE8BC13E-8BE5-4743-803C-6DF0D1FB2010@mailbox.tu-berlin.de>
Date: Tue, 4 Jul 2006 19:42:12 +0200
p4raw-id: //depot/perl@28478
Diffstat (limited to 'ext/Hash')
-rw-r--r-- | ext/Hash/Util/FieldHash/FieldHash.xs | 4 | ||||
-rw-r--r-- | ext/Hash/Util/FieldHash/t/02_function.t | 2 | ||||
-rw-r--r-- | ext/Hash/Util/FieldHash/t/05_perlhook.t | 11 |
3 files changed, 10 insertions, 7 deletions
diff --git a/ext/Hash/Util/FieldHash/FieldHash.xs b/ext/Hash/Util/FieldHash/FieldHash.xs index 8dadc74bac..d6ecb8027f 100644 --- a/ext/Hash/Util/FieldHash/FieldHash.xs +++ b/ext/Hash/Util/FieldHash/FieldHash.xs @@ -46,7 +46,7 @@ SV* HUF_id(SV* ref, NV cookie) { SvNV_set(id, cookie); SvNOK_on(id); } - SvIV_set(id, (IV)SvRV(ref)); + SvIV_set(id, PTR2UV(SvRV(ref))); SvIOK_on(id); return id; } @@ -221,7 +221,7 @@ void HUF_fix_trigger(SV* trigger, SV* new_id) { /* Go over object registry and fix all objects. Also fix the object * registry. */ -void HUF_fix_objects() { +void HUF_fix_objects(void) { dMY_CXT; I32 i, len; HE* ent; diff --git a/ext/Hash/Util/FieldHash/t/02_function.t b/ext/Hash/Util/FieldHash/t/02_function.t index 877d85eb34..8fed367d3a 100644 --- a/ext/Hash/Util/FieldHash/t/02_function.t +++ b/ext/Hash/Util/FieldHash/t/02_function.t @@ -151,7 +151,7 @@ BEGIN { $n_tests += 8 } { my @refs = map [], 1 .. $size; - $f{ $_} = 1 for @refs; + @f{ @refs } = ( 1) x @refs; is( keys %f, $size, "many keys at once"); is( keys %Hash::Util::FieldHash::ob_reg, diff --git a/ext/Hash/Util/FieldHash/t/05_perlhook.t b/ext/Hash/Util/FieldHash/t/05_perlhook.t index bc9ff9547d..9901e81443 100644 --- a/ext/Hash/Util/FieldHash/t/05_perlhook.t +++ b/ext/Hash/Util/FieldHash/t/05_perlhook.t @@ -118,6 +118,9 @@ use Scalar::Util qw( weaken); () = each %h; is( $counter, 9, "list each doesn't trigger"); + bless \ %h, 'xyz'; + is( $counter, 9, "bless doesn't trigger"); + # see that normal set magic doesn't trigger (identity condition) my %i; Hash::Util::FieldHash::_test_uvar_set( \ %i, \ $counter); @@ -143,7 +146,7 @@ use Scalar::Util qw( weaken); bless \ %i, 'abc'; is( $counter, 1, "...except with bless"); - # see that magic with both set and get doesn't trigger (identity condition) + # see that magic with both set and get doesn't trigger $counter = 123; my %j; Hash::Util::FieldHash::_test_uvar_same( \ %j, \ $counter); @@ -163,13 +166,13 @@ use Scalar::Util qw( weaken); () = values %j; $x = each %j; () = each %j; - - is( $counter, 0, "normal get magic never triggers"); + + is( $counter, 0, "get/set magic never triggers"); bless \ %j, 'abc'; is( $counter, 1, "...except for bless"); - BEGIN { $n_tests += 22 } + BEGIN { $n_tests += 23 } } BEGIN { plan tests => $n_tests } |