Kaydet (Commit) 83e30bf4 authored tarafından Victor Stinner's avatar Victor Stinner

Fix a compiler warning on Windows 64-bit: _sqlite module

üst 83ed42bf
...@@ -67,7 +67,7 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) ...@@ -67,7 +67,7 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
{ {
long _idx; long _idx;
char* key; char* key;
int nitems, i; Py_ssize_t nitems, i;
char* compare_key; char* compare_key;
char* p1; char* p1;
...@@ -88,7 +88,10 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) ...@@ -88,7 +88,10 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
nitems = PyTuple_Size(self->description); nitems = PyTuple_Size(self->description);
for (i = 0; i < nitems; i++) { for (i = 0; i < nitems; i++) {
compare_key = _PyUnicode_AsString(PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0)); PyObject *obj;
obj = PyTuple_GET_ITEM(self->description, i);
obj = PyTuple_GET_ITEM(obj, 0);
compare_key = _PyUnicode_AsString(obj);
if (!compare_key) { if (!compare_key) {
return NULL; return NULL;
} }
...@@ -120,10 +123,12 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) ...@@ -120,10 +123,12 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
PyErr_SetString(PyExc_IndexError, "No item with that key"); PyErr_SetString(PyExc_IndexError, "No item with that key");
return NULL; return NULL;
} else if (PySlice_Check(idx)) { }
else if (PySlice_Check(idx)) {
PyErr_SetString(PyExc_ValueError, "slices not implemented, yet"); PyErr_SetString(PyExc_ValueError, "slices not implemented, yet");
return NULL; return NULL;
} else { }
else {
PyErr_SetString(PyExc_IndexError, "Index must be int or string"); PyErr_SetString(PyExc_IndexError, "Index must be int or string");
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment