summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/dcom_stub.pm2
-rw-r--r--source4/build/pidl/ndr_header.pm4
-rw-r--r--source4/build/pidl/ndr_parser.pm18
-rw-r--r--source4/build/pidl/server.pm2
4 files changed, 12 insertions, 14 deletions
diff --git a/source4/build/pidl/dcom_stub.pm b/source4/build/pidl/dcom_stub.pm
index 024037e2e8..b551b06299 100644
--- a/source4/build/pidl/dcom_stub.pm
+++ b/source4/build/pidl/dcom_stub.pm
@@ -179,7 +179,7 @@ pidl "
return NT_STATUS_OK;
}
-static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, void *r)
+static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
{
NTSTATUS status;
uint16_t opnum = dce_call->pkt.u.request.opnum;
diff --git a/source4/build/pidl/ndr_header.pm b/source4/build/pidl/ndr_header.pm
index 6269320115..33183cec96 100644
--- a/source4/build/pidl/ndr_header.pm
+++ b/source4/build/pidl/ndr_header.pm
@@ -361,7 +361,7 @@ sub HeaderFnProto($$)
my ($interface,$fn) = @_;
my $name = $fn->{NAME};
- pidl "void ndr_print_$name(struct ndr_print *ndr, const char *name, int flags, struct $name *r);\n";
+ pidl "void ndr_print_$name(struct ndr_print *ndr, const char *name, int flags, const struct $name *r);\n";
if (defined($fn->{OPNUM})) {
pidl "NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r);\n";
@@ -370,7 +370,7 @@ sub HeaderFnProto($$)
return unless util::has_property($fn, "public");
- pidl "NTSTATUS ndr_push_$name(struct ndr_push *ndr, int flags, struct $name *r);\n";
+ pidl "NTSTATUS ndr_push_$name(struct ndr_push *ndr, int flags, const struct $name *r);\n";
pidl "NTSTATUS ndr_pull_$name(struct ndr_pull *ndr, int flags, struct $name *r);\n";
pidl "\n";
diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm
index a654909e0b..ba6b9d58da 100644
--- a/source4/build/pidl/ndr_parser.pm
+++ b/source4/build/pidl/ndr_parser.pm
@@ -603,7 +603,7 @@ sub ParseElementPush($$$$$$)
start_flags($e);
if (my $value = util::has_property($e, "value")) {
- pidl "$var_name = " . util::ParseExpr($value, $env) . ";";
+ $var_name = util::ParseExpr($value, $env);
}
ParseElementPushLevel($e, $e->{LEVELS}[0], $ndr, $var_name, $env, $primitives, $deferred);
@@ -642,9 +642,7 @@ sub ParseElementPrint($$$)
return if (util::has_property($e, "noprint"));
if (my $value = util::has_property($e, "value")) {
- pidl "if (ndr->flags & LIBNDR_PRINT_SET_VALUES) {";
- pidl "\t$var_name = " . util::ParseExpr($value,$env) . ";";
- pidl "}";
+ $var_name = "(ndr->flags & LIBNDR_PRINT_SET_VALUES)?" . util::ParseExpr($value,$env) . ":$var_name";
}
foreach my $l (@{$e->{LEVELS}}) {
@@ -1361,13 +1359,13 @@ sub ParseStructNdrSize($)
sub ArgsStructPush($)
{
my $e = shift;
- return "struct ndr_push *ndr, int ndr_flags, struct $e->{NAME} *r";
+ return "struct ndr_push *ndr, int ndr_flags, const struct $e->{NAME} *r";
}
sub ArgsStructPrint($)
{
my $e = shift;
- return "struct ndr_print *ndr, const char *name, struct $e->{NAME} *r";
+ return "struct ndr_print *ndr, const char *name, const struct $e->{NAME} *r";
}
sub ArgsStructPull($)
@@ -1634,13 +1632,13 @@ sub ParseUnionPull($$)
sub ArgsUnionPush($)
{
my $e = shift;
- return "struct ndr_push *ndr, int ndr_flags, union $e->{NAME} *r";
+ return "struct ndr_push *ndr, int ndr_flags, const union $e->{NAME} *r";
}
sub ArgsUnionPrint($)
{
my $e = shift;
- return "struct ndr_print *ndr, const char *name, union $e->{NAME} *r";
+ return "struct ndr_print *ndr, const char *name, const union $e->{NAME} *r";
}
sub ArgsUnionPull($)
@@ -1746,7 +1744,7 @@ sub ParseFunctionPrint($)
return if util::has_property($fn, "noprint");
- pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, struct $fn->{NAME} *r)";
+ pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r)";
pidl "{";
indent;
@@ -1809,7 +1807,7 @@ sub ParseFunctionPush($)
return if util::has_property($fn, "nopush");
- pidl fn_prefix($fn) . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, struct $fn->{NAME} *r)";
+ pidl fn_prefix($fn) . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, const struct $fn->{NAME} *r)";
pidl "{";
indent;
diff --git a/source4/build/pidl/server.pm b/source4/build/pidl/server.pm
index 29745686fe..e52ce51722 100644
--- a/source4/build/pidl/server.pm
+++ b/source4/build/pidl/server.pm
@@ -168,7 +168,7 @@ pidl "
return NT_STATUS_OK;
}
-static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, void *r)
+static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
{
NTSTATUS status;
uint16_t opnum = dce_call->pkt.u.request.opnum;