8000 bpo-43269: Clean up sqlite3 file scope by erlend-aasland · Pull Request #24578 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43269: Clean up sqlite3 file scope #24578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review: Remove 'extern' keyword
  • Loading branch information
Erlend E. Aasland committed Feb 20, 2021
commit bd5c34559f7b85328e0f90a67888d8dc1e740b1a
4 changes: 2 additions & 2 deletions Modules/_sqlite/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pysqlite_cache_dealloc(pysqlite_Cache *self)
Py_DECREF(tp);
}

extern PyObject *
PyObject *
pysqlite_cache_get(pysqlite_Cache *self, PyObject *key)
{
pysqlite_Node* node;
Expand Down Expand Up @@ -297,7 +297,7 @@ static PyType_Spec cache_spec = {
};
PyTypeObject *pysqlite_CacheType = NULL;

extern int
int
pysqlite_cache_setup_types(PyObject *mod)
{
pysqlite_NodeType = (PyTypeObject *)PyType_FromModuleAndSpec(mod, &node_spec, NULL);
Expand Down
10 changes: 5 additions & 5 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ pysqlite_connection_dealloc(pysqlite_Connection *self)
*
* 0 => error; 1 => ok
*/
extern int
int
pysqlite_connection_register_cursor(pysqlite_Connection *connection,
PyObject *cursor)
{
Expand Down Expand Up @@ -362,7 +362,7 @@ pysqlite_connection_close_impl(pysqlite_Connection *self)
*
* 0 => error; 1 => ok
*/
extern int
int
pysqlite_check_connection(pysqlite_Connection *con)
{
if (!con->initialized) {
Expand All @@ -378,7 +378,7 @@ pysqlite_check_connection(pysqlite_Connection *con)
}
}

extern PyObject *
PyObject *
_pysqlite_connection_begin(pysqlite_Connection *self)
{
int rc;
Expand Down Expand Up @@ -1220,7 +1220,7 @@ pysqlite_connection_load_extension_impl(pysqlite_Connection *self,
}
#endif

extern int
int
pysqlite_check_thread(pysqlite_Connection *self)
{
if (self->check_same_thread) {
Expand Down Expand Up @@ -1952,7 +1952,7 @@ static PyType_Spec connection_spec = {

PyTypeObject *pysqlite_ConnectionType = NULL;

extern int
int
pysqlite_connection_setup_types(PyObject *module)
{
pysqlite_ConnectionType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &connection_spec, NULL);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ static PyType_Spec cursor_spec = {

PyTypeObject *pysqlite_CursorType = NULL;

extern int
int
pysqlite_cursor_setup_types(PyObject *module)
{
pysqlite_CursorType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &cursor_spec, NULL);
Expand Down
6 changes: 3 additions & 3 deletions Modules/_sqlite/microprotocols.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static PyObject *psyco_adapters = NULL;

/* pysqlite_microprotocols_init - initialize the adapters dictionary */

extern int
int
pysqlite_microprotocols_init(PyObject *module)
{
/* create adapters dictionary and put it in module namespace */
Expand All @@ -52,7 +52,7 @@ pysqlite_microprotocols_init(PyObject *module)

/* pysqlite_microprotocols_add - add a reverse type-caster to the dictionary */

extern int
int
pysqlite_microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
{
PyObject* key;
Expand All @@ -73,7 +73,7 @@ pysqlite_microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)

/* pysqlite_microprotocols_adapt - adapt an object to the built-in protocol */

extern PyObject *
PyObject *
pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
{
_Py_IDENTIFIER(__adapt__);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/prepare_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static PyType_Spec type_spec = {

PyTypeObject *pysqlite_PrepareProtocolType = NULL;

extern int
int
pysqlite_prepare_protocol_setup_types(PyObject *module)
{
pysqlite_PrepareProtocolType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &type_spec, NULL);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/row.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static PyType_Spec row_spec = {

PyTypeObject *pysqlite_RowType = NULL;

extern int
int
pysqlite_row_setup_types(PyObject *module)
{
pysqlite_RowType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &row_spec, NULL);
Expand Down
14 changes: 7 additions & 7 deletions Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef enum {
TYPE_UNKNOWN
} parameter_type;

extern int
int
pysqlite_statement_create(pysqlite_Statement *self,
pysqlite_Connection *connection, PyObject *sql)
{
Expand Down Expand Up @@ -114,7 +114,7 @@ pysqlite_statement_create(pysqlite_Statement *self,
return rc;
}

extern int
int
pysqlite_statement_bind_parameter(pysqlite_Statement *self, int pos,
PyObject *parameter)
{
Expand Down Expand Up @@ -209,7 +209,7 @@ _need_adapt(PyObject *obj)
}
}

extern void
void
pysqlite_statement_bind_parameters(pysqlite_Statement *self,
PyObject *parameters)
{
Expand Down Expand Up @@ -334,7 +334,7 @@ pysqlite_statement_bind_parameters(pysqlite_Statement *self,
}
}

extern int
int
pysqlite_statement_finalize(pysqlite_Statement *self)
{
int rc;
Expand All @@ -352,7 +352,7 @@ pysqlite_statement_finalize(pysqlite_Statement *self)
return rc;
}

extern int
int
pysqlite_statement_reset(pysqlite_Statement *self)
{
int rc;
Expand All @@ -372,7 +372,7 @@ pysqlite_statement_reset(pysqlite_Statement *self)
return rc;
}

extern void
void
pysqlite_statement_mark_dirty(pysqlite_Statement *self)
{
self->in_use = 1;
Expand Down Expand Up @@ -491,7 +491,7 @@ static PyType_Spec stmt_spec = {
};
PyTypeObject *pysqlite_StatementType = NULL;

extern int
int
pysqlite_statement_setup_types(PyObject *module)
{
pysqlite_StatementType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &stmt_spec, NULL);
Expand Down
6 changes: 3 additions & 3 deletions Modules/_sqlite/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "module.h"
#include "connection.h"

extern int
int
pysqlite_step(sqlite3_stmt *statement, pysqlite_Connection *connection)
{
int rc;
Expand All @@ -46,7 +46,7 @@ pysqlite_step(sqlite3_stmt *statement, pysqlite_Connection *connection)
* Checks the SQLite error code and sets the appropriate DB-API exception.
* Returns the error code (0 means no error occurred).
*/
extern int
int
_pysqlite_seterror(sqlite3 *db, sqlite3_stmt *st)
{
int errorcode = sqlite3_errcode(db);
Expand Down Expand Up @@ -105,7 +105,7 @@ _pysqlite_seterror(sqlite3 *db, sqlite3_stmt *st)
# define IS_LITTLE_ENDIAN 1
#endif

extern sqlite_int64
sqlite_int64
_pysqlite_long_as_int64(PyObject *py_val)
{
int overflow;
Expand Down
0