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
410c3b58
Kaydet (Commit)
410c3b58
authored
Haz 11, 2007
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use "O&" in calls to PyArg_Parse when we need a 'void*' instead of "k"
or "K" codes.
üst
db2b1b33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
callproc.c
Modules/_ctypes/callproc.c
+17
-7
ctypes.h
Modules/_ctypes/ctypes.h
+0
-6
No files found.
Modules/_ctypes/callproc.c
Dosyayı görüntüle @
410c3b58
...
@@ -1046,6 +1046,15 @@ PyObject *_CallProc(PPROC pProc,
...
@@ -1046,6 +1046,15 @@ PyObject *_CallProc(PPROC pProc,
return
retval
;
return
retval
;
}
}
static
int
_parse_voidp
(
PyObject
*
obj
,
void
**
address
)
{
*
address
=
PyLong_AsVoidPtr
(
obj
);
if
(
*
address
==
NULL
)
return
0
;
return
1
;
}
#ifdef MS_WIN32
#ifdef MS_WIN32
#ifdef _UNICODE
#ifdef _UNICODE
...
@@ -1133,7 +1142,7 @@ Free the handle of an executable previously loaded by LoadLibrary.\n";
...
@@ -1133,7 +1142,7 @@ Free the handle of an executable previously loaded by LoadLibrary.\n";
static
PyObject
*
free_library
(
PyObject
*
self
,
PyObject
*
args
)
static
PyObject
*
free_library
(
PyObject
*
self
,
PyObject
*
args
)
{
{
void
*
hMod
;
void
*
hMod
;
if
(
!
PyArg_ParseTuple
(
args
,
PY_VOID_P_CODE
":FreeLibrary"
,
&
hMod
))
if
(
!
PyArg_ParseTuple
(
args
,
"O&:FreeLibrary"
,
&
_parse_voidp
,
&
hMod
))
return
NULL
;
return
NULL
;
if
(
!
FreeLibrary
((
HMODULE
)
hMod
))
if
(
!
FreeLibrary
((
HMODULE
)
hMod
))
return
PyErr_SetFromWindowsErr
(
GetLastError
());
return
PyErr_SetFromWindowsErr
(
GetLastError
());
...
@@ -1256,7 +1265,7 @@ static PyObject *py_dl_close(PyObject *self, PyObject *args)
...
@@ -1256,7 +1265,7 @@ static PyObject *py_dl_close(PyObject *self, PyObject *args)
{
{
void
*
handle
;
void
*
handle
;
if
(
!
PyArg_ParseTuple
(
args
,
PY_VOID_P_CODE
":dlclose"
,
&
handle
))
if
(
!
PyArg_ParseTuple
(
args
,
"O&:dlclose"
,
&
_parse_voidp
,
&
handle
))
return
NULL
;
return
NULL
;
if
(
dlclose
(
handle
))
{
if
(
dlclose
(
handle
))
{
PyErr_SetString
(
PyExc_OSError
,
PyErr_SetString
(
PyExc_OSError
,
...
@@ -1273,7 +1282,8 @@ static PyObject *py_dl_sym(PyObject *self, PyObject *args)
...
@@ -1273,7 +1282,8 @@ static PyObject *py_dl_sym(PyObject *self, PyObject *args)
void
*
handle
;
void
*
handle
;
void
*
ptr
;
void
*
ptr
;
if
(
!
PyArg_ParseTuple
(
args
,
PY_VOID_P_CODE
"s:dlsym"
,
&
handle
,
&
name
))
if
(
!
PyArg_ParseTuple
(
args
,
"O&s:dlsym"
,
&
_parse_voidp
,
&
handle
,
&
name
))
return
NULL
;
return
NULL
;
ptr
=
ctypes_dlsym
((
void
*
)
handle
,
name
);
ptr
=
ctypes_dlsym
((
void
*
)
handle
,
name
);
if
(
!
ptr
)
{
if
(
!
ptr
)
{
...
@@ -1298,8 +1308,8 @@ call_function(PyObject *self, PyObject *args)
...
@@ -1298,8 +1308,8 @@ call_function(PyObject *self, PyObject *args)
PyObject
*
result
;
PyObject
*
result
;
if
(
!
PyArg_ParseTuple
(
args
,
if
(
!
PyArg_ParseTuple
(
args
,
PY_VOID_P_CODE
"
O!"
,
"O&
O!"
,
&
func
,
&
_parse_voidp
,
&
func
,
&
PyTuple_Type
,
&
arguments
))
&
PyTuple_Type
,
&
arguments
))
return
NULL
;
return
NULL
;
...
@@ -1329,8 +1339,8 @@ call_cdeclfunction(PyObject *self, PyObject *args)
...
@@ -1329,8 +1339,8 @@ call_cdeclfunction(PyObject *self, PyObject *args)
PyObject
*
result
;
PyObject
*
result
;
if
(
!
PyArg_ParseTuple
(
args
,
if
(
!
PyArg_ParseTuple
(
args
,
PY_VOID_P_CODE
"
O!"
,
"O&
O!"
,
&
func
,
&
_parse_voidp
,
&
func
,
&
PyTuple_Type
,
&
arguments
))
&
PyTuple_Type
,
&
arguments
))
return
NULL
;
return
NULL
;
...
...
Modules/_ctypes/ctypes.h
Dosyayı görüntüle @
410c3b58
...
@@ -24,12 +24,6 @@ typedef int Py_ssize_t;
...
@@ -24,12 +24,6 @@ typedef int Py_ssize_t;
#define PY_LONG_LONG LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#endif
#if SIZEOF_VOID_P == SIZEOF_LONG
#define PY_VOID_P_CODE "k"
#elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P == SIZEOF_LONG_LONG)
#define PY_VOID_P_CODE "K"
#endif
typedef
struct
tagPyCArgObject
PyCArgObject
;
typedef
struct
tagPyCArgObject
PyCArgObject
;
typedef
struct
tagCDataObject
CDataObject
;
typedef
struct
tagCDataObject
CDataObject
;
typedef
PyObject
*
(
*
GETFUNC
)(
void
*
,
Py_ssize_t
size
);
typedef
PyObject
*
(
*
GETFUNC
)(
void
*
,
Py_ssize_t
size
);
...
...
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