summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-11-21 11:38:24 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-12-01 05:54:22 +0100
commit778fc58eb281e38eb1a3346b58cfdf9682f104c4 (patch)
tree1f088ca2a3d9c1396e1958d3e4057688ddccf750 /pidl
parentbf7342bdf4fea9ce49915d88ab4bf5202cb1b64b (diff)
downloadsamba-778fc58eb281e38eb1a3346b58cfdf9682f104c4.tar.gz
pidl: Use a static const initialised struct in dcerpc_server_$name_init(void)
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
index 0ffed39394f..70778640f04 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
@@ -257,17 +257,16 @@ static bool $name\__op_interface_by_name(struct dcesrv_interface *iface, const c
NTSTATUS dcerpc_server_$name\_init(void)
{
NTSTATUS ret;
- struct dcesrv_endpoint_server ep_server;
+ static const struct dcesrv_endpoint_server ep_server = {
+ /* fill in our name */
+ .name = \"$name\",
- /* fill in our name */
- ep_server.name = \"$name\";
-
- /* fill in all the operations */
- ep_server.init_server = $name\__op_init_server;
-
- ep_server.interface_by_uuid = $name\__op_interface_by_uuid;
- ep_server.interface_by_name = $name\__op_interface_by_name;
+ /* fill in all the operations */
+ .init_server = $name\__op_init_server,
+ .interface_by_uuid = $name\__op_interface_by_uuid,
+ .interface_by_name = $name\__op_interface_by_name
+ };
/* register ourselves with the DCERPC subsystem. */
ret = dcerpc_register_ep_server(&ep_server);