Windows MSVC: Fix data loss compiler warnings

Fixed MSVC compiler warnings where it was indicating a conversion
from a larger data type to smaller data type might have data loss.
This commit is contained in:
Jason Erickson 2011-02-23 15:11:27 -07:00 committed by Daniele Varrazzo
parent 6f0dfe6d2d
commit 631883f62f
2 changed files with 5 additions and 3 deletions

View File

@ -124,10 +124,11 @@ static PyObject *
psyco_lobj_read(lobjectObject *self, PyObject *args)
{
PyObject *res;
int where, end, size = -1;
int where, end;
Py_ssize_t size = -1;
char *buffer;
if (!PyArg_ParseTuple(args, "|i", &size)) return NULL;
if (!PyArg_ParseTuple(args, "|" CONV_CODE_PY_SSIZE_T, &size)) return NULL;
EXC_IF_LOBJ_CLOSED(self);
EXC_IF_LOBJ_LEVEL0(self);

View File

@ -100,7 +100,8 @@ static int
xid_init(XidObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = {"format_id", "gtrid", "bqual", NULL};
int format_id, i, gtrid_len, bqual_len;
int format_id;
size_t i, gtrid_len, bqual_len;
const char *gtrid, *bqual;
PyObject *tmp;