From 60a849af6d37dccc3d1576442294e7a6f22d3a33 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 7 Jan 2005 23:23:28 +0000 Subject: r4600: Remove Data::Dumper import leftover from debugging. Return more ethereal types and bases for hf fields. Currently we assume that enums always fit into a uint16 which will probably have to change soon. (This used to be commit 25f6e11f3156e21c1dc03afa879e9cda2f5dd341) --- source4/build/pidl/eparser.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index 73f2275b98..e25a1760e1 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -107,10 +107,13 @@ sub type2ft($) { my($t) = shift; - return "FT_UINT32", if ($t eq "uint32"); - return "FT_UINT16", if ($t eq "uint16"); - return "FT_UINT8", if ($t eq "uint8"); - return "FT_BYTES"; + return "FT_UINT$1" if $t =~ /uint(8|16|32|64)/; + return "FT_INT$1" if $t =~ /int(8|16|32|64)/; + return "FT_UINT64", if ($t eq "HYPER_T" or $t eq "NTTIME"); + + # Type is an enum + + return "FT_UINT16"; } # Determine the display base for an element @@ -123,9 +126,13 @@ sub elementbase($) return "BASE_" . uc($base); } - return "BASE_DEC", if ($e->{TYPE} eq "uint32") or - ($e->{TYPE} eq "uint16") or ($e->{TYPE} eq "uint8"); - return "BASE_NONE"; + return "BASE_DEC", if $e->{TYPE} eq "ENUM"; + return "BASE_DEC", if $e->{TYPE} =~ /u?int(8|16|32|64)/; + return "BASE_DEC", if $e->{TYPE} eq "NTTIME" or $e->{TYPE} eq "HYPER_T"; + + # Probably an enum + + return "BASE_DEC"; } # Convert a IDL structure field name (e.g access_mask) to a prettier @@ -230,13 +237,10 @@ sub NeededTypedef($) } if ($t->{DATA}->{TYPE} eq "ENUM") { - use Data::Dumper; - print Dumper($t); - $needed{"hf_$t->{NAME}"} = { 'name' => $t->{NAME}, - 'ft' => 'FT_UINT32', - 'base' => 'BASE_HEX' + 'ft' => 'FT_UINT16', + 'base' => 'BASE_DEC' }; } } -- cgit