SvNV_set(id, cookie);
SvNOK_on(id);
}
- SvIV_set(id, (IV)SvRV(ref));
+ SvIV_set(id, PTR2UV(SvRV(ref)));
SvIOK_on(id);
return 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;
{
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,
() = 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);
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);
() = 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 }