[Python-checkins] python/dist/src/Objects unicodeobject.c, 2.210,
2.211
perky at users.sourceforge.net
perky at users.sourceforge.net
Tue Apr 6 03:24:53 EDT 2004
Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16466/Objects
Modified Files:
unicodeobject.c
Log Message:
SF Patch #926375: Remove a useless UTF-16 support code that is never
been used. (Suggested by Martin v. Loewis)
Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.210
retrieving revision 2.211
diff -C2 -d -r2.210 -r2.211
*** unicodeobject.c 5 Feb 2004 17:35:59 -0000 2.210
--- unicodeobject.c 6 Apr 2004 07:24:51 -0000 2.211
***************
*** 406,410 ****
PyObject *PyUnicode_FromOrdinal(int ordinal)
{
! Py_UNICODE s[2];
#ifdef Py_UNICODE_WIDE
--- 406,410 ----
PyObject *PyUnicode_FromOrdinal(int ordinal)
{
! Py_UNICODE s[1];
#ifdef Py_UNICODE_WIDE
***************
*** 424,444 ****
#endif
! if (ordinal <= 0xffff) {
! /* UCS-2 character */
! s[0] = (Py_UNICODE) ordinal;
! return PyUnicode_FromUnicode(s, 1);
! }
! else {
! #ifndef Py_UNICODE_WIDE
! /* UCS-4 character. store as two surrogate characters */
! ordinal -= 0x10000L;
! s[0] = 0xD800 + (Py_UNICODE) (ordinal >> 10);
! s[1] = 0xDC00 + (Py_UNICODE) (ordinal & 0x03FF);
! return PyUnicode_FromUnicode(s, 2);
! #else
! s[0] = (Py_UNICODE)ordinal;
! return PyUnicode_FromUnicode(s, 1);
! #endif
! }
}
--- 424,429 ----
#endif
! s[0] = (Py_UNICODE)ordinal;
! return PyUnicode_FromUnicode(s, 1);
}
More information about the Python-checkins
mailing list