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
c47adb04
Kaydet (Commit)
c47adb04
authored
Eki 07, 2011
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE.
üst
dd07732a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
76 deletions
+39
-76
unicode.rst
Doc/c-api/unicode.rst
+3
-21
unicodeobject.h
Include/unicodeobject.h
+10
-25
textio.c
Modules/_io/textio.c
+20
-24
_json.c
Modules/_json.c
+2
-2
_sre.c
Modules/_sre.c
+1
-1
eq.h
Objects/stringlib/eq.h
+1
-1
unicodeobject.c
Objects/unicodeobject.c
+0
-0
formatter_unicode.c
Python/formatter_unicode.c
+2
-2
No files found.
Doc/c-api/unicode.rst
Dosyayı görüntüle @
c47adb04
...
@@ -99,7 +99,7 @@ access internal read-only data of Unicode objects:
...
@@ -99,7 +99,7 @@ access internal read-only data of Unicode objects:
.. deprecated-removed:: 3.3 4.0
.. deprecated-removed:: 3.3 4.0
Part of the old-style Unicode API, please migrate to using
Part of the old-style Unicode API, please migrate to using
:c:func:`PyUnicode_GET_LENGTH`
or :c:func:`PyUnicode_KIND_SIZE`
.
:c:func:`PyUnicode_GET_LENGTH`.
.. c:function:: Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *o)
.. c:function:: Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *o)
...
@@ -149,9 +149,8 @@ access internal read-only data of Unicode objects:
...
@@ -149,9 +149,8 @@ access internal read-only data of Unicode objects:
Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4
Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4
integer types for direct character access. No checks are performed if the
integer types for direct character access. No checks are performed if the
canonical representation has the correct character size; use
canonical representation has the correct character size; use
:c:func:`PyUnicode_CHARACTER_SIZE` or :c:func:`PyUnicode_KIND` to select the
:c:func:`PyUnicode_KIND` to select the right macro. Make sure
right macro. Make sure :c:func:`PyUnicode_READY` has been called before
:c:func:`PyUnicode_READY` has been called before accessing this.
accessing this.
.. versionadded:: 3.3
.. versionadded:: 3.3
...
@@ -176,15 +175,6 @@ access internal read-only data of Unicode objects:
...
@@ -176,15 +175,6 @@ access internal read-only data of Unicode objects:
.. versionadded:: 3.3
.. versionadded:: 3.3
.. c:function:: int PyUnicode_CHARACTER_SIZE(PyObject *o)
Return the number of bytes the string uses to represent single characters;
this can be 1, 2 or 4. *o* has to be a Unicode object in the "canonical"
representation (not checked).
.. versionadded:: 3.3
.. c:function:: void* PyUnicode_DATA(PyObject *o)
.. c:function:: void* PyUnicode_DATA(PyObject *o)
Return a void pointer to the raw unicode buffer. *o* has to be a Unicode
Return a void pointer to the raw unicode buffer. *o* has to be a Unicode
...
@@ -193,14 +183,6 @@ access internal read-only data of Unicode objects:
...
@@ -193,14 +183,6 @@ access internal read-only data of Unicode objects:
.. versionadded:: 3.3
.. versionadded:: 3.3
.. c:function:: int PyUnicode_KIND_SIZE(int kind, Py_ssize_t index)
Compute ``index * char_size`` where ``char_size`` is ``2**(kind - 1)``. The
index is a character index, the result is a size in bytes.
.. versionadded:: 3.3
.. c:function:: void PyUnicode_WRITE(int kind, void *data, Py_ssize_t index, \
.. c:function:: void PyUnicode_WRITE(int kind, void *data, Py_ssize_t index, \
Py_UCS4 value)
Py_UCS4 value)
...
...
Include/unicodeobject.h
Dosyayı görüntüle @
c47adb04
...
@@ -305,12 +305,12 @@ typedef struct {
...
@@ -305,12 +305,12 @@ typedef struct {
* character type = Py_UCS2 (16 bits, unsigned)
* character type = Py_UCS2 (16 bits, unsigned)
* at least one character must be in range U+0100-U+FFFF
* at least one character must be in range U+0100-U+FFFF
- PyUnicode_4BYTE_KIND (
3
):
- PyUnicode_4BYTE_KIND (
4
):
* character type = Py_UCS4 (32 bits, unsigned)
* character type = Py_UCS4 (32 bits, unsigned)
* at least one character must be in range U+10000-U+10FFFF
* at least one character must be in range U+10000-U+10FFFF
*/
*/
unsigned
int
kind
:
2
;
unsigned
int
kind
:
3
;
/* Compact is with respect to the allocation scheme. Compact unicode
/* Compact is with respect to the allocation scheme. Compact unicode
objects only require one memory block while non-compact objects use
objects only require one memory block while non-compact objects use
one block for the PyUnicodeObject struct and another for its data
one block for the PyUnicodeObject struct and another for its data
...
@@ -424,29 +424,21 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
...
@@ -424,29 +424,21 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
#define PyUnicode_IS_COMPACT_ASCII(op) \
#define PyUnicode_IS_COMPACT_ASCII(op) \
(PyUnicode_IS_ASCII(op) && PyUnicode_IS_COMPACT(op))
(PyUnicode_IS_ASCII(op) && PyUnicode_IS_COMPACT(op))
enum
PyUnicode_Kind
{
/* String contains only wstr byte characters. This is only possible
/* String contains only wstr byte characters. This is only possible
when the string was created with a legacy API and _PyUnicode_Ready()
when the string was created with a legacy API and _PyUnicode_Ready()
has not been called yet. */
has not been called yet. */
#define PyUnicode_WCHAR_KIND 0
PyUnicode_WCHAR_KIND
=
0
,
/* Return values of the PyUnicode_KIND() macro: */
/* Return values of the PyUnicode_KIND() macro: */
PyUnicode_1BYTE_KIND
=
1
,
#define PyUnicode_1BYTE_KIND 1
PyUnicode_2BYTE_KIND
=
2
,
#define PyUnicode_2BYTE_KIND 2
PyUnicode_4BYTE_KIND
=
4
#define PyUnicode_4BYTE_KIND 3
};
/* Return the number of bytes the string uses to represent single characters,
this can be 1, 2 or 4.
See also PyUnicode_KIND_SIZE(). */
#define PyUnicode_CHARACTER_SIZE(op) \
(((Py_ssize_t)1 << (PyUnicode_KIND(op) - 1)))
/* Return pointers to the canonical representation cast to unsigned char,
/* Return pointers to the canonical representation cast to unsigned char,
Py_UCS2, or Py_UCS4 for direct character access.
Py_UCS2, or Py_UCS4 for direct character access.
No checks are performed, use PyUnicode_
CHARACTER_SIZE or
No checks are performed, use PyUnicode_
KIND() before to ensure
PyUnicode_KIND() before to ensure
these will work correctly. */
these will work correctly. */
#define PyUnicode_1BYTE_DATA(op) ((Py_UCS1*)PyUnicode_DATA(op))
#define PyUnicode_1BYTE_DATA(op) ((Py_UCS1*)PyUnicode_DATA(op))
#define PyUnicode_2BYTE_DATA(op) ((Py_UCS2*)PyUnicode_DATA(op))
#define PyUnicode_2BYTE_DATA(op) ((Py_UCS2*)PyUnicode_DATA(op))
...
@@ -473,13 +465,6 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
...
@@ -473,13 +465,6 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \
PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \
_PyUnicode_NONCOMPACT_DATA(op))
_PyUnicode_NONCOMPACT_DATA(op))
/* Compute (index * char_size) where char_size is 2 ** (kind - 1).
The index is a character index, the result is a size in bytes.
See also PyUnicode_CHARACTER_SIZE(). */
#define PyUnicode_KIND_SIZE(kind, index) \
(((Py_ssize_t)(index)) << ((kind) - 1))
/* In the access macros below, "kind" may be evaluated more than once.
/* In the access macros below, "kind" may be evaluated more than once.
All other macro parameters are evaluated exactly once, so it is safe
All other macro parameters are evaluated exactly once, so it is safe
to put side effects into them (such as increasing the index). */
to put side effects into them (such as increasing the index). */
...
...
Modules/_io/textio.c
Dosyayı görüntüle @
c47adb04
...
@@ -291,9 +291,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -291,9 +291,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
kind
=
PyUnicode_KIND
(
modified
);
kind
=
PyUnicode_KIND
(
modified
);
out
=
PyUnicode_DATA
(
modified
);
out
=
PyUnicode_DATA
(
modified
);
PyUnicode_WRITE
(
kind
,
PyUnicode_DATA
(
modified
),
0
,
'\r'
);
PyUnicode_WRITE
(
kind
,
PyUnicode_DATA
(
modified
),
0
,
'\r'
);
memcpy
(
out
+
PyUnicode_KIND_SIZE
(
kind
,
1
),
memcpy
(
out
+
kind
,
PyUnicode_DATA
(
output
),
kind
*
output_len
);
PyUnicode_DATA
(
output
),
PyUnicode_KIND_SIZE
(
kind
,
output_len
));
Py_DECREF
(
output
);
Py_DECREF
(
output
);
output
=
modified
;
/* output remains ready */
output
=
modified
;
/* output remains ready */
self
->
pendingcr
=
0
;
self
->
pendingcr
=
0
;
...
@@ -336,7 +334,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -336,7 +334,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
for the \r *byte* with the libc's optimized memchr.
for the \r *byte* with the libc's optimized memchr.
*/
*/
if
(
seennl
==
SEEN_LF
||
seennl
==
0
)
{
if
(
seennl
==
SEEN_LF
||
seennl
==
0
)
{
only_lf
=
(
memchr
(
in_str
,
'\r'
,
PyUnicode_KIND_SIZE
(
kind
,
len
)
)
==
NULL
);
only_lf
=
(
memchr
(
in_str
,
'\r'
,
kind
*
len
)
==
NULL
);
}
}
if
(
only_lf
)
{
if
(
only_lf
)
{
...
@@ -344,7 +342,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -344,7 +342,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
(there's nothing else to be done, even when in translation mode)
(there's nothing else to be done, even when in translation mode)
*/
*/
if
(
seennl
==
0
&&
if
(
seennl
==
0
&&
memchr
(
in_str
,
'\n'
,
PyUnicode_KIND_SIZE
(
kind
,
len
)
)
!=
NULL
)
{
memchr
(
in_str
,
'\n'
,
kind
*
len
)
!=
NULL
)
{
Py_ssize_t
i
=
0
;
Py_ssize_t
i
=
0
;
for
(;;)
{
for
(;;)
{
Py_UCS4
c
;
Py_UCS4
c
;
...
@@ -403,7 +401,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -403,7 +401,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
when there is something to translate. On the other hand,
when there is something to translate. On the other hand,
we already know there is a \r byte, so chances are high
we already know there is a \r byte, so chances are high
that something needs to be done. */
that something needs to be done. */
translated
=
PyMem_Malloc
(
PyUnicode_KIND_SIZE
(
kind
,
len
)
);
translated
=
PyMem_Malloc
(
kind
*
len
);
if
(
translated
==
NULL
)
{
if
(
translated
==
NULL
)
{
PyErr_NoMemory
();
PyErr_NoMemory
();
goto
error
;
goto
error
;
...
@@ -1576,15 +1574,14 @@ textiowrapper_read(textio *self, PyObject *args)
...
@@ -1576,15 +1574,14 @@ textiowrapper_read(textio *self, PyObject *args)
static
char
*
static
char
*
find_control_char
(
int
kind
,
char
*
s
,
char
*
end
,
Py_UCS4
ch
)
find_control_char
(
int
kind
,
char
*
s
,
char
*
end
,
Py_UCS4
ch
)
{
{
int
size
=
PyUnicode_KIND_SIZE
(
kind
,
1
);
for
(;;)
{
for
(;;)
{
while
(
PyUnicode_READ
(
kind
,
s
,
0
)
>
ch
)
while
(
PyUnicode_READ
(
kind
,
s
,
0
)
>
ch
)
s
+=
size
;
s
+=
kind
;
if
(
PyUnicode_READ
(
kind
,
s
,
0
)
==
ch
)
if
(
PyUnicode_READ
(
kind
,
s
,
0
)
==
ch
)
return
s
;
return
s
;
if
(
s
==
end
)
if
(
s
==
end
)
return
NULL
;
return
NULL
;
s
+=
size
;
s
+=
kind
;
}
}
}
}
...
@@ -1593,14 +1590,13 @@ _PyIO_find_line_ending(
...
@@ -1593,14 +1590,13 @@ _PyIO_find_line_ending(
int
translated
,
int
universal
,
PyObject
*
readnl
,
int
translated
,
int
universal
,
PyObject
*
readnl
,
int
kind
,
char
*
start
,
char
*
end
,
Py_ssize_t
*
consumed
)
int
kind
,
char
*
start
,
char
*
end
,
Py_ssize_t
*
consumed
)
{
{
int
size
=
PyUnicode_KIND_SIZE
(
kind
,
1
);
Py_ssize_t
len
=
((
char
*
)
end
-
(
char
*
)
start
)
/
kind
;
Py_ssize_t
len
=
((
char
*
)
end
-
(
char
*
)
start
)
/
size
;
if
(
translated
)
{
if
(
translated
)
{
/* Newlines are already translated, only search for \n */
/* Newlines are already translated, only search for \n */
char
*
pos
=
find_control_char
(
kind
,
start
,
end
,
'\n'
);
char
*
pos
=
find_control_char
(
kind
,
start
,
end
,
'\n'
);
if
(
pos
!=
NULL
)
if
(
pos
!=
NULL
)
return
(
pos
-
start
)
/
size
+
1
;
return
(
pos
-
start
)
/
kind
+
1
;
else
{
else
{
*
consumed
=
len
;
*
consumed
=
len
;
return
-
1
;
return
-
1
;
...
@@ -1616,20 +1612,20 @@ _PyIO_find_line_ending(
...
@@ -1616,20 +1612,20 @@ _PyIO_find_line_ending(
/* Fast path for non-control chars. The loop always ends
/* Fast path for non-control chars. The loop always ends
since the Unicode string is NUL-terminated. */
since the Unicode string is NUL-terminated. */
while
(
PyUnicode_READ
(
kind
,
s
,
0
)
>
'\r'
)
while
(
PyUnicode_READ
(
kind
,
s
,
0
)
>
'\r'
)
s
+=
size
;
s
+=
kind
;
if
(
s
>=
end
)
{
if
(
s
>=
end
)
{
*
consumed
=
len
;
*
consumed
=
len
;
return
-
1
;
return
-
1
;
}
}
ch
=
PyUnicode_READ
(
kind
,
s
,
0
);
ch
=
PyUnicode_READ
(
kind
,
s
,
0
);
s
+=
size
;
s
+=
kind
;
if
(
ch
==
'\n'
)
if
(
ch
==
'\n'
)
return
(
s
-
start
)
/
size
;
return
(
s
-
start
)
/
kind
;
if
(
ch
==
'\r'
)
{
if
(
ch
==
'\r'
)
{
if
(
PyUnicode_READ
(
kind
,
s
,
0
)
==
'\n'
)
if
(
PyUnicode_READ
(
kind
,
s
,
0
)
==
'\n'
)
return
(
s
-
start
)
/
size
+
1
;
return
(
s
-
start
)
/
kind
+
1
;
else
else
return
(
s
-
start
)
/
size
;
return
(
s
-
start
)
/
kind
;
}
}
}
}
}
}
...
@@ -1642,13 +1638,13 @@ _PyIO_find_line_ending(
...
@@ -1642,13 +1638,13 @@ _PyIO_find_line_ending(
if
(
readnl_len
==
1
)
{
if
(
readnl_len
==
1
)
{
char
*
pos
=
find_control_char
(
kind
,
start
,
end
,
nl
[
0
]);
char
*
pos
=
find_control_char
(
kind
,
start
,
end
,
nl
[
0
]);
if
(
pos
!=
NULL
)
if
(
pos
!=
NULL
)
return
(
pos
-
start
)
/
size
+
1
;
return
(
pos
-
start
)
/
kind
+
1
;
*
consumed
=
len
;
*
consumed
=
len
;
return
-
1
;
return
-
1
;
}
}
else
{
else
{
char
*
s
=
start
;
char
*
s
=
start
;
char
*
e
=
end
-
(
readnl_len
-
1
)
*
size
;
char
*
e
=
end
-
(
readnl_len
-
1
)
*
kind
;
char
*
pos
;
char
*
pos
;
if
(
e
<
s
)
if
(
e
<
s
)
e
=
s
;
e
=
s
;
...
@@ -1662,14 +1658,14 @@ _PyIO_find_line_ending(
...
@@ -1662,14 +1658,14 @@ _PyIO_find_line_ending(
break
;
break
;
}
}
if
(
i
==
readnl_len
)
if
(
i
==
readnl_len
)
return
(
pos
-
start
)
/
size
+
readnl_len
;
return
(
pos
-
start
)
/
kind
+
readnl_len
;
s
=
pos
+
size
;
s
=
pos
+
kind
;
}
}
pos
=
find_control_char
(
kind
,
e
,
end
,
nl
[
0
]);
pos
=
find_control_char
(
kind
,
e
,
end
,
nl
[
0
]);
if
(
pos
==
NULL
)
if
(
pos
==
NULL
)
*
consumed
=
len
;
*
consumed
=
len
;
else
else
*
consumed
=
(
pos
-
start
)
/
size
;
*
consumed
=
(
pos
-
start
)
/
kind
;
return
-
1
;
return
-
1
;
}
}
}
}
...
@@ -1738,8 +1734,8 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit)
...
@@ -1738,8 +1734,8 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit)
endpos
=
_PyIO_find_line_ending
(
endpos
=
_PyIO_find_line_ending
(
self
->
readtranslate
,
self
->
readuniversal
,
self
->
readnl
,
self
->
readtranslate
,
self
->
readuniversal
,
self
->
readnl
,
kind
,
kind
,
ptr
+
PyUnicode_KIND_SIZE
(
kind
,
start
)
,
ptr
+
kind
*
start
,
ptr
+
PyUnicode_KIND_SIZE
(
kind
,
line_len
)
,
ptr
+
kind
*
line_len
,
&
consumed
);
&
consumed
);
if
(
endpos
>=
0
)
{
if
(
endpos
>=
0
)
{
endpos
+=
start
;
endpos
+=
start
;
...
...
Modules/_json.c
Dosyayı görüntüle @
c47adb04
...
@@ -365,7 +365,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
...
@@ -365,7 +365,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
APPEND_OLD_CHUNK
APPEND_OLD_CHUNK
chunk
=
PyUnicode_FromKindAndData
(
chunk
=
PyUnicode_FromKindAndData
(
kind
,
kind
,
(
char
*
)
buf
+
PyUnicode_KIND_SIZE
(
kind
,
end
)
,
(
char
*
)
buf
+
kind
*
end
,
next
-
end
);
next
-
end
);
if
(
chunk
==
NULL
)
{
if
(
chunk
==
NULL
)
{
goto
bail
;
goto
bail
;
...
@@ -931,7 +931,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
...
@@ -931,7 +931,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
if
(
custom_func
)
{
if
(
custom_func
)
{
/* copy the section we determined to be a number */
/* copy the section we determined to be a number */
numstr
=
PyUnicode_FromKindAndData
(
kind
,
numstr
=
PyUnicode_FromKindAndData
(
kind
,
(
char
*
)
str
+
PyUnicode_KIND_SIZE
(
kind
,
start
)
,
(
char
*
)
str
+
kind
*
start
,
idx
-
start
);
idx
-
start
);
if
(
numstr
==
NULL
)
if
(
numstr
==
NULL
)
return
NULL
;
return
NULL
;
...
...
Modules/_sre.c
Dosyayı görüntüle @
c47adb04
...
@@ -1669,7 +1669,7 @@ getstring(PyObject* string, Py_ssize_t* p_length,
...
@@ -1669,7 +1669,7 @@ getstring(PyObject* string, Py_ssize_t* p_length,
return
NULL
;
return
NULL
;
ptr
=
PyUnicode_DATA
(
string
);
ptr
=
PyUnicode_DATA
(
string
);
*
p_length
=
PyUnicode_GET_LENGTH
(
string
);
*
p_length
=
PyUnicode_GET_LENGTH
(
string
);
*
p_charsize
=
PyUnicode_
CHARACTER_SIZE
(
string
);
*
p_charsize
=
PyUnicode_
KIND
(
string
);
*
p_logical_charsize
=
4
;
*
p_logical_charsize
=
4
;
return
ptr
;
return
ptr
;
}
}
...
...
Objects/stringlib/eq.h
Dosyayı görüntüle @
c47adb04
...
@@ -30,5 +30,5 @@ unicode_eq(PyObject *aa, PyObject *bb)
...
@@ -30,5 +30,5 @@ unicode_eq(PyObject *aa, PyObject *bb)
PyUnicode_GET_LENGTH
(
a
)
==
1
)
PyUnicode_GET_LENGTH
(
a
)
==
1
)
return
1
;
return
1
;
return
memcmp
(
PyUnicode_1BYTE_DATA
(
a
),
PyUnicode_1BYTE_DATA
(
b
),
return
memcmp
(
PyUnicode_1BYTE_DATA
(
a
),
PyUnicode_1BYTE_DATA
(
b
),
PyUnicode_GET_LENGTH
(
a
)
*
PyUnicode_
CHARACTER_SIZE
(
a
))
==
0
;
PyUnicode_GET_LENGTH
(
a
)
*
PyUnicode_
KIND
(
a
))
==
0
;
}
}
Objects/unicodeobject.c
Dosyayı görüntüle @
c47adb04
This diff is collapsed.
Click to expand it.
Python/formatter_unicode.c
Dosyayı görüntüle @
c47adb04
...
@@ -604,9 +604,9 @@ fill_number(PyObject *out, Py_ssize_t pos, const NumberFieldWidths *spec,
...
@@ -604,9 +604,9 @@ fill_number(PyObject *out, Py_ssize_t pos, const NumberFieldWidths *spec,
#endif
#endif
_PyUnicode_InsertThousandsGrouping
(
_PyUnicode_InsertThousandsGrouping
(
out
,
kind
,
out
,
kind
,
(
char
*
)
data
+
PyUnicode_KIND_SIZE
(
kind
,
pos
)
,
(
char
*
)
data
+
kind
*
pos
,
spec
->
n_grouped_digits
,
spec
->
n_grouped_digits
,
pdigits
+
PyUnicode_KIND_SIZE
(
kind
,
d_pos
)
,
pdigits
+
kind
*
d_pos
,
spec
->
n_digits
,
spec
->
n_min_width
,
spec
->
n_digits
,
spec
->
n_min_width
,
locale
->
grouping
,
locale
->
thousands_sep
);
locale
->
grouping
,
locale
->
thousands_sep
);
#ifndef NDEBUG
#ifndef NDEBUG
...
...
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