Bug #1005737, #1007249: Fix several build problems and warnings

found on legacy C compilers of HP-UX, IRIX and Tru64.  (Reported
by roadkill, Richard Townsend, Maik Hertha and Minsik Kim)
This commit is contained in:
Hye-Shik Chang 2004-08-19 17:49:56 +00:00
parent 026f8dc103
commit f5a149a6b6
5 changed files with 45 additions and 42 deletions

View file

@ -2,7 +2,7 @@
* multibytecodec.c: Common Multibyte Codec Implementation
*
* Written by Hye-Shik Chang <perky@FreeBSD.org>
* $CJKCodecs: multibytecodec.c,v 1.12 2004/06/27 19:24:13 perky Exp $
* $CJKCodecs: multibytecodec.c,v 1.13 2004/08/19 16:57:19 perky Exp $
*/
#include "Python.h"
@ -338,7 +338,7 @@ multibytecodec_decerror(MultibyteCodec *codec,
/* use cached exception object if available */
if (buf->excobj == NULL) {
buf->excobj = PyUnicodeDecodeError_Create(codec->encoding,
buf->inbuf_top,
(const char *)buf->inbuf_top,
(int)(buf->inbuf_end - buf->inbuf_top),
start, end, reason);
if (buf->excobj == NULL)
@ -965,7 +965,7 @@ mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
PyObject *unistr)
{
PyObject *wr, *ucvt, *r = NULL;
Py_UNICODE *inbuf, *inbuf_end, *data, *inbuf_tmp = NULL;
Py_UNICODE *inbuf, *inbuf_end, *inbuf_tmp = NULL;
int datalen;
if (PyUnicode_Check(unistr))
@ -982,7 +982,6 @@ mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
}
}
data = PyUnicode_AS_UNICODE(unistr);
datalen = PyUnicode_GET_SIZE(unistr);
if (datalen == 0) {
Py_XDECREF(ucvt);