From: Andrew Bartlett Date: Mon, 29 Feb 2016 20:31:00 +0000 (+1300) Subject: pyparam: Use pytalloc_BaseObject_PyType_Ready() X-Git-Tag: talloc-2.1.6~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43af1905d578ec6f374f1f67f72c37428ecd361f;p=thirdparty%2Fsamba.git pyparam: Use pytalloc_BaseObject_PyType_Ready() This changes pyparam to use talloc.BaseObject() just like the PIDL output Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 7e7f7a072c3..fde91e5886e 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -418,7 +418,6 @@ static PyMappingMethods py_lp_ctx_mapping = { PyTypeObject PyLoadparmContext = { .tp_name = "param.LoadParm", - .tp_basicsize = sizeof(pytalloc_Object), .tp_getset = py_lp_ctx_getset, .tp_methods = py_lp_ctx_methods, .tp_new = py_lp_ctx_new, @@ -464,7 +463,6 @@ static PyMethodDef py_lp_service_methods[] = { PyTypeObject PyLoadparmService = { .tp_name = "param.LoadparmService", - .tp_basicsize = sizeof(pytalloc_Object), .tp_methods = py_lp_service_methods, .tp_flags = Py_TPFLAGS_DEFAULT, }; @@ -511,17 +509,11 @@ static PyMethodDef pyparam_methods[] = { void initparam(void) { PyObject *m; - PyTypeObject *talloc_type = pytalloc_GetObjectType(); - if (talloc_type == NULL) - return; - - PyLoadparmContext.tp_base = talloc_type; - PyLoadparmService.tp_base = talloc_type; - if (PyType_Ready(&PyLoadparmContext) < 0) + if (pytalloc_BaseObject_PyType_Ready(&PyLoadparmContext) < 0) return; - if (PyType_Ready(&PyLoadparmService) < 0) + if (pytalloc_BaseObject_PyType_Ready(&PyLoadparmService) < 0) return; m = Py_InitModule3("param", pyparam_methods, "Parsing and writing Samba configuration files.");