mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
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:
parent
6f0dfe6d2d
commit
631883f62f
|
@ -124,10 +124,11 @@ static PyObject *
|
||||||
psyco_lobj_read(lobjectObject *self, PyObject *args)
|
psyco_lobj_read(lobjectObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
int where, end, size = -1;
|
int where, end;
|
||||||
|
Py_ssize_t size = -1;
|
||||||
char *buffer;
|
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_CLOSED(self);
|
||||||
EXC_IF_LOBJ_LEVEL0(self);
|
EXC_IF_LOBJ_LEVEL0(self);
|
||||||
|
|
|
@ -100,7 +100,8 @@ static int
|
||||||
xid_init(XidObject *self, PyObject *args, PyObject *kwargs)
|
xid_init(XidObject *self, PyObject *args, PyObject *kwargs)
|
||||||
{
|
{
|
||||||
static char *kwlist[] = {"format_id", "gtrid", "bqual", NULL};
|
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;
|
const char *gtrid, *bqual;
|
||||||
PyObject *tmp;
|
PyObject *tmp;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user