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
619f16e1
Kaydet (Commit)
619f16e1
authored
Haz 09, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #8930: fix some C code indentation
üst
ae1bb9a0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
45 deletions
+45
-45
_codecsmodule.c
Modules/_codecsmodule.c
+0
-0
bytearrayobject.c
Objects/bytearrayobject.c
+45
-45
stringobject.c
Objects/stringobject.c
+0
-0
No files found.
Modules/_codecsmodule.c
Dosyayı görüntüle @
619f16e1
This diff is collapsed.
Click to expand it.
Objects/bytearrayobject.c
Dosyayı görüntüle @
619f16e1
...
@@ -106,24 +106,24 @@ bytearray_buffer_getcharbuf(PyByteArrayObject *self, Py_ssize_t index, const cha
...
@@ -106,24 +106,24 @@ bytearray_buffer_getcharbuf(PyByteArrayObject *self, Py_ssize_t index, const cha
static
int
static
int
bytearray_getbuffer
(
PyByteArrayObject
*
obj
,
Py_buffer
*
view
,
int
flags
)
bytearray_getbuffer
(
PyByteArrayObject
*
obj
,
Py_buffer
*
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
;
}
}
ptr
=
(
void
*
)
PyByteArray_AS_STRING
(
obj
);
ptr
=
(
void
*
)
PyByteArray_AS_STRING
(
obj
);
ret
=
PyBuffer_FillInfo
(
view
,
(
PyObject
*
)
obj
,
ptr
,
Py_SIZE
(
obj
),
0
,
flags
);
ret
=
PyBuffer_FillInfo
(
view
,
(
PyObject
*
)
obj
,
ptr
,
Py_SIZE
(
obj
),
0
,
flags
);
if
(
ret
>=
0
)
{
if
(
ret
>=
0
)
{
obj
->
ob_exports
++
;
obj
->
ob_exports
++
;
}
}
return
ret
;
return
ret
;
}
}
static
void
static
void
bytearray_releasebuffer
(
PyByteArrayObject
*
obj
,
Py_buffer
*
view
)
bytearray_releasebuffer
(
PyByteArrayObject
*
obj
,
Py_buffer
*
view
)
{
{
obj
->
ob_exports
--
;
obj
->
ob_exports
--
;
}
}
static
Py_ssize_t
static
Py_ssize_t
...
@@ -1718,43 +1718,43 @@ replace_single_character_in_place(PyByteArrayObject *self,
...
@@ -1718,43 +1718,43 @@ replace_single_character_in_place(PyByteArrayObject *self,
char
from_c
,
char
to_c
,
char
from_c
,
char
to_c
,
Py_ssize_t
maxcount
)
Py_ssize_t
maxcount
)
{
{
char
*
self_s
,
*
result_s
,
*
start
,
*
end
,
*
next
;
char
*
self_s
,
*
result_s
,
*
start
,
*
end
,
*
next
;
Py_ssize_t
self_len
;
Py_ssize_t
self_len
;
PyByteArrayObject
*
result
;
PyByteArrayObject
*
result
;
/* The result string will be the same size */
/* The result string will be the same size */
self_s
=
PyByteArray_AS_STRING
(
self
);
self_s
=
PyByteArray_AS_STRING
(
self
);
self_len
=
PyByteArray_GET_SIZE
(
self
);
self_len
=
PyByteArray_GET_SIZE
(
self
);
next
=
findchar
(
self_s
,
self_len
,
from_c
);
next
=
findchar
(
self_s
,
self_len
,
from_c
);
if
(
next
==
NULL
)
{
if
(
next
==
NULL
)
{
/* No matches; return the original bytes */
/* No matches; return the original bytes */
return
return_self
(
self
);
return
return_self
(
self
);
}
}
/* Need to make a new bytes */
/* Need to make a new bytes */
result
=
(
PyByteArrayObject
*
)
PyByteArray_FromStringAndSize
(
NULL
,
self_len
);
result
=
(
PyByteArrayObject
*
)
PyByteArray_FromStringAndSize
(
NULL
,
self_len
);
if
(
result
==
NULL
)
if
(
result
==
NULL
)
return
NULL
;
return
NULL
;
result_s
=
PyByteArray_AS_STRING
(
result
);
result_s
=
PyByteArray_AS_STRING
(
result
);
Py_MEMCPY
(
result_s
,
self_s
,
self_len
);
Py_MEMCPY
(
result_s
,
self_s
,
self_len
);
/* change everything in-place, starting with this one */
/* change everything in-place, starting with this one */
start
=
result_s
+
(
next
-
self_s
);
start
=
result_s
+
(
next
-
self_s
);
*
start
=
to_c
;
*
start
=
to_c
;
start
++
;
start
++
;
end
=
result_s
+
self_len
;
end
=
result_s
+
self_len
;
while
(
--
maxcount
>
0
)
{
next
=
findchar
(
start
,
end
-
start
,
from_c
);
if
(
next
==
NULL
)
break
;
*
next
=
to_c
;
start
=
next
+
1
;
}
return
result
;
while
(
--
maxcount
>
0
)
{
next
=
findchar
(
start
,
end
-
start
,
from_c
);
if
(
next
==
NULL
)
break
;
*
next
=
to_c
;
start
=
next
+
1
;
}
return
result
;
}
}
/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */
/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */
...
...
Objects/stringobject.c
Dosyayı görüntüle @
619f16e1
This diff is collapsed.
Click to expand it.
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