[Python-checkins] cpython: Fix a compiler warning in _copy_characters() and remove debug code

victor.stinner python-checkins at python.org
Sat Jun 16 04:56:15 CEST 2012


http://hg.python.org/cpython/rev/34a6a233cfcc
changeset:   77466:34a6a233cfcc
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Jun 16 04:53:25 2012 +0200
summary:
  Fix a compiler warning in _copy_characters() and remove debug code

files:
  Objects/unicodeobject.c |  11 +----------
  1 files changed, 1 insertions(+), 10 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1156,7 +1156,7 @@
             if (check_maxchar) {
                 Py_UCS4 max_char;
                 max_char = ucs1lib_find_max_char(from_data,
-                                                 (char*)from_data + how_many);
+                                                 (Py_UCS1*)from_data + how_many);
                 if (max_char >= 128)
                     return -1;
             }
@@ -3860,11 +3860,6 @@
     return PyUnicode_AsUTF8AndSize(unicode, NULL);
 }
 
-#ifdef Py_DEBUG
-static int unicode_as_unicode_calls = 0;
-#endif
-
-
 Py_UNICODE *
 PyUnicode_AsUnicodeAndSize(PyObject *unicode, Py_ssize_t *size)
 {
@@ -3888,10 +3883,6 @@
         assert(_PyUnicode_KIND(unicode) != 0);
         assert(PyUnicode_IS_READY(unicode));
 
-#ifdef Py_DEBUG
-        ++unicode_as_unicode_calls;
-#endif
-
         if (PyUnicode_KIND(unicode) == PyUnicode_4BYTE_KIND) {
 #if SIZEOF_WCHAR_T == 2
             four_bytes = PyUnicode_4BYTE_DATA(unicode);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list