Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c53be96c
Kaydet (Commit)
c53be96c
authored
Eki 02, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unicode_convert_wchar_to_ucs4() cannot fail
üst
c3c74156
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
unicodeobject.c
Objects/unicodeobject.c
+4
-10
No files found.
Objects/unicodeobject.c
Dosyayı görüntüle @
c53be96c
...
...
@@ -590,7 +590,7 @@ PyUnicode_New(Py_ssize_t size, Py_UCS4 maxchar)
This function assumes that unicode can hold one more code point than wstr
characters for a terminating null character. */
static
int
static
void
unicode_convert_wchar_to_ucs4(const wchar_t *begin, const wchar_t *end,
PyUnicodeObject *unicode)
{
...
...
@@ -757,6 +757,7 @@ find_maxchar_surrogates(const wchar_t *begin, const wchar_t *end,
{
const wchar_t *iter;
assert(num_surrogates != NULL && maxchar != NULL);
if (num_surrogates == NULL || maxchar == NULL) {
PyErr_SetString(PyExc_SystemError,
"unexpected NULL arguments to "
...
...
@@ -903,11 +904,7 @@ _PyUnicode_Ready(PyObject *obj)
_PyUnicode_STATE(unicode).kind = PyUnicode_4BYTE_KIND;
_PyUnicode_UTF8(unicode) = NULL;
_PyUnicode_UTF8_LENGTH(unicode) = 0;
if (unicode_convert_wchar_to_ucs4(_PyUnicode_WSTR(unicode), end,
unicode) < 0) {
assert(0 && "ConvertWideCharToUCS4 failed");
return -1;
}
unicode_convert_wchar_to_ucs4(_PyUnicode_WSTR(unicode), end, unicode);
PyObject_FREE(_PyUnicode_WSTR(unicode));
_PyUnicode_WSTR(unicode) = NULL;
_PyUnicode_WSTR_LENGTH(unicode) = 0;
...
...
@@ -1081,10 +1078,7 @@ PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
#if SIZEOF_WCHAR_T == 2
/* This is the only case which has to process surrogates, thus
a simple copy loop is not enough and we need a function. */
if (unicode_convert_wchar_to_ucs4(u, u + size, unicode) < 0) {
Py_DECREF(unicode);
return NULL;
}
unicode_convert_wchar_to_ucs4(u, u + size, unicode);
#else
assert(num_surrogates == 0);
Py_MEMCPY(PyUnicode_4BYTE_DATA(unicode), u, size * 4);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment