Rev 4738: Capitolize StaticTuple_Intern to conform more to the python C apis. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple
John Arbash Meinel
john at arbash-meinel.com
Fri Oct 2 16:51:09 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple
------------------------------------------------------------
revno: 4738
revision-id: john at arbash-meinel.com-20091002155103-6wgtx9aosbx99m77
parent: john at arbash-meinel.com-20091002054124-pbt81bw3utkr5ufu
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-static-tuple
timestamp: Fri 2009-10-02 10:51:03 -0500
message:
Capitolize StaticTuple_Intern to conform more to the python C apis.
-------------- next part --------------
=== modified file 'bzrlib/_btree_serializer_pyx.pyx'
--- a/bzrlib/_btree_serializer_pyx.pyx 2009-10-01 20:57:55 +0000
+++ b/bzrlib/_btree_serializer_pyx.pyx 2009-10-02 15:51:03 +0000
@@ -61,7 +61,7 @@
# local names to access them.
from _static_tuple_c cimport StaticTuple, \
import_static_tuple_c, STATIC_TUPLE_ALL_STRING, StaticTuple_New, \
- StaticTuple_intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact
+ StaticTuple_Intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact
# TODO: Find some way to import this from _dirstate_helpers
@@ -187,7 +187,7 @@
Py_INCREF(key_element)
StaticTuple_SET_ITEM(key, loop_counter, key_element)
# key->flags = key->flags | STATIC_TUPLE_ALL_STRING
- key = StaticTuple_intern(key)
+ key = StaticTuple_Intern(key)
return key
cdef int process_line(self) except -1:
@@ -272,7 +272,7 @@
# key runs to the end
temp_ptr = ref_ptr
PyList_Append(ref_list, self.extract_key(temp_ptr))
- ref_list = StaticTuple_intern(StaticTuple(*ref_list))
+ ref_list = StaticTuple_Intern(StaticTuple(*ref_list))
PyList_Append(ref_lists, ref_list)
# prepare for the next reference list
self._start = next_start
=== modified file 'bzrlib/_chk_map_pyx.pyx'
--- a/bzrlib/_chk_map_pyx.pyx 2009-10-01 20:57:55 +0000
+++ b/bzrlib/_chk_map_pyx.pyx 2009-10-02 15:51:03 +0000
@@ -63,7 +63,7 @@
# local names to access them.
from _static_tuple_c cimport StaticTuple,\
import_static_tuple_c, STATIC_TUPLE_ALL_STRING, StaticTuple_New, \
- StaticTuple_intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact
+ StaticTuple_Intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact
from bzrlib import _static_tuple_c
@@ -323,7 +323,7 @@
raise AssertionError(
'Incorrect number of elements (%d vs %d)'
% (len(entry_bits)+1, width + 1))
- entry_bits = StaticTuple_intern(entry_bits)
+ entry_bits = StaticTuple_Intern(entry_bits)
PyDict_SetItem(items, entry_bits, value)
if len(items) != length:
raise ValueError("item count (%d) mismatch for key %s,"
=== modified file 'bzrlib/_static_tuple_c.c'
--- a/bzrlib/_static_tuple_c.c 2009-10-02 05:38:35 +0000
+++ b/bzrlib/_static_tuple_c.c 2009-10-02 15:51:03 +0000
@@ -71,7 +71,7 @@
static char StaticTuple_as_tuple_doc[] = "as_tuple() => tuple";
static StaticTuple *
-StaticTuple_intern(StaticTuple *self)
+StaticTuple_Intern(StaticTuple *self)
{
PyObject *unique_key = NULL;
@@ -106,7 +106,7 @@
return self;
}
-static char StaticTuple_intern_doc[] = "intern() => unique StaticTuple\n"
+static char StaticTuple_Intern_doc[] = "intern() => unique StaticTuple\n"
"Return a 'canonical' StaticTuple object.\n"
"Similar to intern() for strings, this makes sure there\n"
"is only one StaticTuple object for a given value\n."
@@ -545,7 +545,7 @@
static PyMethodDef StaticTuple_methods[] = {
{"as_tuple", (PyCFunction)StaticTuple_as_tuple, METH_NOARGS, StaticTuple_as_tuple_doc},
- {"intern", (PyCFunction)StaticTuple_intern, METH_NOARGS, StaticTuple_intern_doc},
+ {"intern", (PyCFunction)StaticTuple_Intern, METH_NOARGS, StaticTuple_Intern_doc},
{"_is_interned", (PyCFunction)StaticTuple__is_interned, METH_NOARGS,
StaticTuple__is_interned_doc},
{NULL, NULL} /* sentinel */
@@ -709,7 +709,7 @@
// We need to create the empty tuple
stuple = (StaticTuple *)StaticTuple_New(0);
stuple->flags = STATIC_TUPLE_ALL_STRING;
- _empty_tuple = StaticTuple_intern(stuple);
+ _empty_tuple = StaticTuple_Intern(stuple);
assert(_empty_tuple == stuple);
// At this point, refcnt is 2: 1 from New(), and 1 from the return from
// intern(). We will keep 1 for the _empty_tuple global, and use the other
@@ -728,7 +728,7 @@
{
_export_function(m, "StaticTuple_New", StaticTuple_New,
"StaticTuple *(Py_ssize_t)");
- _export_function(m, "StaticTuple_intern", StaticTuple_intern,
+ _export_function(m, "StaticTuple_Intern", StaticTuple_Intern,
"StaticTuple *(StaticTuple *)");
_export_function(m, "_StaticTuple_CheckExact", _StaticTuple_CheckExact,
"int(PyObject *)");
=== modified file 'bzrlib/_static_tuple_c.h'
--- a/bzrlib/_static_tuple_c.h 2009-10-01 21:34:36 +0000
+++ b/bzrlib/_static_tuple_c.h 2009-10-02 15:51:03 +0000
@@ -75,7 +75,7 @@
/* Used when compiling _static_tuple_c.c */
static StaticTuple * StaticTuple_New(Py_ssize_t);
-static StaticTuple * StaticTuple_intern(StaticTuple *self);
+static StaticTuple * StaticTuple_Intern(StaticTuple *self);
#define StaticTuple_CheckExact(op) (Py_TYPE(op) == &StaticTuple_Type)
#else
@@ -84,7 +84,7 @@
#include "_import_c_api.h"
static StaticTuple *(*StaticTuple_New)(Py_ssize_t);
-static StaticTuple *(*StaticTuple_intern)(StaticTuple *);
+static StaticTuple *(*StaticTuple_Intern)(StaticTuple *);
static PyTypeObject *_p_StaticTuple_Type;
#define StaticTuple_CheckExact(op) (Py_TYPE(op) == _p_StaticTuple_Type)
@@ -98,7 +98,7 @@
struct function_description functions[] = {
{"StaticTuple_New", (void **)&StaticTuple_New,
"StaticTuple *(Py_ssize_t)"},
- {"StaticTuple_intern", (void **)&StaticTuple_intern,
+ {"StaticTuple_Intern", (void **)&StaticTuple_Intern,
"StaticTuple *(StaticTuple *)"},
{"_StaticTuple_CheckExact", (void **)&_StaticTuple_CheckExact,
"int(PyObject *)"},
=== modified file 'bzrlib/_static_tuple_c.pxd'
--- a/bzrlib/_static_tuple_c.pxd 2009-10-01 20:57:55 +0000
+++ b/bzrlib/_static_tuple_c.pxd 2009-10-02 15:51:03 +0000
@@ -38,7 +38,7 @@
int STATIC_TUPLE_ALL_STRING
StaticTuple StaticTuple_New(Py_ssize_t)
- StaticTuple StaticTuple_intern(StaticTuple)
+ StaticTuple StaticTuple_Intern(StaticTuple)
# Steals a reference and Val must be a PyStringObject, no checking is done
void StaticTuple_SET_ITEM(StaticTuple key, Py_ssize_t offset, object val)
object StaticTuple_GET_ITEM(StaticTuple key, Py_ssize_t offset)
More information about the bazaar-commits
mailing list