From: Andrew Bartlett Date: Mon, 29 Feb 2016 20:33:48 +0000 (+1300) Subject: pyregistry: Use pytalloc_BaseObject_PyType_Ready() X-Git-Tag: talloc-2.1.6~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d348c443a92dfe9bdad73d36c0303a765468870;p=thirdparty%2Fsamba.git pyregistry: Use pytalloc_BaseObject_PyType_Ready() This changes pyregistry to use talloc.BaseObject() just like the PIDL output Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index 7b7fdf34f73..78a0b1dc414 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -160,7 +160,6 @@ PyTypeObject PyRegistry = { .tp_name = "Registry", .tp_methods = registry_methods, .tp_new = registry_new, - .tp_basicsize = sizeof(pytalloc_Object), .tp_flags = Py_TPFLAGS_DEFAULT, }; @@ -300,13 +299,11 @@ PyTypeObject PyHiveKey = { .tp_name = "HiveKey", .tp_methods = hive_key_methods, .tp_new = hive_new, - .tp_basicsize = sizeof(pytalloc_Object), .tp_flags = Py_TPFLAGS_DEFAULT, }; PyTypeObject PyRegistryKey = { .tp_name = "RegistryKey", - .tp_basicsize = sizeof(pytalloc_Object), .tp_flags = Py_TPFLAGS_DEFAULT, }; @@ -444,22 +441,14 @@ static PyMethodDef py_registry_methods[] = { void initregistry(void) { PyObject *m; - PyTypeObject *talloc_type = pytalloc_GetObjectType(); - if (talloc_type == NULL) + if (pytalloc_BaseObject_PyType_Ready(&PyHiveKey) < 0) return; - PyHiveKey.tp_base = talloc_type; - PyRegistry.tp_base = talloc_type; - PyRegistryKey.tp_base = talloc_type; - - if (PyType_Ready(&PyHiveKey) < 0) - return; - - if (PyType_Ready(&PyRegistry) < 0) + if (pytalloc_BaseObject_PyType_Ready(&PyRegistry) < 0) return; - if (PyType_Ready(&PyRegistryKey) < 0) + if (pytalloc_BaseObject_PyType_Ready(&PyRegistryKey) < 0) return; m = Py_InitModule3("registry", py_registry_methods, "Registry");