diff options
author | Jeremy Allison <jra@samba.org> | 2009-09-17 11:08:42 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-09-17 11:11:06 -0700 |
commit | 95311a220e7107ec8b3012d67d5efef57313a274 (patch) | |
tree | 0b355c3741ffdd906aff4e53c277d20e43fb1d9a /pidl/lib/Parse/Pidl | |
parent | c2055de162b154efb1aef0d2977f860a01ffdbbc (diff) | |
download | samba-95311a220e7107ec8b3012d67d5efef57313a274.tar.gz samba-95311a220e7107ec8b3012d67d5efef57313a274.tar.bz2 samba-95311a220e7107ec8b3012d67d5efef57313a274.zip |
Fix the problem with pidl generating invalid C for enums. According
to the C standard an enum is guarenteed to be an (int), which means
for 4 byte ints specifying a type of 0x80000000 is an invalid value.
The Solaris compiler complains about this. Fix by adding an (int)
cast in front of the value generation.
Jeremy.
Diffstat (limited to 'pidl/lib/Parse/Pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Header.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Header.pm b/pidl/lib/Parse/Pidl/Samba4/Header.pm index 5315957946..bb497bb3a7 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -120,10 +120,18 @@ sub HeaderEnum($$;$) pidl " {\n"; $tab_depth++; foreach my $e (@{$enum->{ELEMENTS}}) { + my @enum_els = (); unless ($first) { pidl ",\n"; } $first = 0; pidl tabs(); - pidl $e; + @enum_els = split(/=/, $e); + if (@enum_els == 2) { + pidl $enum_els[0]; + pidl "=(int)"; + pidl $enum_els[1]; + } else { + pidl $e; + } } pidl "\n"; $tab_depth--; |