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
75d38e99
Kaydet (Commit)
75d38e99
authored
Agu 24, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Whitespace cleanup.
üst
7f19f662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
bytesobject.c
Objects/bytesobject.c
+10
-10
No files found.
Objects/bytesobject.c
Dosyayı görüntüle @
75d38e99
...
@@ -51,14 +51,14 @@ _getbytevalue(PyObject* arg, int *value)
...
@@ -51,14 +51,14 @@ _getbytevalue(PyObject* arg, int *value)
static
int
static
int
bytes_getbuffer
(
PyBytesObject
*
obj
,
PyBuffer
*
view
,
int
flags
)
bytes_getbuffer
(
PyBytesObject
*
obj
,
PyBuffer
*
view
,
int
flags
)
{
{
int
ret
;
int
ret
;
void
*
ptr
;
void
*
ptr
;
if
(
view
==
NULL
)
{
if
(
view
==
NULL
)
{
obj
->
ob_exports
++
;
obj
->
ob_exports
++
;
return
0
;
return
0
;
}
}
if
(
obj
->
ob_bytes
==
NULL
)
if
(
obj
->
ob_bytes
==
NULL
)
ptr
=
""
;
ptr
=
""
;
else
else
ptr
=
obj
->
ob_bytes
;
ptr
=
obj
->
ob_bytes
;
...
@@ -213,7 +213,7 @@ PyBytes_Concat(PyObject *a, PyObject *b)
...
@@ -213,7 +213,7 @@ PyBytes_Concat(PyObject *a, PyObject *b)
vb
.
len
=
-
1
;
vb
.
len
=
-
1
;
if
(
_getbuffer
(
a
,
&
va
)
<
0
||
if
(
_getbuffer
(
a
,
&
va
)
<
0
||
_getbuffer
(
b
,
&
vb
)
<
0
)
{
_getbuffer
(
b
,
&
vb
)
<
0
)
{
if
(
va
.
len
!=
-
1
)
if
(
va
.
len
!=
-
1
)
PyObject_ReleaseBuffer
(
a
,
&
va
);
PyObject_ReleaseBuffer
(
a
,
&
va
);
if
(
vb
.
len
!=
-
1
)
if
(
vb
.
len
!=
-
1
)
PyObject_ReleaseBuffer
(
b
,
&
vb
);
PyObject_ReleaseBuffer
(
b
,
&
vb
);
...
@@ -234,7 +234,7 @@ PyBytes_Concat(PyObject *a, PyObject *b)
...
@@ -234,7 +234,7 @@ PyBytes_Concat(PyObject *a, PyObject *b)
memcpy
(
result
->
ob_bytes
,
va
.
buf
,
va
.
len
);
memcpy
(
result
->
ob_bytes
,
va
.
buf
,
va
.
len
);
memcpy
(
result
->
ob_bytes
+
va
.
len
,
vb
.
buf
,
vb
.
len
);
memcpy
(
result
->
ob_bytes
+
va
.
len
,
vb
.
buf
,
vb
.
len
);
}
}
PyObject_ReleaseBuffer
(
a
,
&
va
);
PyObject_ReleaseBuffer
(
a
,
&
va
);
PyObject_ReleaseBuffer
(
b
,
&
vb
);
PyObject_ReleaseBuffer
(
b
,
&
vb
);
return
(
PyObject
*
)
result
;
return
(
PyObject
*
)
result
;
...
@@ -528,9 +528,9 @@ bytes_setslice(PyBytesObject *self, Py_ssize_t lo, Py_ssize_t hi,
...
@@ -528,9 +528,9 @@ bytes_setslice(PyBytesObject *self, Py_ssize_t lo, Py_ssize_t hi,
if
(
needed
>
0
)
if
(
needed
>
0
)
memcpy
(
self
->
ob_bytes
+
lo
,
bytes
,
needed
);
memcpy
(
self
->
ob_bytes
+
lo
,
bytes
,
needed
);
finish:
finish:
if
(
vbytes
.
len
!=
-
1
)
if
(
vbytes
.
len
!=
-
1
)
PyObject_ReleaseBuffer
(
values
,
&
vbytes
);
PyObject_ReleaseBuffer
(
values
,
&
vbytes
);
return
res
;
return
res
;
}
}
...
@@ -800,7 +800,7 @@ bytes_init(PyBytesObject *self, PyObject *args, PyObject *kwds)
...
@@ -800,7 +800,7 @@ bytes_init(PyBytesObject *self, PyObject *args, PyObject *kwds)
}
}
return
0
;
return
0
;
}
}
/* Use the modern buffer interface */
/* Use the modern buffer interface */
if
(
PyObject_CheckBuffer
(
arg
))
{
if
(
PyObject_CheckBuffer
(
arg
))
{
Py_ssize_t
size
;
Py_ssize_t
size
;
...
@@ -996,7 +996,7 @@ bytes_richcompare(PyObject *self, PyObject *other, int op)
...
@@ -996,7 +996,7 @@ bytes_richcompare(PyObject *self, PyObject *other, int op)
res
=
cmp
?
Py_True
:
Py_False
;
res
=
cmp
?
Py_True
:
Py_False
;
PyObject_ReleaseBuffer
(
self
,
&
self_bytes
);
PyObject_ReleaseBuffer
(
self
,
&
self_bytes
);
PyObject_ReleaseBuffer
(
other
,
&
other_bytes
);
PyObject_ReleaseBuffer
(
other
,
&
other_bytes
);
Py_INCREF
(
res
);
Py_INCREF
(
res
);
return
res
;
return
res
;
}
}
...
@@ -2034,7 +2034,7 @@ bytes_replace(PyBytesObject *self, PyObject *args)
...
@@ -2034,7 +2034,7 @@ bytes_replace(PyBytesObject *self, PyObject *args)
from_len
=
PyBytes_GET_SIZE
(
from
);
from_len
=
PyBytes_GET_SIZE
(
from
);
}
}
else
{
else
{
if
(
PyObject_GetBuffer
(
from
,
&
vfrom
,
PyBUF_CHARACTER
)
<
0
)
if
(
PyObject_GetBuffer
(
from
,
&
vfrom
,
PyBUF_CHARACTER
)
<
0
)
return
NULL
;
return
NULL
;
from_s
=
vfrom
.
buf
;
from_s
=
vfrom
.
buf
;
from_len
=
vfrom
.
len
;
from_len
=
vfrom
.
len
;
...
@@ -2799,7 +2799,7 @@ bytes_reduce(PyBytesObject *self)
...
@@ -2799,7 +2799,7 @@ bytes_reduce(PyBytesObject *self)
{
{
PyObject
*
latin1
;
PyObject
*
latin1
;
if
(
self
->
ob_bytes
)
if
(
self
->
ob_bytes
)
latin1
=
PyUnicode_DecodeLatin1
(
self
->
ob_bytes
,
latin1
=
PyUnicode_DecodeLatin1
(
self
->
ob_bytes
,
Py_Size
(
self
),
NULL
);
Py_Size
(
self
),
NULL
);
else
else
latin1
=
PyUnicode_FromString
(
""
);
latin1
=
PyUnicode_FromString
(
""
);
...
...
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