summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-18 16:31:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:27 -0500
commit327a9ac650d7661a3f94c8e827cd02834550afc4 (patch)
tree70fa28d27d91af0de5d5ba468fae226cb65ada9a /source4
parent0dde0612b420d12b92d22bd64baa500af2c00b2f (diff)
downloadsamba-327a9ac650d7661a3f94c8e827cd02834550afc4.tar.gz
samba-327a9ac650d7661a3f94c8e827cd02834550afc4.tar.bz2
samba-327a9ac650d7661a3f94c8e827cd02834550afc4.zip
r7729: Small fixes to the charset stuff.
(This used to be commit 5122b9f608399a6c90521e2f8bd96154755fe397)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/pidl/ndr.pm19
-rw-r--r--source4/build/pidl/ndr_parser.pm4
-rw-r--r--source4/build/pidl/validator.pm14
-rw-r--r--source4/librpc/idl/echo.idl4
4 files changed, 27 insertions, 14 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm
index f866a0ea8e..2bf673b5e3 100644
--- a/source4/build/pidl/ndr.pm
+++ b/source4/build/pidl/ndr.pm
@@ -10,6 +10,12 @@ package Ndr;
use strict;
use pidl::typelist;
+sub nonfatal($$)
+{
+ my ($e,$s) = @_;
+ warn ("$e->{FILE}:$e->{LINE}: Warning: $s\n");
+}
+
#####################################################################
# return a table describing the order in which the parts of an element
# should be parsed
@@ -172,6 +178,19 @@ sub GetElementLevelTable($)
});
}
+ if (scalar(@size_is) > 0) {
+ nonfatal($e, "size_is() on non-array element");
+ }
+
+ if (scalar(@length_is) > 0) {
+ nonfatal($e, "length_is() on non-array element");
+ }
+
+ if (util::has_property($e, "string")) {
+ nonfatal($e, "string() attribute on non-array element");
+ }
+
+
push (@$order, {
TYPE => "DATA",
DATA_TYPE => $e->{TYPE},
diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm
index 6bb90f5fcb..a654909e0b 100644
--- a/source4/build/pidl/ndr_parser.pm
+++ b/source4/build/pidl/ndr_parser.pm
@@ -529,7 +529,7 @@ sub ParseElementPushLevel
my $nl = Ndr::GetNextLevel($e, $l);
if (util::has_property($e, "charset")) {
- pidl "NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), $e->{PROPERTIES}->{charset}));";
+ pidl "NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
}
@@ -831,7 +831,7 @@ sub ParseElementPullLevel
my $nl = Ndr::GetNextLevel($e, $l);
if (util::has_property($e, "charset")) {
- pidl "NDR_CHECK(ndr_pull_charset($ndr, $ndr_flags, ".get_pointer_to($var_name).", $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), $e->{PROPERTIES}->{charset}));";
+ pidl "NDR_CHECK(ndr_pull_charset($ndr, $ndr_flags, ".get_pointer_to($var_name).", $length, sizeof(" . typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_pull_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
if ($l->{IS_ZERO_TERMINATED}) {
diff --git a/source4/build/pidl/validator.pm b/source4/build/pidl/validator.pm
index 82f1f3dd81..07420eac83 100644
--- a/source4/build/pidl/validator.pm
+++ b/source4/build/pidl/validator.pm
@@ -12,15 +12,13 @@ use strict;
# signal a fatal validation error
sub fatal($$)
{
- my $pos = shift;
- my $s = shift;
+ my ($pos,$s) = @_;
die("$pos->{FILE}:$pos->{LINE}:$s\n");
}
sub nonfatal($$)
{
- my $pos = shift;
- my $s = shift;
+ my ($pos,$s) = @_;
warn ("$pos->{FILE}:$pos->{LINE}:warning:$s\n");
}
@@ -46,8 +44,7 @@ sub el_name($)
# find a sibling var in a structure
sub find_sibling($$)
{
- my($e) = shift;
- my($name) = shift;
+ my($e,$name) = @_;
my($fn) = $e->{PARENT};
if ($name =~ /\*(.*)/) {
@@ -61,7 +58,6 @@ sub find_sibling($$)
return undef;
}
-
my %property_list = (
# interface
"helpstring" => ["INTERFACE", "FUNCTION"],
@@ -140,8 +136,7 @@ my %property_list = (
# check for unknown properties
sub ValidProperties($$)
{
- my $e = shift;
- my $t = shift;
+ my ($e,$t) = @_;
return unless defined $e->{PROPERTIES};
@@ -172,7 +167,6 @@ sub mapToScalar($)
return undef;
}
-
#####################################################################
# parse a struct
sub ValidElement($)
diff --git a/source4/librpc/idl/echo.idl b/source4/librpc/idl/echo.idl
index a6f52d9d15..4fe3d872e3 100644
--- a/source4/librpc/idl/echo.idl
+++ b/source4/librpc/idl/echo.idl
@@ -34,8 +34,8 @@ interface rpcecho
/* test strings */
void echo_TestCall (
- [in,string,charset(CH_UTF16)] uint16 *s1,
- [out,string,charset(CH_UTF16)] uint16 *s2
+ [in,string,charset(UTF16)] uint16 *s1,
+ [out,string,charset(UTF16)] uint16 *s2
);