summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-01-24 14:57:30 +0100
committerStefan Metzmacher <metze@samba.org>2008-01-24 14:57:30 +0100
commit4d656cb5a52bb48fb29b8c546bd33f7a446b0fbf (patch)
treee84aeca25ad4f699d43ebfdfe0746be32c3276b4 /source4/pidl/lib/Parse/Pidl/Samba4
parent39fcf7ccdf7cd9c169f877e4722ad2d9b80ced64 (diff)
downloadsamba-4d656cb5a52bb48fb29b8c546bd33f7a446b0fbf.tar.gz
samba-4d656cb5a52bb48fb29b8c546bd33f7a446b0fbf.tar.bz2
samba-4d656cb5a52bb48fb29b8c546bd33f7a446b0fbf.zip
pidl/Samba4::Header: we don't need to check if (defined($enum->{ELEMENTS})) twice
metze (This used to be commit c1ac13ee12d6d7e41b3700f207c9a8811bb05cd4)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm38
1 files changed, 18 insertions, 20 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index 2b3a9df80f..b2d5126d1d 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -131,27 +131,25 @@ sub HeaderEnum($$)
my $count = 0;
my $with_val = 0;
my $without_val = 0;
- if (defined($enum->{ELEMENTS})) {
- pidl " { __donnot_use_enum_$name=0x7FFFFFFF}\n";
- foreach my $e (@{$enum->{ELEMENTS}}) {
- my $t = "$e";
- my $name;
- my $value;
- if ($t =~ /(.*)=(.*)/) {
- $name = $1;
- $value = $2;
- $with_val = 1;
- fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!")
- unless ($without_val == 0);
- } else {
- $name = $t;
- $value = $count++;
- $without_val = 1;
- fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!")
- unless ($with_val == 0);
- }
- pidl "#define $name ( $value )\n";
+ pidl " { __donnot_use_enum_$name=0x7FFFFFFF}\n";
+ foreach my $e (@{$enum->{ELEMENTS}}) {
+ my $t = "$e";
+ my $name;
+ my $value;
+ if ($t =~ /(.*)=(.*)/) {
+ $name = $1;
+ $value = $2;
+ $with_val = 1;
+ fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!")
+ unless ($without_val == 0);
+ } else {
+ $name = $t;
+ $value = $count++;
+ $without_val = 1;
+ fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!")
+ unless ($with_val == 0);
}
+ pidl "#define $name ( $value )\n";
}
pidl "#endif\n";
}