Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4100900

Browse files
committed
Added a rewrite rule so the Str255 argument of GetControlTitle is seen as
output parameter.
1 parent 39fc1bc commit 4100900

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Mac/Modules/ctl/Ctlmodule.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,12 @@ static PyObject *CtlObj_GetControlTitle(_self, _args)
462462
{
463463
PyObject *_res = NULL;
464464
Str255 title;
465-
if (!PyArg_ParseTuple(_args, "O&",
466-
PyMac_GetStr255, title))
465+
if (!PyArg_ParseTuple(_args, ""))
467466
return NULL;
468467
GetControlTitle(_self->ob_itself,
469468
title);
470-
Py_INCREF(Py_None);
471-
_res = Py_None;
469+
_res = Py_BuildValue("O&",
470+
PyMac_BuildStr255, title);
472471
return _res;
473472
}
474473

@@ -952,7 +951,7 @@ static PyMethodDef CtlObj_methods[] = {
952951
{"SetControlTitle", (PyCFunction)CtlObj_SetControlTitle, 1,
953952
"(Str255 title) -> None"},
954953
{"GetControlTitle", (PyCFunction)CtlObj_GetControlTitle, 1,
955-
"(Str255 title) -> None"},
954+
"() -> (Str255 title)"},
956955
{"GetControlValue", (PyCFunction)CtlObj_GetControlValue, 1,
957956
"() -> (SInt16 _rv)"},
958957
{"SetControlValue", (PyCFunction)CtlObj_SetControlValue, 1,

Mac/Modules/ctl/ctlscan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def makerepairinstructions(self):
8383
## ([("ControlActionUPP", "actionProc", "InMode")],
8484
## [("FakeType('(ControlActionUPP)0')", "*", "*")]),
8585

86+
# For GetControlTitle
87+
([('Str255', 'title', 'InMode')],
88+
[('Str255', 'title', 'OutMode')]),
89+
8690
([("ControlHandle", "*", "OutMode")],
8791
[("ExistingControlHandle", "*", "*")]),
8892
([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers

0 commit comments

Comments
 (0)