Skip to content

Commit afccb0a

Browse files
committed
sqlite: Use Py_ssize_t to store a size instead of an int
Fix a compiler warning on Windows 64-bit
1 parent cb29ec5 commit afccb0a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/_sqlite/statement.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
184184
int i;
185185
int rc;
186186
int num_params_needed;
187-
int num_params;
187+
Py_ssize_t num_params;
188188

189189
Py_BEGIN_ALLOW_THREADS
190190
num_params_needed = sqlite3_bind_parameter_count(self->st);
@@ -200,7 +200,9 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
200200
num_params = PySequence_Size(parameters);
201201
}
202202
if (num_params != num_params_needed) {
203-
PyErr_Format(pysqlite_ProgrammingError, "Incorrect number of bindings supplied. The current statement uses %d, and there are %d supplied.",
203+
PyErr_Format(pysqlite_ProgrammingError,
204+
"Incorrect number of bindings supplied. The current "
205+
"statement uses %d, and there are %zd supplied.",
204206
num_params_needed, num_params);
205207
return;
206208
}

0 commit comments

Comments
 (0)