mirror of https://github.com/python/cpython.git
fixed SetEventParameter() signature: removed unneccesary length arg.
This commit is contained in:
parent
8edfc542f0
commit
43c2de230d
|
@ -107,7 +107,10 @@ def makeblacklistnames(self):
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
def makerepairinstructions(self):
|
def makerepairinstructions(self):
|
||||||
return []
|
return [
|
||||||
|
([("UInt32", 'inSize', "InMode"), ("void_ptr", 'inDataPtr', "InMode")],
|
||||||
|
[("MyInBuffer", 'inDataPtr', "InMode")])
|
||||||
|
]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -34,6 +34,12 @@
|
||||||
void_ptr = stringptr
|
void_ptr = stringptr
|
||||||
# here are some types that are really other types
|
# here are some types that are really other types
|
||||||
|
|
||||||
|
class MyVarInputBufferType(VarInputBufferType):
|
||||||
|
def passInput(self, name):
|
||||||
|
return "%s__len__, %s__in__" % (name, name)
|
||||||
|
|
||||||
|
MyInBuffer = MyVarInputBufferType('char', 'long', 'l') # (buf, len)
|
||||||
|
|
||||||
EventTime = double
|
EventTime = double
|
||||||
EventTimeout = EventTime
|
EventTimeout = EventTime
|
||||||
EventTimerInterval = EventTime
|
EventTimerInterval = EventTime
|
||||||
|
|
|
@ -215,19 +215,19 @@ static PyObject *EventRef_SetEventParameter(EventRefObject *_self, PyObject *_ar
|
||||||
OSStatus _err;
|
OSStatus _err;
|
||||||
OSType inName;
|
OSType inName;
|
||||||
OSType inType;
|
OSType inType;
|
||||||
UInt32 inSize;
|
char *inDataPtr__in__;
|
||||||
char* inDataPtr;
|
long inDataPtr__len__;
|
||||||
if (!PyArg_ParseTuple(_args, "O&O&ls",
|
int inDataPtr__in_len__;
|
||||||
|
if (!PyArg_ParseTuple(_args, "O&O&s#",
|
||||||
PyMac_GetOSType, &inName,
|
PyMac_GetOSType, &inName,
|
||||||
PyMac_GetOSType, &inType,
|
PyMac_GetOSType, &inType,
|
||||||
&inSize,
|
&inDataPtr__in__, &inDataPtr__in_len__))
|
||||||
&inDataPtr))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
inDataPtr__len__ = inDataPtr__in_len__;
|
||||||
_err = SetEventParameter(_self->ob_itself,
|
_err = SetEventParameter(_self->ob_itself,
|
||||||
inName,
|
inName,
|
||||||
inType,
|
inType,
|
||||||
inSize,
|
inDataPtr__len__, inDataPtr__in__);
|
||||||
inDataPtr);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
_res = Py_None;
|
_res = Py_None;
|
||||||
|
@ -386,7 +386,7 @@ static PyMethodDef EventRef_methods[] = {
|
||||||
{"ReleaseEvent", (PyCFunction)EventRef_ReleaseEvent, 1,
|
{"ReleaseEvent", (PyCFunction)EventRef_ReleaseEvent, 1,
|
||||||
"() -> None"},
|
"() -> None"},
|
||||||
{"SetEventParameter", (PyCFunction)EventRef_SetEventParameter, 1,
|
{"SetEventParameter", (PyCFunction)EventRef_SetEventParameter, 1,
|
||||||
"(OSType inName, OSType inType, UInt32 inSize, char* inDataPtr) -> None"},
|
"(OSType inName, OSType inType, Buffer inDataPtr) -> None"},
|
||||||
{"GetEventClass", (PyCFunction)EventRef_GetEventClass, 1,
|
{"GetEventClass", (PyCFunction)EventRef_GetEventClass, 1,
|
||||||
"() -> (UInt32 _rv)"},
|
"() -> (UInt32 _rv)"},
|
||||||
{"GetEventKind", (PyCFunction)EventRef_GetEventKind, 1,
|
{"GetEventKind", (PyCFunction)EventRef_GetEventKind, 1,
|
||||||
|
|
Loading…
Reference in New Issue