summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-13 16:35:59 +0100
committerNicholas Clark <nick@ccl4.org>2011-06-11 10:12:17 +0200
commit0a1f728a485818674e743b9fb9a3c149f9e53b6e (patch)
tree2f37fa3b4fe9343ed341a711686bed8d8eeac0b4 /regen
parent8b09643d068d86543c3782211d4a527ee93fee77 (diff)
downloadperl-0a1f728a485818674e743b9fb9a3c149f9e53b6e.tar.gz
Move the cast for a magic vtable with const get into mg_vtable.h
Putting the cast inside the initialiser (the only initialiser using it) eliminates use of the macro MGVTBL_SET_CONST_MAGIC_GET(), which can be deleted as nothing outside the core is relying on it.
Diffstat (limited to 'regen')
-rw-r--r--regen/mg_vtable.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl
index d3557ec43b..6322b8b018 100644
--- a/regen/mg_vtable.pl
+++ b/regen/mg_vtable.pl
@@ -18,6 +18,7 @@ BEGIN {
require 'regen/regen_lib.pl';
}
+# These have a subtly different "namespace" from the magic types.
my @sig =
(
'sv' => {get => 'get', set => 'set', len => 'len'},
@@ -82,15 +83,16 @@ print $h <<'EOH';
EOH
while (my ($name, $data) = splice @sig, 0, 2) {
- my $funcs = join ",\n ", map {
+ my @funcs = map {
$data->{$_} ? "Perl_magic_$data->{$_}" : 0;
} qw(get set len clear free copy dup local);
- my $set_macro = $data->{const} ? 'MGVTBL_SET_CONST_MAGIC_GET' : 'MGVTBL_SET';
+ $funcs[0] = "(int (*)(pTHX_ SV *, MAGIC *))" . $funcs[0] if $data->{const};
+ my $funcs = join ",\n ", @funcs;
print $h "$data->{cond}\n" if $data->{cond};
print $h <<"EOT";
-$set_macro(
+MGVTBL_SET(
PL_vtbl_$name,
$funcs
);