aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/loadext.c4
-rw-r--r--src/sqlite.h.in23
-rw-r--r--src/sqlite3ext.h7
-rw-r--r--src/test1.c1
-rw-r--r--src/test_autoext.c12
-rw-r--r--src/test_func.c10
-rw-r--r--src/test_multiplex.c2
-rw-r--r--src/test_thread.c2
8 files changed, 31 insertions, 30 deletions
diff --git a/src/loadext.c b/src/loadext.c
index 163141bf7..26ba7e649 100644
--- a/src/loadext.c
+++ b/src/loadext.c
@@ -676,7 +676,7 @@ static SQLITE_WSD struct sqlite3AutoExtList {
** loaded by every new database connection.
*/
int sqlite3_auto_extension(
- int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
+ void (*xInit)(void)
){
int rc = SQLITE_OK;
#ifndef SQLITE_OMIT_AUTOINIT
@@ -723,7 +723,7 @@ int sqlite3_auto_extension(
** was not on the list.
*/
int sqlite3_cancel_auto_extension(
- int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
+ void (*xInit)(void)
){
#if SQLITE_THREADSAFE
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 9d28cdc05..27ca6ef4a 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -1046,6 +1046,16 @@ struct sqlite3_io_methods {
typedef struct sqlite3_mutex sqlite3_mutex;
/*
+** CAPI3REF: Loadable Extension Thunk
+**
+** A pointer to the opaque sqlite3_api_routines structure is passed as
+** the third parameter to entry points of [loadable extensions]. This
+** structure must be typedefed in order to work around compiler warnings
+** on some platforms.
+*/
+typedef struct sqlite3_api_routines sqlite3_api_routines;
+
+/*
** CAPI3REF: OS Interface Object
**
** An instance of the sqlite3_vfs object defines the interface between
@@ -2242,7 +2252,7 @@ int sqlite3_complete16(const void *sql);
** A busy handler must not close the database connection
** or [prepared statement] that invoked the busy handler.
*/
-int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
+int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
/*
** CAPI3REF: Set A Busy Timeout
@@ -5681,7 +5691,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
**
** ^(Even though the function prototype shows that xEntryPoint() takes
** no arguments and returns void, SQLite invokes xEntryPoint() with three
-** arguments and expects and integer result as if the signature of the
+** arguments and expects an integer result as if the signature of the
** entry point where as follows:
**
** <blockquote><pre>
@@ -5707,10 +5717,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
** See also: [sqlite3_reset_auto_extension()]
** and [sqlite3_cancel_auto_extension()]
*/
-typedef struct sqlite3_api_routines sqlite3_api_routines;
-int sqlite3_auto_extension(
- int (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
-);
+int sqlite3_auto_extension(void(*xEntryPoint)(void));
/*
** CAPI3REF: Cancel Automatic Extension Loading
@@ -5722,9 +5729,7 @@ int sqlite3_auto_extension(
** unregistered and it returns 0 if X was not on the list of initialization
** routines.
*/
-int sqlite3_cancel_auto_extension(
- int (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
-);
+int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
/*
** CAPI3REF: Reset Automatic Extension Loading
diff --git a/src/sqlite3ext.h b/src/sqlite3ext.h
index 689a5c485..ce87e7469 100644
--- a/src/sqlite3ext.h
+++ b/src/sqlite3ext.h
@@ -19,8 +19,6 @@
#define SQLITE3EXT_H
#include "sqlite3.h"
-typedef struct sqlite3_api_routines sqlite3_api_routines;
-
/*
** The following structure holds pointers to all of the SQLite API
** routines.
@@ -251,13 +249,12 @@ struct sqlite3_api_routines {
char *(*vsnprintf)(int,char*,const char*,va_list);
int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
/* Version 3.8.7 and later */
- int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*));
+ int (*auto_extension)(void(*)(void));
int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
void(*)(void*));
int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
void(*)(void*),unsigned char);
- int (*cancel_auto_extension)(int(*)(sqlite3*,char**,
- const sqlite3_api_routines*));
+ int (*cancel_auto_extension)(void(*)(void));
int (*load_extension)(sqlite3*,const char*,const char*,char**);
void *(*malloc64)(sqlite3_uint64);
sqlite3_uint64 (*msize)(void*);
diff --git a/src/test1.c b/src/test1.c
index ec6d8ecff..aced55217 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -6742,7 +6742,6 @@ static int SQLITE_TCLAPI optimization_control(
return TCL_OK;
}
-typedef struct sqlite3_api_routines sqlite3_api_routines;
/*
** load_static_extension DB NAME ...
**
diff --git a/src/test_autoext.c b/src/test_autoext.c
index f962a51d6..e23e41a08 100644
--- a/src/test_autoext.c
+++ b/src/test_autoext.c
@@ -100,7 +100,7 @@ static int SQLITE_TCLAPI autoExtSqrObjCmd(
int objc,
Tcl_Obj *CONST objv[]
){
- int rc = sqlite3_auto_extension(sqr_init);
+ int rc = sqlite3_auto_extension((void(*)(void))sqr_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -116,7 +116,7 @@ static int SQLITE_TCLAPI cancelAutoExtSqrObjCmd(
int objc,
Tcl_Obj *CONST objv[]
){
- int rc = sqlite3_cancel_auto_extension(sqr_init);
+ int rc = sqlite3_cancel_auto_extension((void(*)(void))sqr_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -132,7 +132,7 @@ static int SQLITE_TCLAPI autoExtCubeObjCmd(
int objc,
Tcl_Obj *CONST objv[]
){
- int rc = sqlite3_auto_extension(cube_init);
+ int rc = sqlite3_auto_extension((void(*)(void))cube_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -148,7 +148,7 @@ static int SQLITE_TCLAPI cancelAutoExtCubeObjCmd(
int objc,
Tcl_Obj *CONST objv[]
){
- int rc = sqlite3_cancel_auto_extension(cube_init);
+ int rc = sqlite3_cancel_auto_extension((void(*)(void))cube_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -164,7 +164,7 @@ static int SQLITE_TCLAPI autoExtBrokenObjCmd(
int objc,
Tcl_Obj *CONST objv[]
){
- int rc = sqlite3_auto_extension(broken_init);
+ int rc = sqlite3_auto_extension((void(*)(void))broken_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -180,7 +180,7 @@ static int SQLITE_TCLAPI cancelAutoExtBrokenObjCmd(
int objc,
Tcl_Obj *CONST objv[]
){
- int rc = sqlite3_cancel_auto_extension(broken_init);
+ int rc = sqlite3_cancel_auto_extension((void(*)(void))broken_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
diff --git a/src/test_func.c b/src/test_func.c
index 6bfa86246..26f0d369e 100644
--- a/src/test_func.c
+++ b/src/test_func.c
@@ -25,7 +25,6 @@
#include "sqliteInt.h"
#include "vdbeInt.h"
-
/*
** Allocate nByte bytes of space using sqlite3_malloc(). If the
** allocation fails, call sqlite3_result_error_nomem() to notify
@@ -704,9 +703,9 @@ static int SQLITE_TCLAPI autoinstall_test_funcs(
Tcl_Obj *CONST objv[]
){
extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
- int rc = sqlite3_auto_extension(registerTestFunctions);
+ int rc = sqlite3_auto_extension((void(*)(void))registerTestFunctions);
if( rc==SQLITE_OK ){
- rc = sqlite3_auto_extension(Md5_Register);
+ rc = sqlite3_auto_extension((void(*)(void))Md5_Register);
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return TCL_OK;
@@ -791,6 +790,7 @@ abuse_err:
return TCL_ERROR;
}
+
/*
** Register commands with the TCL interpreter.
*/
@@ -809,7 +809,7 @@ int Sqlitetest_func_Init(Tcl_Interp *interp){
Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, 0, 0);
}
sqlite3_initialize();
- sqlite3_auto_extension(registerTestFunctions);
- sqlite3_auto_extension(Md5_Register);
+ sqlite3_auto_extension((void(*)(void))registerTestFunctions);
+ sqlite3_auto_extension((void(*)(void))Md5_Register);
return TCL_OK;
}
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index a7820975d..1027aa132 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -1197,7 +1197,7 @@ int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault){
gMultiplex.sIoMethodsV2.xShmUnmap = multiplexShmUnmap;
sqlite3_vfs_register(&gMultiplex.sThisVfs, makeDefault);
- sqlite3_auto_extension(multiplexFuncInit);
+ sqlite3_auto_extension((void(*)(void))multiplexFuncInit);
return SQLITE_OK;
}
diff --git a/src/test_thread.c b/src/test_thread.c
index 927fee1f5..20b4cf148 100644
--- a/src/test_thread.c
+++ b/src/test_thread.c
@@ -280,7 +280,7 @@ static int SQLITE_TCLAPI sqlthread_open(
const char *zFilename;
sqlite3 *db;
char zBuf[100];
- extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
+ extern int Md5_Register(sqlite3*,char**,const sqlite3_api_routines*);
UNUSED_PARAMETER(clientData);
UNUSED_PARAMETER(objc);