Eliminate compiler warnings on 32-bit Windows.

This commit is contained in:
Anthony Tuininga 2017-12-07 15:56:26 -07:00
parent 864780da2a
commit 5d728693ca
2 changed files with 5 additions and 5 deletions

View File

@ -816,7 +816,7 @@ static int Cursor_SetBindVariables(udt_Cursor *self, PyObject *parameters,
deferTypeAssignment) < 0)
return -1;
if (newVar) {
if (i < PyList_GET_SIZE(self->bindVariables)) {
if (i < (uint32_t) PyList_GET_SIZE(self->bindVariables)) {
if (PyList_SetItem(self->bindVariables, i,
(PyObject*) newVar) < 0) {
Py_DECREF(newVar);

View File

@ -173,7 +173,7 @@ static PyObject *LOB_InternalRead(udt_LOB *self, uint64_t offset,
// create a buffer of the correct size
if (dpiLob_getBufferSize(self->handle, amount, &bufferSize) < 0)
return Error_RaiseAndReturnNull();
buffer = (char*) PyMem_Malloc(bufferSize);
buffer = (char*) PyMem_Malloc((Py_ssize_t) bufferSize);
if (!buffer)
return PyErr_NoMemory();
@ -189,12 +189,12 @@ static PyObject *LOB_InternalRead(udt_LOB *self, uint64_t offset,
// return the result
if (self->oracleTypeNum == DPI_ORACLE_TYPE_NCLOB)
result = PyUnicode_Decode(buffer, bufferSize,
result = PyUnicode_Decode(buffer, (Py_ssize_t) bufferSize,
self->connection->encodingInfo.nencoding, NULL);
else if (self->oracleTypeNum == DPI_ORACLE_TYPE_CLOB)
result = cxString_FromEncodedString(buffer, bufferSize,
result = cxString_FromEncodedString(buffer, (Py_ssize_t) bufferSize,
self->connection->encodingInfo.encoding);
else result = PyBytes_FromStringAndSize(buffer, bufferSize);
else result = PyBytes_FromStringAndSize(buffer, (Py_ssize_t) bufferSize);
PyMem_Free(buffer);
return result;
}