From 5340489807985b3bb4c10eacfa701d643ee7a36c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 Feb 2007 23:57:26 +0000 Subject: r21440: Support different variables in environments. (This used to be commit 1702a663ba4ce6f5803e265a969f2be564fce1e3) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 46898e6ad8..dfd7296cdd 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -216,16 +216,16 @@ sub end_flags($) } } -sub GenerateStructEnv($) +sub GenerateStructEnv($$) { - my $x = shift; + my ($x, $v) = @_; my %env; foreach my $e (@{$x->{ELEMENTS}}) { - $env{$e->{NAME}} = "r->$e->{NAME}"; + $env{$e->{NAME}} = "$v->$e->{NAME}"; } - $env{"this"} = "r"; + $env{"this"} = $v; return \%env; } @@ -1198,7 +1198,7 @@ sub ParseStructPush($$) return unless defined($struct->{ELEMENTS}); - my $env = GenerateStructEnv($struct); + my $env = GenerateStructEnv($struct, "r"); EnvSubstituteValue($env, $struct); @@ -1440,7 +1440,7 @@ sub ParseStructPrint($$) return unless defined $struct->{ELEMENTS}; - my $env = GenerateStructEnv($struct); + my $env = GenerateStructEnv($struct, "r"); EnvSubstituteValue($env, $struct); @@ -1521,7 +1521,7 @@ sub ParseStructPull($$) return unless defined $struct->{ELEMENTS}; - my $env = GenerateStructEnv($struct); + my $env = GenerateStructEnv($struct, "r"); # declare any internal pointers we need foreach my $e (@{$struct->{ELEMENTS}}) { -- cgit