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

Skip to content

Commit 69387e1

Browse files
committed
More cases of input parameters passed by reference without const.
1 parent ae57b7f commit 69387e1

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

Mac/Modules/qt/_Qtmodule.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25835,18 +25835,18 @@ static PyObject *Qt_TuneSetHeader(PyObject *_self, PyObject *_args)
2583525835
PyObject *_res = NULL;
2583625836
ComponentResult _rv;
2583725837
TunePlayer tp;
25838-
unsigned long header;
25838+
unsigned long * header;
2583925839
#ifndef TuneSetHeader
2584025840
PyMac_PRECHECK(TuneSetHeader);
2584125841
#endif
25842-
if (!PyArg_ParseTuple(_args, "O&",
25843-
CmpInstObj_Convert, &tp))
25842+
if (!PyArg_ParseTuple(_args, "O&s",
25843+
CmpInstObj_Convert, &tp,
25844+
&header))
2584425845
return NULL;
2584525846
_rv = TuneSetHeader(tp,
25846-
&header);
25847-
_res = Py_BuildValue("ll",
25848-
_rv,
25849-
header);
25847+
header);
25848+
_res = Py_BuildValue("l",
25849+
_rv);
2585025850
return _res;
2585125851
}
2585225852

@@ -26149,21 +26149,21 @@ static PyObject *Qt_TuneSetHeaderWithSize(PyObject *_self, PyObject *_args)
2614926149
PyObject *_res = NULL;
2615026150
ComponentResult _rv;
2615126151
TunePlayer tp;
26152-
unsigned long header;
26152+
unsigned long * header;
2615326153
unsigned long size;
2615426154
#ifndef TuneSetHeaderWithSize
2615526155
PyMac_PRECHECK(TuneSetHeaderWithSize);
2615626156
#endif
26157-
if (!PyArg_ParseTuple(_args, "O&l",
26157+
if (!PyArg_ParseTuple(_args, "O&sl",
2615826158
CmpInstObj_Convert, &tp,
26159+
&header,
2615926160
&size))
2616026161
return NULL;
2616126162
_rv = TuneSetHeaderWithSize(tp,
26162-
&header,
26163+
header,
2616326164
size);
26164-
_res = Py_BuildValue("ll",
26165-
_rv,
26166-
header);
26165+
_res = Py_BuildValue("l",
26166+
_rv);
2616726167
return _res;
2616826168
}
2616926169

@@ -27937,7 +27937,7 @@ static PyMethodDef Qt_methods[] = {
2793727937
{"NATask", (PyCFunction)Qt_NATask, 1,
2793827938
PyDoc_STR("(NoteAllocator na) -> (ComponentResult _rv)")},
2793927939
{"TuneSetHeader", (PyCFunction)Qt_TuneSetHeader, 1,
27940-
PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv, unsigned long header)")},
27940+
PyDoc_STR("(TunePlayer tp, unsigned long * header) -> (ComponentResult _rv)")},
2794127941
{"TuneGetTimeBase", (PyCFunction)Qt_TuneGetTimeBase, 1,
2794227942
PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv, TimeBase tb)")},
2794327943
{"TuneSetTimeScale", (PyCFunction)Qt_TuneSetTimeScale, 1,
@@ -27969,7 +27969,7 @@ static PyMethodDef Qt_methods[] = {
2796927969
{"TuneSetSoundLocalization", (PyCFunction)Qt_TuneSetSoundLocalization, 1,
2797027970
PyDoc_STR("(TunePlayer tp, Handle data) -> (ComponentResult _rv)")},
2797127971
{"TuneSetHeaderWithSize", (PyCFunction)Qt_TuneSetHeaderWithSize, 1,
27972-
PyDoc_STR("(TunePlayer tp, unsigned long size) -> (ComponentResult _rv, unsigned long header)")},
27972+
PyDoc_STR("(TunePlayer tp, unsigned long * header, unsigned long size) -> (ComponentResult _rv)")},
2797327973
{"TuneSetPartMix", (PyCFunction)Qt_TuneSetPartMix, 1,
2797427974
PyDoc_STR("(TunePlayer tp, unsigned long partNumber, long volume, long balance, long mixFlags) -> (ComponentResult _rv)")},
2797527975
{"TuneGetPartMix", (PyCFunction)Qt_TuneGetPartMix, 1,

Mac/Modules/qt/qtscan.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ def makerepairinstructions(self):
306306
# It seems MusicMIDIPacket if never flagged with const but always used
307307
# for sending only. If that ever changes this needs to be fixed.
308308
([('MusicMIDIPacket', '*', 'OutMode')], [('MusicMIDIPacket_ptr', '*', 'InMode')]),
309+
310+
# QTMusic const-less input parameters
311+
([('unsigned_long', 'header', 'OutMode')], [('UnsignedLongPtr', 'header', 'InMode')]),
309312
]
310313

311314
if __name__ == "__main__":

Mac/Modules/qt/qtsupport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
HandlerError = Type("HandlerError", "l")
212212
Ptr = InputOnlyType("Ptr", "s")
213213
StringPtr = Type("StringPtr", "s")
214+
UnsignedLongPtr = Type("unsigned long *", "s")
214215
mcactionparams = InputOnlyType("void *", "s")
215216
QTParameterDialog = Type("QTParameterDialog", "l")
216217
QTAtomID = Type("QTAtomID", "l")

0 commit comments

Comments
 (0)