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
8d48b43e
Kaydet (Commit)
8d48b43e
authored
Eki 23, 2011
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12965: Fix some inaccurate comments in Objects/longobject.c. Thanks Stefan Krah.
üst
30970e9e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
longobject.c
Objects/longobject.c
+23
-15
No files found.
Objects/longobject.c
Dosyayı görüntüle @
8d48b43e
...
@@ -322,8 +322,15 @@ PyLong_FromDouble(double dval)
...
@@ -322,8 +322,15 @@ PyLong_FromDouble(double dval)
#define PY_ABS_LONG_MIN (0-(unsigned long)LONG_MIN)
#define PY_ABS_LONG_MIN (0-(unsigned long)LONG_MIN)
#define PY_ABS_SSIZE_T_MIN (0-(size_t)PY_SSIZE_T_MIN)
#define PY_ABS_SSIZE_T_MIN (0-(size_t)PY_SSIZE_T_MIN)
/* Get a C long int from a long int object.
/* Get a C long int from a long int object or any object that has an __int__
Returns -1 and sets an error condition if overflow occurs. */
method.
On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of
the result. Otherwise *overflow is 0.
For other errors (e.g., TypeError), return -1 and set an error condition.
In this case *overflow will be 0.
*/
long
long
PyLong_AsLongAndOverflow
(
PyObject
*
vv
,
int
*
overflow
)
PyLong_AsLongAndOverflow
(
PyObject
*
vv
,
int
*
overflow
)
...
@@ -412,6 +419,9 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
...
@@ -412,6 +419,9 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
return
res
;
return
res
;
}
}
/* Get a C long int from a long int object or any object that has an __int__
method. Return -1 and set an error if overflow occurs. */
long
long
PyLong_AsLong
(
PyObject
*
obj
)
PyLong_AsLong
(
PyObject
*
obj
)
{
{
...
@@ -923,7 +933,7 @@ _PyLong_AsByteArray(PyLongObject* v,
...
@@ -923,7 +933,7 @@ _PyLong_AsByteArray(PyLongObject* v,
}
}
/* Create a new long
(or int)
object from a C pointer */
/* Create a new long
int
object from a C pointer */
PyObject
*
PyObject
*
PyLong_FromVoidPtr
(
void
*
p
)
PyLong_FromVoidPtr
(
void
*
p
)
...
@@ -941,15 +951,11 @@ PyLong_FromVoidPtr(void *p)
...
@@ -941,15 +951,11 @@ PyLong_FromVoidPtr(void *p)
}
}
/* Get a C pointer from a long
object (or an int object in some cases)
*/
/* Get a C pointer from a long
int object.
*/
void
*
void
*
PyLong_AsVoidPtr
(
PyObject
*
vv
)
PyLong_AsVoidPtr
(
PyObject
*
vv
)
{
{
/* This function will allow int or long objects. If vv is neither,
then the PyLong_AsLong*() functions will raise the exception:
PyExc_SystemError, "bad argument to internal function"
*/
#if SIZEOF_VOID_P <= SIZEOF_LONG
#if SIZEOF_VOID_P <= SIZEOF_LONG
long
x
;
long
x
;
...
@@ -1130,8 +1136,8 @@ PyLong_FromSize_t(size_t ival)
...
@@ -1130,8 +1136,8 @@ PyLong_FromSize_t(size_t ival)
return
(
PyObject
*
)
v
;
return
(
PyObject
*
)
v
;
}
}
/* Get a C
PY_LONG_LONG int from a long int object.
/* Get a C
long long int from a long int object or any object that has an
Return -1 and set an error if overflow occurs. */
__int__ method.
Return -1 and set an error if overflow occurs. */
PY_LONG_LONG
PY_LONG_LONG
PyLong_AsLongLong
(
PyObject
*
vv
)
PyLong_AsLongLong
(
PyObject
*
vv
)
...
@@ -1287,12 +1293,14 @@ PyLong_AsUnsignedLongLongMask(register PyObject *op)
...
@@ -1287,12 +1293,14 @@ PyLong_AsUnsignedLongLongMask(register PyObject *op)
}
}
#undef IS_LITTLE_ENDIAN
#undef IS_LITTLE_ENDIAN
/* Get a C long long int from a Python long or Python int object.
/* Get a C long long int from a long int object or any object that has an
On overflow, returns -1 and sets *overflow to 1 or -1 depending
__int__ method.
on the sign of the result. Otherwise *overflow is 0.
On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of
the result. Otherwise *overflow is 0.
For other errors (e.g.,
type error), returns -1 and sets an error
For other errors (e.g.,
TypeError), return -1 and set an error condition.
condition
.
In this case *overflow will be 0
.
*/
*/
PY_LONG_LONG
PY_LONG_LONG
...
...
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