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
0bc2ab9a
Kaydet (Commit)
0bc2ab9a
authored
Nis 10, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #837242: id() for large ptr should return a long.
üst
a19dc0be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
concrete.tex
Doc/api/concrete.tex
+5
-1
NEWS
Misc/NEWS
+4
-0
longobject.c
Objects/longobject.c
+9
-3
No files found.
Doc/api/concrete.tex
Dosyayı görüntüle @
0bc2ab9a
...
...
@@ -333,7 +333,9 @@ booleans. The following macros are available, however.
The pointer value can be retrieved from the resulting value using
\cfunction
{
PyLong
_
AsVoidPtr()
}
.
\versionadded
{
1.5.2
}
\end{cfuncdesc}
\versionchanged
[If the integer is larger than LONG
_
MAX,
a positive long integer is returned]
{
2.5
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
long
}{
PyLong
_
AsLong
}{
PyObject *pylong
}
Return a C
\ctype
{
long
}
representation of the contents of
...
...
@@ -394,6 +396,8 @@ booleans. The following macros are available, however.
produce a usable
\ctype
{
void
}
pointer for values created with
\cfunction
{
PyLong
_
FromVoidPtr()
}
.
\versionadded
{
1.5.2
}
\versionchanged
[For values outside 0..LONG
_
MAX, both signed and
unsigned integers are acccepted]
{
2.5
}
\end{cfuncdesc}
...
...
Misc/NEWS
Dosyayı görüntüle @
0bc2ab9a
...
...
@@ -12,6 +12,10 @@ What's New in Python 2.5 alpha 2?
Core and builtins
-----------------
- Patch #837242: id() of any Python object always gives a positive
number, which might be a long integer. PyLong_FromVoidPtr and
PyLong_AsVoidPtr have been changed accordingly.
- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
to load extension modules and now provides the dl module. As a result,
sys.setdlopenflags() now works correctly on these systems. (SF patch
...
...
Objects/longobject.c
Dosyayı görüntüle @
0bc2ab9a
...
...
@@ -771,6 +771,8 @@ PyObject *
PyLong_FromVoidPtr
(
void
*
p
)
{
#if SIZEOF_VOID_P <= SIZEOF_LONG
if
((
long
)
p
<
0
)
return
PyLong_FromUnsignedLong
((
unsigned
long
)
p
);
return
PyInt_FromLong
((
long
)
p
);
#else
...
...
@@ -783,7 +785,7 @@ PyLong_FromVoidPtr(void *p)
/* optimize null pointers */
if
(
p
==
NULL
)
return
PyInt_FromLong
(
0
);
return
PyLong_From
LongLong
((
PY_LONG_LONG
)
p
);
return
PyLong_From
UnsignedLongLong
((
unsigned
PY_LONG_LONG
)
p
);
#endif
/* SIZEOF_VOID_P <= SIZEOF_LONG */
}
...
...
@@ -802,8 +804,10 @@ PyLong_AsVoidPtr(PyObject *vv)
if
(
PyInt_Check
(
vv
))
x
=
PyInt_AS_LONG
(
vv
);
else
else
if
(
PyLong_Check
(
vv
)
&&
_PyLong_Sign
(
vv
)
<
0
)
x
=
PyLong_AsLong
(
vv
);
else
x
=
PyLong_AsUnsignedLong
(
vv
);
#else
#ifndef HAVE_LONG_LONG
...
...
@@ -816,8 +820,10 @@ PyLong_AsVoidPtr(PyObject *vv)
if
(
PyInt_Check
(
vv
))
x
=
PyInt_AS_LONG
(
vv
);
else
else
if
(
PyLong_Check
(
vv
)
&&
_PyLong_Sign
(
vv
)
<
0
)
x
=
PyLong_AsLongLong
(
vv
);
else
x
=
PyLong_AsUnsignedLongLong
(
vv
);
#endif
/* SIZEOF_VOID_P <= SIZEOF_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