From 15ebda7e1b18cc29be891b1370473c8bc3acc2c6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 7 May 2008 17:26:40 +0200 Subject: Deal with interface in generated python code, clearer error message on unhandled unions. --- source4/pidl/lib/Parse/Pidl/NDR.pm | 1 + source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 3 +++ 2 files changed, 4 insertions(+) (limited to 'source4') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 10bd29715b..a34e7ef7ba 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -876,6 +876,7 @@ my %property_list = ( "unique" => ["ELEMENT"], "ignore" => ["ELEMENT"], "relative" => ["ELEMENT"], + "null_is_ffffffff" => ["ELEMENT"], "relative_base" => ["TYPEDEF", "STRUCT", "UNION"], "gensize" => ["TYPEDEF", "STRUCT", "UNION"], diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm index ab67236717..b7d092015c 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -1025,6 +1025,9 @@ sub ConvertObjectToPythonData($$$$$) return $self->ConvertScalarToPython(Parse::Pidl::Typelist::bitmap_type_fn($actual_ctype), $cvar); } elsif ($actual_ctype->{TYPE} eq "SCALAR") { return $self->ConvertScalarToPython($actual_ctype->{NAME}, $cvar); + } elsif ($actual_ctype->{TYPE} eq "UNION") { + # FIXME: Should be fatal() rather than die() + die("union without discriminant: " . mapTypeName($ctype) . ": $cvar"); } elsif ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") { return "py_talloc_import_ex(&$ctype->{NAME}_Type, $mem_ctx, $cvar)"; } -- cgit