summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2019-11-30 16:30:48 +1300
committerAndrew Bartlett <abartlet@samba.org>2019-12-04 05:10:31 +0000
commit5513558bb422132632da08574d02f3a568622138 (patch)
tree9026fdd09b22165d0124a64126f160f502df1afa /pidl
parent4f0fba18867faa0578d63c26054d04afd7f8b019 (diff)
downloadsamba-5513558bb422132632da08574d02f3a568622138.tar.gz
pidl:: adjust s4::Python pidl_hdr() to be the same as others
The common case is for pidl_hdr() to add a "\n", which we can easily do here, allowing this to be merged into the Pidl::Base borg. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 161521c6e3a..9ef4c6ca493 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -37,7 +37,7 @@ sub new($) {
sub pidl_hdr ($$)
{
my $self = shift;
- $self->{res_hdr} .= shift;
+ $self->{res_hdr} .= shift . "\n";
}
sub pidl($$)
@@ -83,7 +83,7 @@ sub Import
foreach (@imports) {
$_ = unmake_str($_);
s/\.idl$//;
- $self->pidl_hdr("#include \"librpc/gen_ndr/$_\.h\"\n");
+ $self->pidl_hdr("#include \"librpc/gen_ndr/$_\.h\"");
$self->register_module_import("samba.dcerpc.$_");
}
}
@@ -395,7 +395,7 @@ sub PythonStruct($$$$$$)
$self->pidl("");
}
- $self->pidl_hdr("static PyTypeObject $name\_Type;\n");
+ $self->pidl_hdr("static PyTypeObject $name\_Type;");
$self->pidl("");
my $docstring = $self->DocString($d, $name);
my $typeobject = "$name\_Type";
@@ -926,7 +926,7 @@ sub PythonFunctionStruct($$$$)
$self->pidl("};");
$self->pidl("");
- $self->pidl_hdr("static PyTypeObject $name\_Type;\n");
+ $self->pidl_hdr("static PyTypeObject $name\_Type;");
$self->pidl("");
my $docstring = $self->DocString($fn, $name);
my $typeobject = "$name\_Type";
@@ -1357,7 +1357,7 @@ sub PythonType($$$$)
$self->pidl("");
$self->pidl("");
- $self->pidl_hdr("static PyTypeObject $typeobject;\n");
+ $self->pidl_hdr("static PyTypeObject $typeobject;");
$self->pidl("static PyTypeObject $typeobject = {");
$self->indent;
$self->pidl("PyVarObject_HEAD_INIT(NULL, 0)");
@@ -1412,7 +1412,7 @@ sub Interface($$$)
}
if (defined $interface->{PROPERTIES}->{uuid}) {
- $self->pidl_hdr("static PyTypeObject $interface->{NAME}_InterfaceType;\n");
+ $self->pidl_hdr("static PyTypeObject $interface->{NAME}_InterfaceType;");
$self->pidl("");
my @fns = ();
@@ -1545,7 +1545,7 @@ sub Interface($$$)
""]);
}
- $self->pidl_hdr("\n");
+ $self->pidl_hdr("");
}
sub register_module_method($$$$$)
@@ -2387,7 +2387,6 @@ static inline long long ndr_sizeof2intmax(size_t var_size)
return 0;
}
-
");
foreach my $x (@$ndr) {
@@ -2439,7 +2438,7 @@ static inline long long ndr_sizeof2intmax(size_t var_size)
foreach my $h (@{$self->{type_imports}}) {
my $type_var = "$h->{'key'}\_Type";
my $module_path = $h->{'val'};
- $self->pidl_hdr("static PyTypeObject *$type_var;\n");
+ $self->pidl_hdr("static PyTypeObject *$type_var;");
my $pretty_name = PrettifyTypeName($h->{'key'}, $module_path);
my $module_var = "dep_$module_path";
$module_var =~ s/\./_/g;