From ecf2c1effb778a95fd863a5e87ec7e378d228b57 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 7 Feb 2007 19:03:19 +0000 Subject: r21222: Merge a couple of pidl fixes: * Pidl will now warn when trying to use pointers as integers in expressions. * "subcontext()" is now marked as deprecated. The alternatives, transmit_as() / represent_as() should be available soon. * More tests. * Remove some unused code in smbtorture. (This used to be commit 37c0da541e3962164d5af3e3c9560803a733f3b7) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/NDR.pm') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 462e577cdd..2ba8461e4a 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -35,7 +35,7 @@ use vars qw($VERSION); $VERSION = '0.01'; @ISA = qw(Exporter); @EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsString); -@EXPORT_OK = qw(GetElementLevelTable ParseElement); +@EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement); use strict; use Parse::Pidl qw(warning fatal); @@ -902,7 +902,6 @@ sub ValidElement($) } } - if (has_property($e, "subcontext") and has_property($e, "represent_as")) { fatal($e, el_name($e) . " : subcontext() and represent_as() can not be used on the same element"); } @@ -919,6 +918,10 @@ sub ValidElement($) fatal($e, el_name($e) . " : represent_as() and value() can not be used on the same element"); } + if (has_property($e, "subcontext")) { + warning($e, "subcontext() is deprecated. Use represent_as() or transmit_as() instead"); + } + if (defined (has_property($e, "subcontext_size")) and not defined(has_property($e, "subcontext"))) { fatal($e, el_name($e) . " : subcontext_size() on non-subcontext element"); } -- cgit