summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Compat.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-26 02:14:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:44 -0500
commitee10fb1a12391a76fe81e6e7a92d282ef885bc30 (patch)
tree24fe6a6f60024a1420a49e3e5b21c0e7c2b0708f /source4/pidl/lib/Parse/Pidl/Compat.pm
parent788f7cc59ab75467697a7145f9bcca6f8adaeeab (diff)
downloadsamba-ee10fb1a12391a76fe81e6e7a92d282ef885bc30.tar.gz
samba-ee10fb1a12391a76fe81e6e7a92d282ef885bc30.tar.bz2
samba-ee10fb1a12391a76fe81e6e7a92d282ef885bc30.zip
r12490: Fix --warn-compat
(This used to be commit ba6a767f1b3a14e076ebd049b4fdcffd64173523)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Compat.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Compat.pm52
1 files changed, 15 insertions, 37 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Compat.pm b/source4/pidl/lib/Parse/Pidl/Compat.pm
index 2e7d686249..f0b8cc7b0b 100644
--- a/source4/pidl/lib/Parse/Pidl/Compat.pm
+++ b/source4/pidl/lib/Parse/Pidl/Compat.pm
@@ -74,29 +74,19 @@ my %supported_properties = (
"length_is" => ["ELEMENT"],
);
-
-my($res);
-
sub warning($$)
{
- my $l = shift;
- my $m = shift;
-
- print "$l->{FILE}:$l->{LINE}:Warning:$m\n";
-}
-
-sub error($$)
-{
my ($l,$m) = @_;
- print "$l->{FILE}:$l->{LINE}:$m\n";
+
+ print STDERR "$l->{FILE}:$l->{LINE}:warning:$m\n";
}
sub CheckTypedef($)
{
- my $td = shift;
+ my ($td) = @_;
if (has_property($td, "nodiscriminant")) {
- error($td, "nodiscriminant property not supported");
+ warning($td, "nodiscriminant property not supported");
}
if ($td->{TYPE} eq "BITMAP") {
@@ -121,7 +111,7 @@ sub CheckElement($)
my $e = shift;
if (has_property($e, "noheader")) {
- error($e, "noheader property not supported");
+ warning($e, "noheader property not supported");
return;
}
@@ -131,30 +121,28 @@ sub CheckElement($)
}
if (has_property($e, "compression")) {
- error($e, "compression() property not supported");
+ warning($e, "compression() property not supported");
}
if (has_property($e, "obfuscation")) {
- error($e, "obfuscation() property not supported");
+ warning($e, "obfuscation() property not supported");
}
if (has_property($e, "sptr")) {
- error($e, "sptr() pointer property not supported");
+ warning($e, "sptr() pointer property not supported");
}
if (has_property($e, "relative")) {
- error($e, "relative() pointer property not supported");
+ warning($e, "relative() pointer property not supported");
}
- if (has_property($td, "flag")) {
+ if (has_property($e, "flag")) {
warning($e, "ignoring flag() property");
}
- if (has_property($td, "value")) {
+ if (has_property($e, "value")) {
warning($e, "ignoring value() property");
}
-
- StripProperties($e);
}
sub CheckFunction($)
@@ -162,12 +150,8 @@ sub CheckFunction($)
my $fn = shift;
if (has_property($fn, "noopnum")) {
- error($fn, "noopnum not converted. Opcodes will be out of sync.");
+ warning($fn, "noopnum not converted. Opcodes will be out of sync.");
}
-
- StripProperties($fn);
-
-
}
sub CheckInterface($)
@@ -176,11 +160,9 @@ sub CheckInterface($)
if (has_property($if, "pointer_default_top") and
$if->{PROPERTIES}->{pointer_default_top} ne "ref") {
- error($if, "pointer_default_top() is pidl-specific");
+ warning($if, "pointer_default_top() is pidl-specific");
}
- StripProperties($if);
-
foreach my $x (@{$if->{DATA}}) {
if ($x->{TYPE} eq "DECLARE") {
warning($if, "the declare keyword is pidl-specific");
@@ -193,14 +175,10 @@ sub Check($)
{
my $pidl = shift;
my $nidl = [];
- my $res = "";
- foreach my $x (@{$pidl}) {
- push (@$nidl, CheckInterface($x))
- if ($x->{TYPE} eq "INTERFACE");
+ foreach (@{$pidl}) {
+ push (@$nidl, CheckInterface($_)) if ($_->{TYPE} eq "INTERFACE");
}
-
- return $res;
}
1;