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
9e897f41
Kaydet (Commit)
9e897f41
authored
May 09, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Mark Favas reported that gcc caught me using casts as lvalues. Dodge it.
üst
af922187
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
stringobject.c
Objects/stringobject.c
+10
-6
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
9e897f41
...
@@ -36,7 +36,7 @@ static PyStringObject *nullstring;
...
@@ -36,7 +36,7 @@ static PyStringObject *nullstring;
PyObject
*
PyObject
*
PyString_FromStringAndSize
(
const
char
*
str
,
int
size
)
PyString_FromStringAndSize
(
const
char
*
str
,
int
size
)
{
{
PyStringObject
*
op
;
register
PyStringObject
*
op
;
#ifndef DONT_SHARE_SHORT_STRINGS
#ifndef DONT_SHARE_SHORT_STRINGS
if
(
size
==
0
&&
(
op
=
nullstring
)
!=
NULL
)
{
if
(
size
==
0
&&
(
op
=
nullstring
)
!=
NULL
)
{
#ifdef COUNT_ALLOCS
#ifdef COUNT_ALLOCS
...
@@ -73,11 +73,13 @@ PyString_FromStringAndSize(const char *str, int size)
...
@@ -73,11 +73,13 @@ PyString_FromStringAndSize(const char *str, int size)
op
->
ob_sval
[
size
]
=
'\0'
;
op
->
ob_sval
[
size
]
=
'\0'
;
#ifndef DONT_SHARE_SHORT_STRINGS
#ifndef DONT_SHARE_SHORT_STRINGS
if
(
size
==
0
)
{
if
(
size
==
0
)
{
PyString_InternInPlace
(
&
(
PyObject
*
)
op
);
PyObject
*
t
=
(
PyObject
*
)
op
;
PyString_InternInPlace
(
&
t
);
nullstring
=
op
;
nullstring
=
op
;
Py_INCREF
(
op
);
Py_INCREF
(
op
);
}
else
if
(
size
==
1
&&
str
!=
NULL
)
{
}
else
if
(
size
==
1
&&
str
!=
NULL
)
{
PyString_InternInPlace
(
&
(
PyObject
*
)
op
);
PyObject
*
t
=
(
PyObject
*
)
op
;
PyString_InternInPlace
(
&
t
);
characters
[
*
str
&
UCHAR_MAX
]
=
op
;
characters
[
*
str
&
UCHAR_MAX
]
=
op
;
Py_INCREF
(
op
);
Py_INCREF
(
op
);
}
}
...
@@ -89,7 +91,7 @@ PyObject *
...
@@ -89,7 +91,7 @@ PyObject *
PyString_FromString
(
const
char
*
str
)
PyString_FromString
(
const
char
*
str
)
{
{
register
size_t
size
=
strlen
(
str
);
register
size_t
size
=
strlen
(
str
);
PyStringObject
*
op
;
register
PyStringObject
*
op
;
if
(
size
>
INT_MAX
)
{
if
(
size
>
INT_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"string is too long for a Python string"
);
"string is too long for a Python string"
);
...
@@ -127,11 +129,13 @@ PyString_FromString(const char *str)
...
@@ -127,11 +129,13 @@ PyString_FromString(const char *str)
strcpy
(
op
->
ob_sval
,
str
);
strcpy
(
op
->
ob_sval
,
str
);
#ifndef DONT_SHARE_SHORT_STRINGS
#ifndef DONT_SHARE_SHORT_STRINGS
if
(
size
==
0
)
{
if
(
size
==
0
)
{
PyString_InternInPlace
(
&
(
PyObject
*
)
op
);
PyObject
*
t
=
(
PyObject
*
)
op
;
PyString_InternInPlace
(
&
t
);
nullstring
=
op
;
nullstring
=
op
;
Py_INCREF
(
op
);
Py_INCREF
(
op
);
}
else
if
(
size
==
1
)
{
}
else
if
(
size
==
1
)
{
PyString_InternInPlace
(
&
(
PyObject
*
)
op
);
PyObject
*
t
=
(
PyObject
*
)
op
;
PyString_InternInPlace
(
&
t
);
characters
[
*
str
&
UCHAR_MAX
]
=
op
;
characters
[
*
str
&
UCHAR_MAX
]
=
op
;
Py_INCREF
(
op
);
Py_INCREF
(
op
);
}
}
...
...
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