Index: Python/mactoolboxglue.c =================================================================== --- Python/mactoolboxglue.c (revision 51574) +++ Python/mactoolboxglue.c (working copy) @@ -142,7 +142,8 @@ PyObject *args = PyObject_GetAttrString(exc, "args"); if (args) { char *ignore; - PyArg_ParseTuple(args, "is", &err, &ignore); + /* OSErr is SInt16, so parse with 'h' format. */ + PyArg_ParseTuple(args, "hs", &err, &ignore); Py_XDECREF(args); } } Index: Mac/Modules/qt/_Qtmodule.c =================================================================== --- Mac/Modules/qt/_Qtmodule.c (revision 51574) +++ Mac/Modules/qt/_Qtmodule.c (working copy) @@ -81,10 +81,15 @@ static int QtMusicMIDIPacket_Convert(PyObject *v, MusicMIDIPacket *p_itself) { - int dummy; + char *data; + int len; - if( !PyArg_ParseTuple(v, "hls#", &p_itself->length, &p_itself->reserved, p_itself->data, dummy) ) + if (!PyArg_ParseTuple(v, "hls#", &p_itself->length, + &p_itself->reserved, &data, &len)) return 0; + if (len > sizeof(p_itself->data)) + return 0; + memcpy (p_itself->data, data, len); return 1; } @@ -25849,7 +25854,8 @@ #endif if (!PyArg_ParseTuple(_args, "O&s", CmpInstObj_Convert, &tp, - &header)) + /* XXX mvl is this the right parameter type*/ + (char**)&header)) return NULL; _rv = TuneSetHeader(tp, header); @@ -26164,7 +26170,7 @@ #endif if (!PyArg_ParseTuple(_args, "O&sl", CmpInstObj_Convert, &tp, - &header, + (char**)&header, &size)) return NULL; _rv = TuneSetHeaderWithSize(tp, Index: Mac/Modules/snd/_Sndmodule.c =================================================================== --- Mac/Modules/snd/_Sndmodule.c (revision 51574) +++ Mac/Modules/snd/_Sndmodule.c (working copy) @@ -28,7 +28,12 @@ if (PyArg_ParseTuple(v, "h|hl", &pc->cmd, &pc->param1, &pc->param2)) return 1; PyErr_Clear(); - return PyArg_ParseTuple(v, "Hhs#", &pc->cmd, &pc->param1, &pc->param2, &len); + /* param2 is of type long. This should have the correct + size for a char* on all supported platforms. It + would be better if we could validate correspondence + of using char* with the cmd, though. */ + return PyArg_ParseTuple(v, "Hhs#", &pc->cmd, &pc->param1, + (char**)&pc->param2, &len); } return PyArg_Parse(v, "H", &pc->cmd); } Index: Mac/Modules/mlte/_Mltemodule.c =================================================================== --- Mac/Modules/mlte/_Mltemodule.c (revision 51574) +++ Mac/Modules/mlte/_Mltemodule.c (working copy) @@ -916,7 +916,7 @@ #ifndef TXNActivate PyMac_PRECHECK(TXNActivate); #endif - if (!PyArg_ParseTuple(_args, "ll", + if (!PyArg_ParseTuple(_args, "lb", &iTXNFrameID, &iActiveState)) return NULL; Index: Mac/Modules/scrap/_Scrapmodule.c =================================================================== --- Mac/Modules/scrap/_Scrapmodule.c (revision 51574) +++ Mac/Modules/scrap/_Scrapmodule.c (working copy) @@ -126,7 +126,7 @@ ScrapFlavorFlags flavorFlags; char *flavorData__in__; int flavorData__in_len__; - if (!PyArg_ParseTuple(_args, "O&Ks#", + if (!PyArg_ParseTuple(_args, "O&Is#", PyMac_GetOSType, &flavorType, &flavorFlags, &flavorData__in__, &flavorData__in_len__)) Index: Mac/Modules/cf/_CFmodule.c =================================================================== --- Mac/Modules/cf/_CFmodule.c (revision 51574) +++ Mac/Modules/cf/_CFmodule.c (working copy) @@ -1917,7 +1917,7 @@ #ifndef CFStringGetBytes PyMac_PRECHECK(CFStringGetBytes); #endif - if (!PyArg_ParseTuple(_args, "O&lbll", + if (!PyArg_ParseTuple(_args, "O&lbbl", CFRange_Convert, &range, &encoding, &lossByte, @@ -2259,15 +2259,15 @@ { PyObject *_res = NULL; CFURLRef _rv; - CFURLPathStyle pathStyle; + long pathStyle; Boolean isDirectory; - if (!PyArg_ParseTuple(_args, "ll", + if (!PyArg_ParseTuple(_args, "lb", &pathStyle, &isDirectory)) return NULL; _rv = CFURLCreateWithFileSystemPath((CFAllocatorRef)NULL, _self->ob_itself, - pathStyle, + (CFURLPathStyle)pathStyle, isDirectory); _res = Py_BuildValue("O&", CFURLRefObj_New, _rv); @@ -2278,17 +2278,17 @@ { PyObject *_res = NULL; CFURLRef _rv; - CFURLPathStyle pathStyle; + long pathStyle; Boolean isDirectory; CFURLRef baseURL; - if (!PyArg_ParseTuple(_args, "llO&", + if (!PyArg_ParseTuple(_args, "lbO&", &pathStyle, &isDirectory, OptionalCFURLRefObj_Convert, &baseURL)) return NULL; _rv = CFURLCreateWithFileSystemPathRelativeToBase((CFAllocatorRef)NULL, _self->ob_itself, - pathStyle, + (CFURLPathStyle)pathStyle, isDirectory, baseURL); _res = Py_BuildValue("O&", @@ -2978,15 +2978,15 @@ { PyObject *_res = NULL; CFDataRef _rv; - CFStringEncoding encoding; + long encoding; Boolean escapeWhitespace; - if (!PyArg_ParseTuple(_args, "ll", + if (!PyArg_ParseTuple(_args, "lb", &encoding, &escapeWhitespace)) return NULL; _rv = CFURLCreateData((CFAllocatorRef)NULL, _self->ob_itself, - encoding, + (CFStringEncoding)encoding, escapeWhitespace); _res = Py_BuildValue("O&", CFDataRefObj_New, _rv); @@ -3003,7 +3003,7 @@ #ifndef CFURLGetFileSystemRepresentation PyMac_PRECHECK(CFURLGetFileSystemRepresentation); #endif - if (!PyArg_ParseTuple(_args, "ll", + if (!PyArg_ParseTuple(_args, "bl", &resolveAgainstBase, &maxBufLen)) return NULL; @@ -3144,7 +3144,7 @@ { PyObject *_res = NULL; CFStringRef _rv; - CFURLPathStyle pathStyle; + long pathStyle; #ifndef CFURLCopyFileSystemPath PyMac_PRECHECK(CFURLCopyFileSystemPath); #endif @@ -3152,7 +3152,7 @@ &pathStyle)) return NULL; _rv = CFURLCopyFileSystemPath(_self->ob_itself, - pathStyle); + (CFURLPathStyle)pathStyle); _res = Py_BuildValue("O&", CFStringRefObj_New, _rv); return _res; @@ -3338,7 +3338,7 @@ CFURLRef _rv; CFStringRef pathComponent; Boolean isDirectory; - if (!PyArg_ParseTuple(_args, "O&l", + if (!PyArg_ParseTuple(_args, "O&b", CFStringRefObj_Convert, &pathComponent, &isDirectory)) return NULL; @@ -4366,7 +4366,7 @@ #ifndef CFStringCreateWithBytes PyMac_PRECHECK(CFStringCreateWithBytes); #endif - if (!PyArg_ParseTuple(_args, "s#ll", + if (!PyArg_ParseTuple(_args, "s#lb", &bytes__in__, &bytes__in_len__, &encoding, &isExternalRepresentation)) @@ -4622,7 +4622,7 @@ #ifndef CFURLCreateFromFileSystemRepresentation PyMac_PRECHECK(CFURLCreateFromFileSystemRepresentation); #endif - if (!PyArg_ParseTuple(_args, "s#l", + if (!PyArg_ParseTuple(_args, "s#b", &buffer__in__, &buffer__in_len__, &isDirectory)) return NULL; @@ -4647,7 +4647,7 @@ #ifndef CFURLCreateFromFileSystemRepresentationRelativeToBase PyMac_PRECHECK(CFURLCreateFromFileSystemRepresentationRelativeToBase); #endif - if (!PyArg_ParseTuple(_args, "s#lO&", + if (!PyArg_ParseTuple(_args, "s#bO&", &buffer__in__, &buffer__in_len__, &isDirectory, OptionalCFURLRefObj_Convert, &baseURL))