Skip to content

Commit 06e242c

Browse files
author
Erlend E. Aasland
committed
pysqlite_statement_reset result() is never used => return void
1 parent 0633095 commit 06e242c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Modules/_sqlite/cursor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ cursor_dealloc(pysqlite_Cursor *self)
117117
PyObject_ClearWeakRefs((PyObject*)self);
118118
}
119119
if (self->statement) {
120-
(void)pysqlite_statement_reset(self->statement);
120+
pysqlite_statement_reset(self->statement);
121121
}
122122
tp->tp_clear((PyObject *)self);
123123
tp->tp_free(self);
@@ -565,7 +565,7 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
565565
break;
566566
}
567567

568-
(void)pysqlite_statement_reset(self->statement);
568+
pysqlite_statement_reset(self->statement);
569569
pysqlite_statement_mark_dirty(self->statement);
570570

571571
pysqlite_statement_bind_parameters(state, self->statement, parameters);

Modules/_sqlite/statement.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,19 +360,20 @@ pysqlite_statement_bind_parameters(pysqlite_state *state,
360360
}
361361
}
362362

363-
int pysqlite_statement_reset(pysqlite_Statement* self)
363+
void
364+
pysqlite_statement_reset(pysqlite_Statement *self)
364365
{
365366
sqlite3_stmt *stmt = self->st;
366367
if (stmt == NULL || self->in_use == 0) {
367-
return SQLITE_OK;
368+
return;
368369
}
369370

370371
#if SQLITE_VERSION_NUMBER >= 3020000
371372
/* Check if the statement has been run (that is, sqlite3_step() has been
372373
* called at least once). Third parameter is non-zero in order to reset the
373374
* run count. */
374375
if (sqlite3_stmt_status(stmt, SQLITE_STMTSTATUS_RUN, 1) == 0) {
375-
return SQLITE_OK;
376+
return;
376377
}
377378
#endif
378379

@@ -384,7 +385,6 @@ int pysqlite_statement_reset(pysqlite_Statement* self)
384385
if (rc == SQLITE_OK) {
385386
self->in_use = 0;
386387
}
387-
return rc;
388388
}
389389

390390
void pysqlite_statement_mark_dirty(pysqlite_Statement* self)

Modules/_sqlite/statement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void pysqlite_statement_bind_parameters(pysqlite_state *state,
4444
pysqlite_Statement *self,
4545
PyObject *parameters);
4646

47-
int pysqlite_statement_reset(pysqlite_Statement* self);
47+
void pysqlite_statement_reset(pysqlite_Statement *self);
4848
void pysqlite_statement_mark_dirty(pysqlite_Statement* self);
4949

5050
int pysqlite_statement_setup_types(PyObject *module);

0 commit comments

Comments
 (0)