pytalloc: Make py_talloc_default_cmp private.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 30 Nov 2010 23:19:37 +0000 (00:19 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 1 Dec 2010 00:48:25 +0000 (01:48 +0100)
lib/talloc/pytalloc.c
lib/talloc/pytalloc.h
lib/talloc/pytalloc_util.c

index c45810f44dfccade17958a9de6bc952d2be4e0bb..262ba493c5ba96036dccc923dab485a16905cf7d 100644 (file)
@@ -97,6 +97,21 @@ static void py_talloc_dealloc(PyObject* self)
        self->ob_type->tp_free(self);
 }
 
+/**
+ * Default (but only slightly more useful than the default) implementation of cmp.
+ */
+static int py_talloc_default_cmp(PyObject *_obj1, PyObject *_obj2)
+{
+       py_talloc_Object *obj1 = (py_talloc_Object *)_obj1,
+                                        *obj2 = (py_talloc_Object *)_obj2;
+       if (obj1->ob_type != obj2->ob_type)
+               return (obj1->ob_type - obj2->ob_type);
+
+       return ((char *)py_talloc_get_ptr(obj1) - (char *)py_talloc_get_ptr(obj2));
+}
+
+
+
 static PyTypeObject TallocObject_Type = {
        .tp_name = "talloc.Object",
        .tp_basicsize = sizeof(py_talloc_Object),
index affb77ce9a0ee1d891c1b5ee55ba8989f8cef901..bfd9c2e01757754ac4eeb6f0f32ffc9516834cd7 100644 (file)
@@ -52,6 +52,5 @@ PyObject *py_talloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, voi
 PyObject *PyCObject_FromTallocPtr(void *);
 
 PyObject *PyString_FromString_check_null(const char *ptr);
-int py_talloc_default_cmp(PyObject *obj1, PyObject *obj2);
 
 #endif /* _PY_TALLOC_H_ */
index 4ed2f16b2487b1f2afec5a313d2635a2d6f762dd..d082ee89e7d8f18d01dede1451f86aa50c15167d 100644 (file)
@@ -97,19 +97,6 @@ PyObject *py_talloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, voi
        return (PyObject *)ret;
 }
 
-/**
- * Default (but only slightly more useful than the default) implementation of cmp.
- */
-int py_talloc_default_cmp(PyObject *_obj1, PyObject *_obj2)
-{
-       py_talloc_Object *obj1 = (py_talloc_Object *)_obj1,
-                                        *obj2 = (py_talloc_Object *)_obj2;
-       if (obj1->ob_type != obj2->ob_type)
-               return (obj1->ob_type - obj2->ob_type);
-
-       return ((char *)py_talloc_get_ptr(obj1) - (char *)py_talloc_get_ptr(obj2));
-}
-
 static void py_cobject_talloc_free(void *ptr)
 {
        talloc_free(ptr);