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
4a264fb0
Kaydet (Commit)
4a264fb0
authored
Ara 19, 2003
tarafından
Hye-Shik Chang
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF #859573: Reduce compiler warnings on gcc 3.2 and above.
üst
8d2e08dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
unicodeobject.c
Objects/unicodeobject.c
+14
-1
No files found.
Objects/unicodeobject.c
Dosyayı görüntüle @
4a264fb0
...
...
@@ -1556,7 +1556,11 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
{
PyObject
*
v
;
unsigned
char
*
p
;
#ifdef Py_UNICODE_WIDE
int
i
,
pairs
;
#else
const
int
pairs
=
0
;
#endif
/* Offsets from p for storing byte pairs in the right order. */
#ifdef BYTEORDER_IS_LITTLE_ENDIAN
int
ihi
=
1
,
ilo
=
0
;
...
...
@@ -1571,9 +1575,11 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
p += 2; \
} while(0)
#ifdef Py_UNICODE_WIDE
for
(
i
=
pairs
=
0
;
i
<
size
;
i
++
)
if
(
s
[
i
]
>=
0x10000
)
pairs
++
;
#endif
v
=
PyString_FromStringAndSize
(
NULL
,
2
*
(
size
+
pairs
+
(
byteorder
==
0
)));
if
(
v
==
NULL
)
...
...
@@ -1599,10 +1605,12 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
while
(
size
--
>
0
)
{
Py_UNICODE
ch
=
*
s
++
;
Py_UNICODE
ch2
=
0
;
#ifdef Py_UNICODE_WIDE
if
(
ch
>=
0x10000
)
{
ch2
=
0xDC00
|
((
ch
-
0x10000
)
&
0x3FF
);
ch
=
0xD800
|
((
ch
-
0x10000
)
>>
10
);
}
#endif
STORECHAR
(
ch
);
if
(
ch2
)
STORECHAR
(
ch2
);
...
...
@@ -2203,7 +2211,7 @@ PyObject *PyUnicode_DecodeLatin1(const char *s,
Py_UNICODE
*
p
;
/* Latin-1 is equivalent to the first 256 ordinals in Unicode. */
if
(
size
==
1
&&
*
(
unsigned
char
*
)
s
<
256
)
{
if
(
size
==
1
)
{
Py_UNICODE
r
=
*
(
unsigned
char
*
)
s
;
return
PyUnicode_FromUnicode
(
&
r
,
1
);
}
...
...
@@ -2405,6 +2413,10 @@ static PyObject *unicode_encode_ucs1(const Py_UNICODE *p,
repsize
+=
2
+
2
+
1
;
else
if
(
*
p
<
1000
)
repsize
+=
2
+
3
+
1
;
#ifndef Py_UNICODE_WIDE
else
repsize
+=
2
+
4
+
1
;
#else
else
if
(
*
p
<
10000
)
repsize
+=
2
+
4
+
1
;
else
if
(
*
p
<
100000
)
...
...
@@ -2413,6 +2425,7 @@ static PyObject *unicode_encode_ucs1(const Py_UNICODE *p,
repsize
+=
2
+
6
+
1
;
else
repsize
+=
2
+
7
+
1
;
#endif
}
requiredsize
=
respos
+
repsize
+
(
endp
-
collend
);
if
(
requiredsize
>
ressize
)
{
...
...
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