Commit 72f3b7a5 authored by Jack Jansen's avatar Jack Jansen

Added missing casts.

parent 747c3d3f
...@@ -2339,7 +2339,7 @@ imp_set_frozenmodules(PyObject *self, PyObject *args) ...@@ -2339,7 +2339,7 @@ imp_set_frozenmodules(PyObject *self, PyObject *args)
goto typeerror; goto typeerror;
frozenmodules[i].name = PyString_AsString(name); frozenmodules[i].name = PyString_AsString(name);
if (PyObject_IsTrue(code)) { if (PyObject_IsTrue(code)) {
frozenmodules[i].code = PyString_AsString(code); frozenmodules[i].code = (unsigned char *)PyString_AsString(code);
frozenmodules[i].size = PyString_Size(code); frozenmodules[i].size = PyString_Size(code);
} else { } else {
frozenmodules[i].code = NULL; frozenmodules[i].code = NULL;
...@@ -2407,7 +2407,7 @@ imp_get_frozenmodules(PyObject *self, PyObject *args) ...@@ -2407,7 +2407,7 @@ imp_get_frozenmodules(PyObject *self, PyObject *args)
Py_INCREF(ob); Py_INCREF(ob);
PyTuple_SET_ITEM(item, 0, ob); PyTuple_SET_ITEM(item, 0, ob);
if (p->code != NULL) { if (p->code != NULL) {
ob = PyString_FromStringAndSize(p->code, ob = PyString_FromStringAndSize((char *)p->code,
p->size >= 0 ? p->size : -(p->size)); p->size >= 0 ? p->size : -(p->size));
if (ob == NULL) if (ob == NULL)
goto error; goto error;
......
...@@ -618,8 +618,8 @@ maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit) ...@@ -618,8 +618,8 @@ maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit)
#ifdef macintosh #ifdef macintosh
/* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */ /* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */
if (PyMac_getfiletype(filename) == 'PYC ' if (PyMac_getfiletype((char *)filename) == 'PYC '
|| PyMac_getfiletype(filename) == 'APPL') || PyMac_getfiletype((char *)filename) == 'APPL')
return 1; return 1;
#endif /* macintosh */ #endif /* macintosh */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment