diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-05 14:00:12 -0600 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-01-05 08:06:05 -0600 |
commit | d0e9c92e57915920a77496e828c9da6cd87f0a8d (patch) | |
tree | 7730ef59330ab3732134eb1c27280f7384c31c1a /source4/pidl | |
parent | e652fc802a13ead5e3b0ef7c2b4a6976ab0e1ec6 (diff) | |
download | samba-d0e9c92e57915920a77496e828c9da6cd87f0a8d.tar.gz samba-d0e9c92e57915920a77496e828c9da6cd87f0a8d.tar.bz2 samba-d0e9c92e57915920a77496e828c9da6cd87f0a8d.zip |
r26667: pidl/python: Don't generate casts anymore; this will generate warnings with older Pythons, but will be a lot cleaner with newer versions.
(This used to be commit 7db3222dace7071e3d74fc34b86d571a0f3badea)
Diffstat (limited to 'source4/pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm index 874e7f8346..8effff9d5e 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -123,11 +123,11 @@ sub TypeConstructor($$) $self->pidl("static PyTypeObject $type->{NAME}_ObjectType = {"); $self->indent; $self->pidl("PyObject_HEAD_INIT(NULL) 0,"); - $self->pidl(".tp_name = (char *)\"$type->{NAME}\","); + $self->pidl(".tp_name = \"$type->{NAME}\","); $self->pidl(".tp_basicsize = sizeof($type->{NAME}_Object),"); - $self->pidl(".tp_dealloc = py_$type->{NAME}_dealloc,"); - $self->pidl(".tp_getattr = py_$type->{NAME}_getattr,"); - $self->pidl(".tp_setattr = py_$type->{NAME}_setattr,"); + $self->pidl(".tp_dealloc = (destructor)py_$type->{NAME}_dealloc,"); + $self->pidl(".tp_getattr = (getattrfunc)py_$type->{NAME}_getattr,"); + $self->pidl(".tp_setattr = (setattrfunc)py_$type->{NAME}_setattr,"); $self->deindent; $self->pidl("};"); @@ -219,7 +219,7 @@ sub Interface($$) $fn_name =~ s/^$interface->{NAME}_//; - $self->pidl("{ (char *)\"$fn_name\", (PyCFunction)py_$d->{NAME}, METH_VARARGS|METH_KEYWORDS, NULL },"); + $self->pidl("{ \"$fn_name\", (PyCFunction)py_$d->{NAME}, METH_VARARGS|METH_KEYWORDS, NULL },"); } $self->pidl("{ NULL, NULL, 0, NULL }"); $self->deindent; @@ -248,7 +248,7 @@ sub Interface($$) $self->pidl("static PyTypeObject $interface->{NAME}_InterfaceType = {"); $self->indent; $self->pidl("PyObject_HEAD_INIT(NULL) 0,"); - $self->pidl(".tp_name = (char *)\"$interface->{NAME}\","); + $self->pidl(".tp_name = \"$interface->{NAME}\","); $self->pidl(".tp_basicsize = sizeof($interface->{NAME}_InterfaceObject),"); $self->pidl(".tp_dealloc = interface_$interface->{NAME}_dealloc,"); $self->pidl(".tp_getattr = interface_$interface->{NAME}_getattr,"); @@ -313,7 +313,7 @@ sub Parse($$$$) $self->indent; foreach my $x (@$ndr) { next if ($x->{TYPE} ne "INTERFACE"); - $self->pidl("{ (char *)\"$x->{NAME}\", (PyCFunction)interface_$x->{NAME}, METH_VARARGS|METH_KEYWORDS, NULL },"); + $self->pidl("{ \"$x->{NAME}\", (PyCFunction)interface_$x->{NAME}, METH_VARARGS|METH_KEYWORDS, NULL },"); foreach my $d (@{$x->{TYPES}}) { next if has_property($d, "nopython"); @@ -324,7 +324,7 @@ sub Parse($$$$) $fn_name =~ s/^$x->{NAME}_//; $fn_name =~ s/^$basename\_//; - $self->pidl("{ (char *)\"$fn_name\", (PyCFunction)py_$d->{NAME}, METH_VARARGS|METH_KEYWORDS, NULL },"); + $self->pidl("{ \"$fn_name\", (PyCFunction)py_$d->{NAME}, METH_VARARGS|METH_KEYWORDS, NULL },"); } } @@ -338,7 +338,7 @@ sub Parse($$$$) $self->pidl("{"); $self->indent; $self->pidl("PyObject *m;"); - $self->pidl("m = Py_InitModule((char *)\"$basename\", $basename\_methods);"); + $self->pidl("m = Py_InitModule(\"$basename\", $basename\_methods);"); foreach (keys %{$self->{constants}}) { # FIXME: Handle non-string constants $self->pidl("PyModule_AddObject(m, \"$_\", PyString_FromString(" . $self->{constants}->{$_}->[1] . "));"); |