[Python-checkins] cpython: Fix a compiler warning on Windows 64-bit: _sqlite module
victor.stinner
python-checkins at python.org
Mon Nov 18 01:56:50 CET 2013
http://hg.python.org/cpython/rev/855e172bcac4
changeset: 87233:855e172bcac4
user: Victor Stinner <victor.stinner at gmail.com>
date: Mon Nov 18 01:27:30 2013 +0100
summary:
Fix a compiler warning on Windows 64-bit: _sqlite module
files:
Modules/_sqlite/row.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -67,7 +67,7 @@
{
long _idx;
char* key;
- int nitems, i;
+ Py_ssize_t nitems, i;
char* compare_key;
char* p1;
@@ -88,7 +88,10 @@
nitems = PyTuple_Size(self->description);
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) {
return NULL;
}
@@ -120,10 +123,12 @@
PyErr_SetString(PyExc_IndexError, "No item with that key");
return NULL;
- } else if (PySlice_Check(idx)) {
+ }
+ else if (PySlice_Check(idx)) {
PyErr_SetString(PyExc_ValueError, "slices not implemented, yet");
return NULL;
- } else {
+ }
+ else {
PyErr_SetString(PyExc_IndexError, "Index must be int or string");
return NULL;
}
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list