}
knp = keyname(ch);
- return PyBytes_FromString((knp == NULL) ? "" : (char *)knp);
+ return PyBytes_FromString((knp == NULL) ? "" : knp);
}
#endif
goto error; /* GCOV_NOT_REACHED */
}
- ASSIGN_PTR(cm->ex, PyErr_NewException((char *)cm->fqname, base, NULL));
+ ASSIGN_PTR(cm->ex, PyErr_NewException(cm->fqname, base, NULL));
Py_DECREF(base);
/* add to module */
goto error; /* GCOV_NOT_REACHED */
}
- ASSIGN_PTR(cm->ex, PyErr_NewException((char *)cm->fqname, base, NULL));
+ ASSIGN_PTR(cm->ex, PyErr_NewException(cm->fqname, base, NULL));
Py_DECREF(base);
Py_INCREF(cm->ex);
if (mod == NULL)
return -1;
- o = PyObject_GetAttrString(mod, (char*)symbol);
+ o = PyObject_GetAttrString(mod, symbol);
if (o == NULL)
goto errorexit;
else if (!PyCapsule_IsValid(o, PyMultibyteCodec_CAPSULE_NAME)) {
if (sizehint < 0)
cres = PyObject_CallMethod(self->stream,
- (char *)method, NULL);
+ method, NULL);
else
cres = PyObject_CallMethod(self->stream,
- (char *)method, "i", sizehint);
+ method, "i", sizehint);
if (cres == NULL)
goto errorexit;
static PyObject *
-newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
+newxmlparseobject(const char *encoding, const char *namespace_separator, PyObject *intern)
{
int i;
xmlparseobject *self;
return NULL;
}
- result = newxmlparseobject((char *)encoding, (char *)namespace_separator,
- intern);
+ result = newxmlparseobject(encoding, namespace_separator, intern);
if (intern_decref) {
Py_DECREF(intern);
}
PyModule_AddObject(m, "XMLParserType", (PyObject *) &Xmlparsetype);
PyModule_AddStringConstant(m, "EXPAT_VERSION",
- (char *) XML_ExpatVersion());
+ XML_ExpatVersion());
{
XML_Expat_Version info = XML_ExpatVersionInfo();
PyModule_AddObject(m, "version_info",
#define MYCONST(name) \
if (PyModule_AddStringConstant(errors_module, #name, \
- (char *)XML_ErrorString(name)) < 0) \
+ XML_ErrorString(name)) < 0) \
return NULL; \
tmpnum = PyLong_FromLong(name); \
if (tmpnum == NULL) return NULL; \
_Py_DEC_REFTOTAL;
_Py_ForgetReference(v);
*pv = (PyObject *)
- PyObject_REALLOC((char *)v, PyBytesObject_SIZE + newsize);
+ PyObject_REALLOC(v, PyBytesObject_SIZE + newsize);
if (*pv == NULL) {
PyObject_Del(v);
PyErr_NoMemory();
}
else {
float y = (float)x;
- const char *s = (char*)&y;
+ const unsigned char *s = (unsigned char*)&y;
int i, incr = 1;
if (Py_IS_INFINITY(y) && !Py_IS_INFINITY(x))
return -1;
}
else {
- const char *s = (char*)&x;
+ const unsigned char *s = (unsigned char*)&x;
int i, incr = 1;
if ((double_format == ieee_little_endian_format && !le)
PyObject *result, *strobj;
char *end = NULL;
- result = PyLong_FromString((char*)s, &end, base);
+ result = PyLong_FromString(s, &end, base);
if (end == NULL || (result != NULL && end == s + len))
return result;
Py_XDECREF(result);
_Py_DEC_REFTOTAL;
_Py_ForgetReference(unicode);
- new_unicode = (PyObject *)PyObject_REALLOC((char *)unicode, new_size);
+ new_unicode = (PyObject *)PyObject_REALLOC(unicode, new_size);
if (new_unicode == NULL) {
_Py_NewReference(unicode);
PyErr_NoMemory();
memset(&mbs, 0, sizeof mbs);
while (len)
{
- converted = mbrtowc(&ch, (char*)str, len, &mbs);
+ converted = mbrtowc(&ch, str, len, &mbs);
if (converted == 0)
/* Reached end of string */
break;
memset(newtab, '\0', sizeof newtab);
- newtab[0].name = (char *)name;
+ newtab[0].name = name;
newtab[0].initfunc = initfunc;
return PyImport_ExtendInittab(newtab);