X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/59988ec504f4129c2b1af7df4c3133036f5de92b..9f9c513165bbcae496b79656304e60bf74557af4:/lib/actions/action.cpp diff --git a/lib/actions/action.cpp b/lib/actions/action.cpp index 0fa52361..54684847 100644 --- a/lib/actions/action.cpp +++ b/lib/actions/action.cpp @@ -129,8 +129,8 @@ struct call_entry PyObject *m_fnc, *m_arg; eWidget *m_widget; void *m_widget_arg; - call_entry(PyObject *fnc, PyObject *arg): m_fnc(fnc), m_arg(arg) { } - call_entry(eWidget *widget, void *arg): m_widget(widget), m_widget_arg(arg) { } + call_entry(PyObject *fnc, PyObject *arg): m_fnc(fnc), m_arg(arg), m_widget(0), m_widget_arg(0) { } + call_entry(eWidget *widget, void *arg): m_fnc(0), m_arg(0), m_widget(widget), m_widget_arg(arg) { } }; void eActionMap::keyPressed(int device, int key, int flags) @@ -182,8 +182,8 @@ void eActionMap::keyPressed(int device, int key, int flags) (k->second.m_flags & (1<first.c_str())); - PyTuple_SetItem(pArgs, 1, PyString_FromString(k->second.m_action.c_str())); + PyTuple_SET_ITEM(pArgs, 0, PyString_FromString(k->first.c_str())); + PyTuple_SET_ITEM(pArgs, 1, PyString_FromString(k->second.m_action.c_str())); ++k; Py_INCREF(i->second.m_fnc); call_list.push_back(call_entry(i->second.m_fnc, pArgs)); @@ -193,8 +193,8 @@ void eActionMap::keyPressed(int device, int key, int flags) } else { PyObject *pArgs = PyTuple_New(2); - PyTuple_SetItem(pArgs, 0, PyInt_FromLong(key)); - PyTuple_SetItem(pArgs, 1, PyInt_FromLong(flags)); + PyTuple_SET_ITEM(pArgs, 0, PyInt_FromLong(key)); + PyTuple_SET_ITEM(pArgs, 1, PyInt_FromLong(flags)); Py_INCREF(i->second.m_fnc); call_list.push_back(call_entry(i->second.m_fnc, pArgs)); }