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

Skip to content

Commit ecc6635

Browse files
committed
Converted manually written code to the new K format specifier.
Untested, but at least it still compiles.
1 parent 269b2a6 commit ecc6635

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

Mac/Modules/Nav.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ filldialogoptions(PyObject *d,
167167
}
168168
*defaultLocationP = defaultLocation_storage;
169169
} else if( strcmp(keystr, "version") == 0 ) {
170-
if ( !PyArg_Parse(value, "h", &opt->version) )
170+
if ( !PyArg_Parse(value, "H", &opt->version) )
171171
return 0;
172172
} else if( strcmp(keystr, "dialogOptionFlags") == 0 ) {
173-
if ( !PyArg_Parse(value, "l", &opt->dialogOptionFlags) )
173+
if ( !PyArg_Parse(value, "K", &opt->dialogOptionFlags) )
174174
return 0;
175175
} else if( strcmp(keystr, "location") == 0 ) {
176176
if ( !PyArg_Parse(value, "O&", PyMac_GetPoint, &opt->location) )
@@ -247,7 +247,7 @@ nav_NavTranslateFile(navrrobject *self, PyObject *args)
247247
NavTranslationOptions howToTranslate;
248248
OSErr err;
249249

250-
if (!PyArg_ParseTuple(args, "l", &howToTranslate))
250+
if (!PyArg_ParseTuple(args, "K", &howToTranslate))
251251
return NULL;
252252
err = NavTranslateFile(&self->itself, howToTranslate);
253253
if ( err ) {
@@ -268,7 +268,7 @@ nav_NavCompleteSave(navrrobject *self, PyObject *args)
268268
NavTranslationOptions howToTranslate;
269269
OSErr err;
270270

271-
if (!PyArg_ParseTuple(args, "l", &howToTranslate))
271+
if (!PyArg_ParseTuple(args, "K", &howToTranslate))
272272
return NULL;
273273
err = NavCompleteSave(&self->itself, howToTranslate);
274274
if ( err ) {
@@ -528,7 +528,7 @@ nav_NavAskSaveChanges(PyObject *self, PyObject *args, PyObject *kw)
528528
OSErr err;
529529

530530
if ( kw && PyObject_IsTrue(kw) ) {
531-
if (!PyArg_ParseTuple(args, "l", &action))
531+
if (!PyArg_ParseTuple(args, "K", &action))
532532
return NULL;
533533
dict = kw;
534534
} else if (!PyArg_ParseTuple(args, "lO!", &action, &PyDict_Type, &dict))

Mac/Modules/scrap/_Scrapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static PyObject *ScrapObj_PutScrapFlavor(ScrapObject *_self, PyObject *_args)
138138
ScrapFlavorFlags flavorFlags;
139139
char *flavorData__in__;
140140
int flavorData__in_len__;
141-
if (!PyArg_ParseTuple(_args, "O&ls#",
141+
if (!PyArg_ParseTuple(_args, "O&Ks#",
142142
PyMac_GetOSType, &flavorType,
143143
&flavorFlags,
144144
&flavorData__in__, &flavorData__in_len__))

Python/mactoolboxglue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ PyMac_BuildPoint(Point p)
415415
int
416416
PyMac_GetEventRecord(PyObject *v, EventRecord *e)
417417
{
418-
return PyArg_Parse(v, "(Hll(hh)H)",
418+
return PyArg_Parse(v, "(HKK(hh)H)",
419419
&e->what,
420420
&e->message,
421421
&e->when,
@@ -471,7 +471,7 @@ PyMac_Getwide(PyObject *v, wide *rv)
471471
rv->hi = -1;
472472
return 1;
473473
}
474-
return PyArg_Parse(v, "(ll)", &rv->hi, &rv->lo);
474+
return PyArg_Parse(v, "(KK)", &rv->hi, &rv->lo);
475475
}
476476

477477

0 commit comments

Comments
 (0)