From: Douglas Bagnall Date: Sat, 30 Nov 2019 11:43:52 +0000 (+1300) Subject: pidl s4::Python: silence warnings X-Git-Tag: ldb-2.1.0~331 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbe402edf55cc4dda8820645c7c4e20862969803;p=thirdparty%2Fsamba.git pidl s4::Python: silence warnings - do not redeclare variables in the same scope. - use $1 instead of \1, which perl just prefers. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 6f5bc69f3b8..84d4dade512 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -38,7 +38,7 @@ sub PrettifyTypeName($$) { my ($name, $basename) = @_; - $basename =~ s/^.*\.([^.]+)$/\1/; + $basename =~ s/^.*\.([^.]+)$/$1/; $name =~ s/^$basename\_//; @@ -190,7 +190,6 @@ sub PythonElementGetSet($$$$$$) { $self->indent; $self->pidl("$cname *object = ($cname *)pytalloc_get_ptr(py_obj);"); my $mem_ctx = "pytalloc_get_mem_ctx(py_obj)"; - my $l = $e->{LEVELS}[0]; my $nl = GetNextLevel($e, $l); if ($l->{TYPE} eq "POINTER" and not ($nl->{TYPE} eq "ARRAY" and ($nl->{IS_FIXED} or is_charset_array($e, $nl))) and @@ -1479,9 +1478,9 @@ sub Interface($$$) $self->pidl(""); - my $signature = "\"$interface->{NAME}_abstract_syntax()\\n\""; + $signature = "\"$interface->{NAME}_abstract_syntax()\\n\""; - my $docstring = $self->DocString($interface, $interface->{NAME}."_syntax"); + $docstring = $self->DocString($interface, $interface->{NAME}."_syntax"); if ($docstring) { $docstring = "$signature$docstring";