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

Skip to content

Commit 72f3b7a

Browse files
committed
Added missing casts.
1 parent 747c3d3 commit 72f3b7a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Python/import.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,7 +2339,7 @@ imp_set_frozenmodules(PyObject *self, PyObject *args)
23392339
goto typeerror;
23402340
frozenmodules[i].name = PyString_AsString(name);
23412341
if (PyObject_IsTrue(code)) {
2342-
frozenmodules[i].code = PyString_AsString(code);
2342+
frozenmodules[i].code = (unsigned char *)PyString_AsString(code);
23432343
frozenmodules[i].size = PyString_Size(code);
23442344
} else {
23452345
frozenmodules[i].code = NULL;
@@ -2407,7 +2407,7 @@ imp_get_frozenmodules(PyObject *self, PyObject *args)
24072407
Py_INCREF(ob);
24082408
PyTuple_SET_ITEM(item, 0, ob);
24092409
if (p->code != NULL) {
2410-
ob = PyString_FromStringAndSize(p->code,
2410+
ob = PyString_FromStringAndSize((char *)p->code,
24112411
p->size >= 0 ? p->size : -(p->size));
24122412
if (ob == NULL)
24132413
goto error;

Python/pythonrun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit)
618618

619619
#ifdef macintosh
620620
/* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */
621-
if (PyMac_getfiletype(filename) == 'PYC '
622-
|| PyMac_getfiletype(filename) == 'APPL')
621+
if (PyMac_getfiletype((char *)filename) == 'PYC '
622+
|| PyMac_getfiletype((char *)filename) == 'APPL')
623623
return 1;
624624
#endif /* macintosh */
625625

0 commit comments

Comments
 (0)