[Python-checkins] cpython: Mark PyUnicode_FromUCS[124] as private

victor.stinner python-checkins at python.org
Wed Sep 28 22:20:38 CEST 2011


http://hg.python.org/cpython/rev/347fb9006c6f
changeset: 72500:347fb9006c6f
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Wed Sep 28 22:20:48 2011 +0200
summary:
 Mark PyUnicode_FromUCS[124] as private
files:
 Objects/stringlib/ucs1lib.h | 2 +-
 Objects/stringlib/ucs2lib.h | 2 +-
 Objects/stringlib/ucs4lib.h | 2 +-
 Objects/unicodeobject.c | 20 ++++++++++----------
 4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Objects/stringlib/ucs1lib.h b/Objects/stringlib/ucs1lib.h
--- a/Objects/stringlib/ucs1lib.h
+++ b/Objects/stringlib/ucs1lib.h
@@ -19,7 +19,7 @@
 #define STRINGLIB_FILL Py_UNICODE_FILL
 #define STRINGLIB_STR PyUnicode_1BYTE_DATA
 #define STRINGLIB_LEN PyUnicode_GET_LENGTH
-#define STRINGLIB_NEW PyUnicode_FromUCS1
+#define STRINGLIB_NEW _PyUnicode_FromUCS1
 #define STRINGLIB_RESIZE not_supported
 #define STRINGLIB_CHECK PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
diff --git a/Objects/stringlib/ucs2lib.h b/Objects/stringlib/ucs2lib.h
--- a/Objects/stringlib/ucs2lib.h
+++ b/Objects/stringlib/ucs2lib.h
@@ -19,7 +19,7 @@
 #define STRINGLIB_FILL Py_UNICODE_FILL
 #define STRINGLIB_STR PyUnicode_1BYTE_DATA
 #define STRINGLIB_LEN PyUnicode_GET_LENGTH
-#define STRINGLIB_NEW PyUnicode_FromUCS2
+#define STRINGLIB_NEW _PyUnicode_FromUCS2
 #define STRINGLIB_RESIZE not_supported
 #define STRINGLIB_CHECK PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
diff --git a/Objects/stringlib/ucs4lib.h b/Objects/stringlib/ucs4lib.h
--- a/Objects/stringlib/ucs4lib.h
+++ b/Objects/stringlib/ucs4lib.h
@@ -19,7 +19,7 @@
 #define STRINGLIB_FILL Py_UNICODE_FILL
 #define STRINGLIB_STR PyUnicode_1BYTE_DATA
 #define STRINGLIB_LEN PyUnicode_GET_LENGTH
-#define STRINGLIB_NEW PyUnicode_FromUCS4
+#define STRINGLIB_NEW _PyUnicode_FromUCS4
 #define STRINGLIB_RESIZE not_supported
 #define STRINGLIB_CHECK PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1117,8 +1117,8 @@
 return PyUnicode_FromStringAndSize(u, size);
 }
 
-PyObject*
-PyUnicode_FromUCS1(const unsigned char* u, Py_ssize_t size)
+static PyObject*
+_PyUnicode_FromUCS1(const unsigned char* u, Py_ssize_t size)
 {
 PyObject *res;
 unsigned char max = 127;
@@ -1136,8 +1136,8 @@
 return res;
 }
 
-PyObject*
-PyUnicode_FromUCS2(const Py_UCS2 *u, Py_ssize_t size)
+static PyObject*
+_PyUnicode_FromUCS2(const Py_UCS2 *u, Py_ssize_t size)
 {
 PyObject *res;
 Py_UCS2 max = 0;
@@ -1156,8 +1156,8 @@
 return res;
 }
 
-PyObject*
-PyUnicode_FromUCS4(const Py_UCS4 *u, Py_ssize_t size)
+static PyObject*
+_PyUnicode_FromUCS4(const Py_UCS4 *u, Py_ssize_t size)
 {
 PyObject *res;
 Py_UCS4 max = 0;
@@ -1184,11 +1184,11 @@
 {
 switch(kind) {
 case PyUnicode_1BYTE_KIND:
- return PyUnicode_FromUCS1(buffer, size);
+ return _PyUnicode_FromUCS1(buffer, size);
 case PyUnicode_2BYTE_KIND:
- return PyUnicode_FromUCS2(buffer, size);
+ return _PyUnicode_FromUCS2(buffer, size);
 case PyUnicode_4BYTE_KIND:
- return PyUnicode_FromUCS4(buffer, size);
+ return _PyUnicode_FromUCS4(buffer, size);
 }
 assert(0);
 return NULL;
@@ -5645,7 +5645,7 @@
 		 const char *errors)
 {
 /* Latin-1 is equivalent to the first 256 ordinals in Unicode. */
- return PyUnicode_FromUCS1((unsigned char*)s, size);
+ return _PyUnicode_FromUCS1((unsigned char*)s, size);
 }
 
 /* create or adjust a UnicodeEncodeError */
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /