From 7889823783625e16e273770f73f285920828e411 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 19 Jul 2009 21:12:56 +0200 Subject: pidl: Print actual type names in errors about unknown origins rather than 'HASH(0x....)'. --- pidl/lib/Parse/Pidl/Typelist.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pidl/lib/Parse/Pidl/Typelist.pm') diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm index e63b3c990f..12ffa92bf6 100644 --- a/pidl/lib/Parse/Pidl/Typelist.pm +++ b/pidl/lib/Parse/Pidl/Typelist.pm @@ -273,12 +273,15 @@ sub mapTypeName($) my $dt; $t = expandAlias($t); - unless ($dt or ($dt = getType($t))) { + if ($dt = getType($t)) { + return mapType($dt, $dt->{NAME}); + } elsif (ref($t) eq "HASH" and defined($t->{NAME})) { + return mapType($t, $t->{NAME}); + } else { # Best guess return "struct $t"; } - return mapType($dt, $dt->{NAME}); } sub LoadIdl($;$) -- cgit