From df3248f1087549d0fd11e003b3f1ac61b97aa7f7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 21 Aug 2005 01:59:41 +0000 Subject: r9441: Use "const char *" for fixed-size arrays with charset() because these can require more elements in the local charset (usually UTF8) then in the wire one. (This used to be commit a0e63c2691f596cdacbc2e15404829ebca075429) --- source4/build/pidl/Parse/Pidl/Samba/Header.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'source4/build/pidl/Parse/Pidl/Samba/Header.pm') diff --git a/source4/build/pidl/Parse/Pidl/Samba/Header.pm b/source4/build/pidl/Parse/Pidl/Samba/Header.pm index ca67b7c09f..d88b37e229 100644 --- a/source4/build/pidl/Parse/Pidl/Samba/Header.pm +++ b/source4/build/pidl/Parse/Pidl/Samba/Header.pm @@ -59,14 +59,16 @@ sub HeaderElement($) my $numstar = $element->{POINTERS}; foreach (@{$element->{ARRAY_LEN}}) { - next if is_constant($_); + next if is_constant($_) and + not has_property($element, "charset"); $numstar++; } $numstar-- if Parse::Pidl::Typelist::scalar_is_reference($element->{TYPE}); pidl "*" foreach (1..$numstar); pidl $element->{NAME}; foreach (@{$element->{ARRAY_LEN}}) { - next unless is_constant($_); + next unless (is_constant($_) and + not has_property($element, "charset")); pidl "[$_]"; } @@ -199,11 +201,7 @@ sub HeaderType($$$) } if (has_property($e, "charset")) { - if ($e->{POINTERS} > 0) { - pidl "const char"; - } else { - pidl "char"; - } + pidl "const char"; } else { pidl mapType($e->{TYPE}); } -- cgit