]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
sqlite: Use Py_ssize_t to store a size instead of an int
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Nov 2013 01:07:29 +0000 (02:07 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Nov 2013 01:07:29 +0000 (02:07 +0100)
Fix a compiler warning on Windows 64-bit

Modules/_sqlite/statement.c

index 6cc0e16c0174e7b058dd5bd540d63cad060faf5b..66b4a52565247f7567207d7d923caefce42ecaea 100644 (file)
@@ -184,7 +184,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
     int i;
     int rc;
     int num_params_needed;
-    int num_params;
+    Py_ssize_t num_params;
 
     Py_BEGIN_ALLOW_THREADS
     num_params_needed = sqlite3_bind_parameter_count(self->st);
@@ -200,7 +200,9 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
             num_params = PySequence_Size(parameters);
         }
         if (num_params != num_params_needed) {
-            PyErr_Format(pysqlite_ProgrammingError, "Incorrect number of bindings supplied. The current statement uses %d, and there are %d supplied.",
+            PyErr_Format(pysqlite_ProgrammingError,
+                         "Incorrect number of bindings supplied. The current "
+                         "statement uses %d, and there are %zd supplied.",
                          num_params_needed, num_params);
             return;
         }