Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 84890df

Browse filesBrowse files
authored
Merge pull request #7634 from QuLogic/tkagg-pointers
FIX: Use correct type for Tk addresses.
2 parents f99ae8b + a91559b commit 84890df
Copy full SHA for 84890df

File tree

Expand file treeCollapse file tree

1 file changed

+5
-14
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-14
lines changed

‎src/_tkagg.cpp

Copy file name to clipboardExpand all lines: src/_tkagg.cpp
+5-14Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,32 +183,23 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
183183
return TCL_OK;
184184
}
185185

186-
static PyObject *_pyobj_addr(PyObject *self, PyObject *args)
187-
{
188-
PyObject *pyobj;
189-
if (!PyArg_ParseTuple(args, "O", &pyobj)) {
190-
return NULL;
191-
}
192-
return Py_BuildValue("n", (Py_ssize_t)pyobj);
193-
}
194-
195186
static PyObject *_tkinit(PyObject *self, PyObject *args)
196187
{
197188
Tcl_Interp *interp;
198189
TkappObject *app;
199190

200-
Py_ssize_t arg;
191+
PyObject *arg;
201192
int is_interp;
202-
if (!PyArg_ParseTuple(args, "ni", &arg, &is_interp)) {
193+
if (!PyArg_ParseTuple(args, "Oi", &arg, &is_interp)) {
203194
return NULL;
204195
}
205196

206197
if (is_interp) {
207-
interp = (Tcl_Interp *)arg;
198+
interp = (Tcl_Interp *)PyLong_AsVoidPtr(arg);
208199
} else {
209200
/* Do it the hard way. This will break if the TkappObject
210201
layout changes */
211-
app = (TkappObject *)arg;
202+
app = (TkappObject *)PyLong_AsVoidPtr(arg);
212203
interp = app->interp;
213204
}
214205

@@ -226,7 +217,7 @@ static PyObject *_tkinit(PyObject *self, PyObject *args)
226217

227218
static PyMethodDef functions[] = {
228219
/* Tkinter interface stuff */
229-
{ "_pyobj_addr", (PyCFunction)_pyobj_addr, 1 }, { "tkinit", (PyCFunction)_tkinit, 1 },
220+
{ "tkinit", (PyCFunction)_tkinit, 1 },
230221
{ NULL, NULL } /* sentinel */
231222
};
232223

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.