[Python-checkins] bpo-44991: Normalise function and collation callback naming (GH-28209)

encukou webhook-mailer at python.org
Tue Oct 12 07:39:20 EDT 2021


https://github.com/python/cpython/commit/cfb1df3b71501a80ed57739181ec2ed30012c491
commit: cfb1df3b71501a80ed57739181ec2ed30012c491
branch: main
author: Erlend Egeberg Aasland <erlend.aasland at innova.no>
committer: encukou <encukou at gmail.com>
date: 2021-10-12T13:38:49+02:00
summary:

bpo-44991: Normalise function and collation callback naming (GH-28209)

files:
M Modules/_sqlite/connection.c

diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index b4badb111a3c7..d6d1fa8bf2876 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -667,7 +667,7 @@ set_sqlite_error(sqlite3_context *context, const char *msg)
 }
 
 static void
-_pysqlite_func_callback(sqlite3_context *context, int argc, sqlite3_value **argv)
+func_callback(sqlite3_context *context, int argc, sqlite3_value **argv)
 {
     PyGILState_STATE threadstate = PyGILState_Ensure();
 
@@ -908,7 +908,7 @@ pysqlite_connection_create_function_impl(pysqlite_Connection *self,
         return NULL;
     }
     rc = sqlite3_create_function_v2(self->db, name, narg, flags, ctx,
-                                    _pysqlite_func_callback,
+                                    func_callback,
                                     NULL,
                                     NULL,
                                     &destructor_callback);  // will decref func
@@ -1501,10 +1501,8 @@ pysqlite_connection_executescript(pysqlite_Connection *self,
 /* ------------------------- COLLATION CODE ------------------------ */
 
 static int
-pysqlite_collation_callback(
-        void* context,
-        int text1_length, const void* text1_data,
-        int text2_length, const void* text2_data)
+collation_callback(void *context, int text1_length, const void *text1_data,
+                   int text2_length, const void *text2_data)
 {
     PyGILState_STATE gilstate = PyGILState_Ensure();
 
@@ -1778,7 +1776,7 @@ pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
             return NULL;
         }
         rc = sqlite3_create_collation_v2(self->db, name, flags, ctx,
-                                         &pysqlite_collation_callback,
+                                         &collation_callback,
                                          &destructor_callback);
     }
 



More information about the Python-checkins mailing list