Rev 5239: (Martin <gz>) Some cleanups for the zlib.crc32 changes in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue May 18 21:27:30 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5239 [merge]
revision-id: pqm at pqm.ubuntu.com-20100518202726-u271nwe9lgx2inoo
parent: pqm at pqm.ubuntu.com-20100518024615-dmqzcnicw5p48k53
parent: gzlist at googlemail.com-20100516151843-lu53u7caehm3ie3i
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-05-18 21:27:26 +0100
message:
  (Martin <gz>) Some cleanups for the zlib.crc32 changes
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/_chk_map_pyx.pyx        _chk_map_pyx.pyx-20090309111231-peyz7p2azr0dzdrb-1
=== modified file 'NEWS'
--- a/NEWS	2010-05-14 09:02:35 +0000
+++ b/NEWS	2010-05-16 15:18:43 +0000
@@ -203,6 +203,10 @@
   stripped, the prefix ``__doc__ =`` should now be used.
   (Martin <gzlist at googlemail.com>)
 
+* No longer require zlib headers to build extensions, and remove the need
+  for seperate copy of zlib library on windows.
+  (John Arbash Meinel, Martin <gzlist at googlemail.com>, #66923)
+
 Testing
 *******
 

=== modified file 'bzrlib/_chk_map_pyx.pyx'
--- a/bzrlib/_chk_map_pyx.pyx	2010-05-11 15:59:12 +0000
+++ b/bzrlib/_chk_map_pyx.pyx	2010-05-16 15:18:43 +0000
@@ -38,21 +38,13 @@
     PyObject *PyString_FromStringAndSize_ptr "PyString_FromStringAndSize" (char *, Py_ssize_t)
     Py_ssize_t PyString_GET_SIZE(object)
     void PyString_InternInPlace(PyObject **)
-    unsigned long PyInt_AsUnsignedLongMask(object) except? -1
+    long PyInt_AS_LONG(object)
 
     int PyDict_SetItem(object d, object k, object v) except -1
 
-    object PyTuple_New(Py_ssize_t count)
-    void PyTuple_SET_ITEM(object t, Py_ssize_t offset, object)
-
     void Py_INCREF(object)
     void Py_DECREF_ptr "Py_DECREF" (PyObject *)
 
-    PyObject * PyTuple_GET_ITEM_ptr "PyTuple_GET_ITEM" (object t,
-                                                        Py_ssize_t offset)
-    int PyString_CheckExact_ptr "PyString_CheckExact" (PyObject *p)
-    Py_ssize_t PyString_GET_SIZE_ptr "PyString_GET_SIZE" (PyObject *s)
-    char *PyString_AS_STRING_ptr "PyString_AS_STRING" (PyObject *s)
     object PyString_FromStringAndSize(char*, Py_ssize_t)
 
 # cimport all of the definitions we will need to access
@@ -61,13 +53,6 @@
     StaticTuple_Intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact, \
     StaticTuple_GET_SIZE
 
-cdef extern from "_static_tuple_c.h":
-    # Defined explicitly rather than cimport-ing. Trying to use cimport, the
-    # type for PyObject is a different class that happens to have the same
-    # name...
-    PyObject * StaticTuple_GET_ITEM_ptr "StaticTuple_GET_ITEM" (StaticTuple,
-                                                                Py_ssize_t)
-
 cdef object crc32
 from zlib import crc32
 
@@ -130,7 +115,7 @@
         if i > 0:
             c_out[0] = c'\x00'
             c_out = c_out + 1
-        crc_val = PyInt_AsUnsignedLongMask(crc32(key[i]))
+        crc_val = PyInt_AS_LONG(crc32(key[i]))
         # Hex(val) order
         sprintf(c_out, '%08X', crc_val)
         c_out = c_out + 8
@@ -155,7 +140,7 @@
         if i > 0:
             c_out[0] = c'\x00'
             c_out = c_out + 1
-        crc_val = PyInt_AsUnsignedLongMask(crc32(key[i]))
+        crc_val = PyInt_AS_LONG(crc32(key[i]))
         # MSB order
         c_out[0] = (crc_val >> 24) & 0xFF
         c_out[1] = (crc_val >> 16) & 0xFF




More information about the bazaar-commits mailing list