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
79912471
Kaydet (Commit)
79912471
authored
Tem 09, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ANSI-fication of the sources.
üst
a83b68a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
78 deletions
+24
-78
abstract.c
Objects/abstract.c
+0
-0
bufferobject.c
Objects/bufferobject.c
+24
-78
classobject.c
Objects/classobject.c
+0
-0
No files found.
Objects/abstract.c
Dosyayı görüntüle @
79912471
This diff is collapsed.
Click to expand it.
Objects/bufferobject.c
Dosyayı görüntüle @
79912471
...
...
@@ -26,11 +26,7 @@ typedef struct {
static
PyObject
*
_PyBuffer_FromMemory
(
base
,
ptr
,
size
,
readonly
)
PyObject
*
base
;
void
*
ptr
;
int
size
;
int
readonly
;
_PyBuffer_FromMemory
(
PyObject
*
base
,
void
*
ptr
,
int
size
,
int
readonly
)
{
PyBufferObject
*
b
;
...
...
@@ -57,12 +53,8 @@ _PyBuffer_FromMemory(base, ptr, size, readonly)
}
static
PyObject
*
_PyBuffer_FromObject
(
base
,
offset
,
size
,
proc
,
readonly
)
PyObject
*
base
;
int
offset
;
int
size
;
getreadbufferproc
proc
;
int
readonly
;
_PyBuffer_FromObject
(
PyObject
*
base
,
int
offset
,
int
size
,
getreadbufferproc
proc
,
int
readonly
)
{
PyBufferProcs
*
pb
=
base
->
ob_type
->
tp_as_buffer
;
void
*
p
;
...
...
@@ -100,10 +92,7 @@ _PyBuffer_FromObject(base, offset, size, proc, readonly)
PyObject
*
PyBuffer_FromObject
(
base
,
offset
,
size
)
PyObject
*
base
;
int
offset
;
int
size
;
PyBuffer_FromObject
(
PyObject
*
base
,
int
offset
,
int
size
)
{
PyBufferProcs
*
pb
=
base
->
ob_type
->
tp_as_buffer
;
...
...
@@ -120,10 +109,7 @@ PyBuffer_FromObject(base, offset, size)
}
PyObject
*
PyBuffer_FromReadWriteObject
(
base
,
offset
,
size
)
PyObject
*
base
;
int
offset
;
int
size
;
PyBuffer_FromReadWriteObject
(
PyObject
*
base
,
int
offset
,
int
size
)
{
PyBufferProcs
*
pb
=
base
->
ob_type
->
tp_as_buffer
;
...
...
@@ -141,24 +127,19 @@ PyBuffer_FromReadWriteObject(base, offset, size)
}
PyObject
*
PyBuffer_FromMemory
(
ptr
,
size
)
void
*
ptr
;
int
size
;
PyBuffer_FromMemory
(
void
*
ptr
,
int
size
)
{
return
_PyBuffer_FromMemory
(
NULL
,
ptr
,
size
,
1
);
}
PyObject
*
PyBuffer_FromReadWriteMemory
(
ptr
,
size
)
void
*
ptr
;
int
size
;
PyBuffer_FromReadWriteMemory
(
void
*
ptr
,
int
size
)
{
return
_PyBuffer_FromMemory
(
NULL
,
ptr
,
size
,
0
);
}
PyObject
*
PyBuffer_New
(
size
)
int
size
;
PyBuffer_New
(
int
size
)
{
PyBufferObject
*
b
;
...
...
@@ -187,17 +168,14 @@ PyBuffer_New(size)
/* Methods */
static
void
buffer_dealloc
(
self
)
PyBufferObject
*
self
;
buffer_dealloc
(
PyBufferObject
*
self
)
{
Py_XDECREF
(
self
->
b_base
);
PyObject_DEL
(
self
);
}
static
int
buffer_compare
(
self
,
other
)
PyBufferObject
*
self
;
PyBufferObject
*
other
;
buffer_compare
(
PyBufferObject
*
self
,
PyBufferObject
*
other
)
{
int
len_self
=
self
->
b_size
;
int
len_other
=
other
->
b_size
;
...
...
@@ -212,8 +190,7 @@ buffer_compare(self, other)
}
static
PyObject
*
buffer_repr
(
self
)
PyBufferObject
*
self
;
buffer_repr
(
PyBufferObject
*
self
)
{
char
buf
[
300
];
char
*
status
=
self
->
b_readonly
?
"read-only"
:
"read-write"
;
...
...
@@ -240,8 +217,7 @@ buffer_repr(self)
}
static
long
buffer_hash
(
self
)
PyBufferObject
*
self
;
buffer_hash
(
PyBufferObject
*
self
)
{
register
int
len
;
register
unsigned
char
*
p
;
...
...
@@ -274,8 +250,7 @@ buffer_hash(self)
}
static
PyObject
*
buffer_str
(
self
)
PyBufferObject
*
self
;
buffer_str
(
PyBufferObject
*
self
)
{
return
PyString_FromStringAndSize
(
self
->
b_ptr
,
self
->
b_size
);
}
...
...
@@ -283,16 +258,13 @@ buffer_str(self)
/* Sequence methods */
static
int
buffer_length
(
self
)
PyBufferObject
*
self
;
buffer_length
(
PyBufferObject
*
self
)
{
return
self
->
b_size
;
}
static
PyObject
*
buffer_concat
(
self
,
other
)
PyBufferObject
*
self
;
PyObject
*
other
;
buffer_concat
(
PyBufferObject
*
self
,
PyObject
*
other
)
{
PyBufferProcs
*
pb
=
other
->
ob_type
->
tp_as_buffer
;
char
*
p1
;
...
...
@@ -344,9 +316,7 @@ buffer_concat(self, other)
}
static
PyObject
*
buffer_repeat
(
self
,
count
)
PyBufferObject
*
self
;
int
count
;
buffer_repeat
(
PyBufferObject
*
self
,
int
count
)
{
PyObject
*
ob
;
register
char
*
p
;
...
...
@@ -373,9 +343,7 @@ buffer_repeat(self, count)
}
static
PyObject
*
buffer_item
(
self
,
idx
)
PyBufferObject
*
self
;
int
idx
;
buffer_item
(
PyBufferObject
*
self
,
int
idx
)
{
if
(
idx
<
0
||
idx
>=
self
->
b_size
)
{
...
...
@@ -386,10 +354,7 @@ buffer_item(self, idx)
}
static
PyObject
*
buffer_slice
(
self
,
left
,
right
)
PyBufferObject
*
self
;
int
left
;
int
right
;
buffer_slice
(
PyBufferObject
*
self
,
int
left
,
int
right
)
{
if
(
left
<
0
)
left
=
0
;
...
...
@@ -410,10 +375,7 @@ buffer_slice(self, left, right)
}
static
int
buffer_ass_item
(
self
,
idx
,
other
)
PyBufferObject
*
self
;
int
idx
;
PyObject
*
other
;
buffer_ass_item
(
PyBufferObject
*
self
,
int
idx
,
PyObject
*
other
)
{
PyBufferProcs
*
pb
;
void
*
p
;
...
...
@@ -460,11 +422,7 @@ buffer_ass_item(self, idx, other)
}
static
int
buffer_ass_slice
(
self
,
left
,
right
,
other
)
PyBufferObject
*
self
;
int
left
;
int
right
;
PyObject
*
other
;
buffer_ass_slice
(
PyBufferObject
*
self
,
int
left
,
int
right
,
PyObject
*
other
)
{
PyBufferProcs
*
pb
;
void
*
p
;
...
...
@@ -521,10 +479,7 @@ buffer_ass_slice(self, left, right, other)
/* Buffer methods */
static
int
buffer_getreadbuf
(
self
,
idx
,
pp
)
PyBufferObject
*
self
;
int
idx
;
void
**
pp
;
buffer_getreadbuf
(
PyBufferObject
*
self
,
int
idx
,
void
**
pp
)
{
if
(
idx
!=
0
)
{
PyErr_SetString
(
PyExc_SystemError
,
...
...
@@ -536,10 +491,7 @@ buffer_getreadbuf(self, idx, pp)
}
static
int
buffer_getwritebuf
(
self
,
idx
,
pp
)
PyBufferObject
*
self
;
int
idx
;
void
**
pp
;
buffer_getwritebuf
(
PyBufferObject
*
self
,
int
idx
,
void
**
pp
)
{
if
(
self
->
b_readonly
)
{
...
...
@@ -550,9 +502,7 @@ buffer_getwritebuf(self, idx, pp)
}
static
int
buffer_getsegcount
(
self
,
lenp
)
PyBufferObject
*
self
;
int
*
lenp
;
buffer_getsegcount
(
PyBufferObject
*
self
,
int
*
lenp
)
{
if
(
lenp
)
*
lenp
=
self
->
b_size
;
...
...
@@ -560,10 +510,7 @@ buffer_getsegcount(self, lenp)
}
static
int
buffer_getcharbuf
(
self
,
idx
,
pp
)
PyBufferObject
*
self
;
int
idx
;
const
char
**
pp
;
buffer_getcharbuf
(
PyBufferObject
*
self
,
int
idx
,
const
char
**
pp
)
{
if
(
idx
!=
0
)
{
PyErr_SetString
(
PyExc_SystemError
,
...
...
@@ -616,4 +563,3 @@ PyTypeObject PyBuffer_Type = {
Py_TPFLAGS_DEFAULT
,
/*tp_flags*/
0
,
/*tp_doc*/
};
Objects/classobject.c
Dosyayı görüntüle @
79912471
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