Rev 2506: Remove unused function definitions. in http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/knit_index_pyrex

John Arbash Meinel john at arbash-meinel.com
Fri Jun 29 18:14:26 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/knit_index_pyrex

------------------------------------------------------------
revno: 2506
revision-id: john at arbash-meinel.com-20070629171416-9vwyxcz9w0xt39z0
parent: john at arbash-meinel.com-20070629163350-pfpsrmoz6edxjdm5
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: knit_index_pyrex
timestamp: Fri 2007-06-29 12:14:16 -0500
message:
  Remove unused function definitions.
  This makes sure that we are only using functions we know that we need.
  The remaining functions should all be safe wrt nulls in the data, etc.
modified:
  bzrlib/_knit_load_data_c.pyx   knit_c.pyx-20070509143944-u42gy8w387a10m0j-1
-------------- next part --------------
=== modified file 'bzrlib/_knit_load_data_c.pyx'
--- a/bzrlib/_knit_load_data_c.pyx	2007-06-29 16:33:50 +0000
+++ b/bzrlib/_knit_load_data_c.pyx	2007-06-29 17:14:16 +0000
@@ -24,7 +24,6 @@
 cdef extern from "stdlib.h":
     ctypedef unsigned size_t
     long int strtol(char *nptr, char **endptr, int base)
-    unsigned long int strtoul(char *nptr, char **endptr, int base)
 
 
 cdef extern from "Python.h":
@@ -33,27 +32,16 @@
     int PyDict_SetItem(object p, object key, object val) except -1
 
     int PyList_Append(object lst, object item) except -1
-    void *PyList_GetItem_object_void "PyList_GET_ITEM" (object lst, int index)
-    object PyList_GET_ITEM (object lst, int index)
+    object PyList_GET_ITEM(object lst, int index)
     int PyList_CheckExact(object)
 
-    int PyTuple_CheckExact(object)
     void *PyTuple_GetItem_void_void "PyTuple_GET_ITEM" (void* tpl, int index)
-    object PyTuple_New(int)
-    int PyTuple_SetItem(object tpl, int offset, object val)
-    void PyTuple_SET_ITEM(object tpl, int offset, object val)
-    object PyTuple_Pack(int n, ...)
 
     char *PyString_AsString(object p)
-    char *PyString_AS_STRING_void "PyString_AS_STRING" (void *p)
-    object PyString_FromString(char *)
     object PyString_FromStringAndSize(char *, int)
     int PyString_Size(object p)
-    int PyString_GET_SIZE_void "PyString_GET_SIZE" (void *p)
-    int PyString_CheckExact(object p)
 
     void Py_INCREF(object)
-    void Py_DECREF(object)
 
 
 cdef extern from "string.h":
@@ -246,6 +234,8 @@
             index = self.history_len
             self.history_len = self.history_len + 1
         else:
+            # PyTuple_GetItem_void_void does *not* increment the reference
+            # counter, but casting to <object> does.
             index = <object>PyTuple_GetItem_void_void(cache_entry, 5)
 
         PyDict_SetItem(self.cache, version_id,



More information about the bazaar-commits mailing list