[PATCH] add missing prototypes to generated python code
Michael Adam
obnox at samba.org
Wed Mar 25 11:08:26 MDT 2015
Brilliant - thanks!
Pushing to autobuild.
Michael
On 2015-03-25 at 17:47 +0100, Guenther Deschner wrote:
> Hi,
>
> please review and push if appropriate.
>
> Thanks,
> Guenther
>
> --
> Günther Deschner GPG-ID: 8EE11688
> Red Hat gdeschner at redhat.com
> Samba Team gd at samba.org
> From 4a0ab10d68fd3f8990ee1a692f6139dc3cb8893d Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
> Date: Wed, 25 Mar 2015 17:38:12 +0100
> Subject: [PATCH] pidl/python: add prototypes into header section of generated
> c-files.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> This stops emmiting hundreds of warnings when compiling with
> -Wmissing-prototypes.
>
> Guenther
>
> Signed-off-by: Günther Deschner <gd at samba.org>
> ---
> pidl/lib/Parse/Pidl/Samba4/Python.pm | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
> index 91201bb..b634137 100644
> --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
> +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
> @@ -645,6 +645,7 @@ sub PythonType($$$$)
>
> if ($actual_ctype->{TYPE} eq "UNION" and defined($actual_ctype->{ELEMENTS})) {
> $self->pidl("PyObject *py_import_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, " .mapTypeName($d) . " *in)");
> + $self->pidl_hdr("PyObject *py_import_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, " .mapTypeName($d) . " *in);\n");
> $self->pidl("{");
> $self->indent;
> $self->FromUnionToPythonFunction("mem_ctx", $actual_ctype, "level", "in") if ($actual_ctype->{TYPE} eq "UNION");
> @@ -653,6 +654,7 @@ sub PythonType($$$$)
> $self->pidl("");
>
> $self->pidl(mapTypeName($d) . " *py_export_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, PyObject *in)");
> + $self->pidl_hdr(mapTypeName($d) . " *py_export_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, PyObject *in);\n");
> $self->pidl("{");
> $self->indent;
> $self->FromPythonToUnionFunction($actual_ctype, mapTypeName($d), "level", "mem_ctx", "in") if ($actual_ctype->{TYPE} eq "UNION");
> --
> 2.1.0
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150325/b8feec11/attachment.pgp>
More information about the samba-technical
mailing list