]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Change the xSetSyscall methods of the VFS so that they do not cast object
authordrh <drh@noemail.net>
Wed, 23 Mar 2011 22:02:23 +0000 (22:02 +0000)
committerdrh <drh@noemail.net>
Wed, 23 Mar 2011 22:02:23 +0000 (22:02 +0000)
pointers into function pointers.  Fix other unrelated compiler warnings.

FossilOrigin-Name: e059152adce3a8fb693f082b82b5669a238c8d6f

manifest
manifest.uuid
src/main.c
src/os_unix.c
src/sqlite.h.in

index 03f32c272f8b0d79ad4d3466bc6c1211307d3305..33efc4be6de8038103107dc32a2e726daf86840b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Increase\sthe\supper\sbound\son\sSQLITE_MAX_ATTACHED\sfrom\s30\sto\s62.
-D 2011-03-23T18:22:34.232
+C Change\sthe\sxSetSyscall\smethods\sof\sthe\sVFS\sso\sthat\sthey\sdo\snot\scast\sobject\npointers\sinto\sfunction\spointers.\s\sFix\sother\sunrelated\scompiler\swarnings.
+D 2011-03-23T22:02:23.988
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 27701a1653595a1f2187dc61c8117e00a6c1d50f
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -146,7 +146,7 @@ F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
 F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
 F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
 F src/loadext.c 8af9fcc75708d60b88636ccba38b4a7b3c155c3e
-F src/main.c 3679460ba5ee8f842e32def2117d5bd2260cdbf0
+F src/main.c c4ecb1973419a1e2467cfea31054458da293a307
 F src/malloc.c 92d59a007d7a42857d4e9454aa25b6b703286be1
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
 F src/mem1.c 00bd8265c81abb665c48fea1e0c234eb3b922206
@@ -165,7 +165,7 @@ F src/os.c 22ac61d06e72a0dac900400147333b07b13d8e1d
 F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9
 F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
 F src/os_os2.c 2596fd2d5d0976c6c0c628d0c3c7c4e7a724f4cf
-F src/os_unix.c 919972244dd7267815f9fc176b662390ff0b2348
+F src/os_unix.c 942a9dca5d17c599300127c88a48413e6d55666f
 F src/os_win.c 24d72407a90551969744cf9bcbb1b4c72c5fa845
 F src/pager.c 6aa906b60a59664ba58d3f746164bb010d407ce1
 F src/pager.h 3f8c783de1d4706b40b1ac15b64f5f896bcc78d1
@@ -181,7 +181,7 @@ F src/resolve.c 1c0f32b64f8e3f555fe1f732f9d6f501a7f05706
 F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
 F src/select.c d24406c45dd2442eb2eeaac413439066b149c944
 F src/shell.c 9dc0b4bb59290c0a35256d278cab0f314987ad6a
-F src/sqlite.h.in 9d85096265a53db6c9d452eb478d5ced15308275
+F src/sqlite.h.in 2ab8766c32afed165c0ea74292e18483e3aa64b1
 F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754
 F src/sqliteInt.h f8f1d00a22c98fd3f2fbc94da74eeb880879f89f
 F src/sqliteLimit.h a17dcd3fb775d63b64a43a55c54cb282f9726f44
@@ -918,14 +918,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 30d42dc66f19ef5cc5b27d6273eadf56619a3ce8
-R 53e5c0654506b9d27fce0da478ef2182
+P 7aaf8772274422f5020fad9eea490e195170720f
+R 5f5be2467ac2e1a296459a4f106ade8d
 U drh
-Z af69b516e428dca392e47d50225e2cb4
+Z fe6ea374366d1c79bf722f1efd9278ca
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFNijptoxKgR168RlERAqbvAJ9dZZGQfzqQkUsnDColXnPTvyc73wCdHwqj
-BdLhxD0af4MbaUFMS6jVKTQ=
-=BE7n
+iD8DBQFNim3zoxKgR168RlERAinxAJ4/cXafMYIecY7RnHEnjd/FDN5wWgCeO1Gr
+HyMtzimZVos8zD8aJn2Sy94=
+=JB2d
 -----END PGP SIGNATURE-----
index a416a0e5e305130489b9bdab81a26f8c21018b8f..49ea63e4ef2edf0609ed6e17a06d954c63d99f30 100644 (file)
@@ -1 +1 @@
-7aaf8772274422f5020fad9eea490e195170720f
\ No newline at end of file
+e059152adce3a8fb693f082b82b5669a238c8d6f
\ No newline at end of file
index ac82256a98efa5ffd9ca1e3fb4012e574887fb58..94fdf384b1275cf85682672bad6e8e0fd07b7254 100644 (file)
@@ -529,7 +529,7 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
         { SQLITE_DBCONFIG_ENABLE_FKEY,    SQLITE_ForeignKeys    },
         { SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger  },
       };
-      int i;
+      unsigned int i;
       rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
       for(i=0; i<ArraySize(aFlagOp); i++){
         if( aFlagOp[i].op==op ){
index f771efdad557755c183aecd20ee47238812b432c..f4e689fa9f58f8d959b5d6df33c4dd8daea9bc31 100644 (file)
@@ -288,23 +288,23 @@ struct unixFile {
 ** to all overrideable system calls.
 */
 static struct unix_syscall {
-  const char *zName;      /* Name of the sytem call */
-  void *pCurrent;         /* Current value of the system call */
-  void *pDefault;         /* Default value */
+  const char *zName;            /* Name of the sytem call */
+  sqlite3_syscall_ptr pCurrent; /* Current value of the system call */
+  sqlite3_syscall_ptr pDefault; /* Default value */
 } aSyscall[] = {
-  { "open",         (void*)open,       0  },
+  { "open",         (sqlite3_syscall_ptr)open,       0  },
 #define osOpen      ((int(*)(const char*,int,int))aSyscall[0].pCurrent)
 
-  { "close",        (void*)close,      0  },
+  { "close",        (sqlite3_syscall_ptr)close,      0  },
 #define osClose     ((int(*)(int))aSyscall[1].pCurrent)
 
-  { "access",       (void*)access,     0  },
+  { "access",       (sqlite3_syscall_ptr)access,     0  },
 #define osAccess    ((int(*)(const char*,int))aSyscall[2].pCurrent)
 
-  { "getcwd",       (void*)getcwd,     0  },
+  { "getcwd",       (sqlite3_syscall_ptr)getcwd,     0  },
 #define osGetcwd    ((char*(*)(char*,size_t))aSyscall[3].pCurrent)
 
-  { "stat",         (void*)stat,       0  },
+  { "stat",         (sqlite3_syscall_ptr)stat,       0  },
 #define osStat      ((int(*)(const char*,struct stat*))aSyscall[4].pCurrent)
 
 /*
@@ -317,59 +317,59 @@ static struct unix_syscall {
   { "fstat",        0,                 0  },
 #define osFstat(a,b,c)    0
 #else     
-  { "fstat",        (void*)fstat,      0  },
+  { "fstat",        (sqlite3_syscall_ptr)fstat,      0  },
 #define osFstat     ((int(*)(int,struct stat*))aSyscall[5].pCurrent)
 #endif
 
-  { "ftruncate",    (void*)ftruncate,  0  },
+  { "ftruncate",    (sqlite3_syscall_ptr)ftruncate,  0  },
 #define osFtruncate ((int(*)(int,off_t))aSyscall[6].pCurrent)
 
-  { "fcntl",        (void*)fcntl,      0  },
+  { "fcntl",        (sqlite3_syscall_ptr)fcntl,      0  },
 #define osFcntl     ((int(*)(int,int,...))aSyscall[7].pCurrent)
 
-  { "read",         (void*)read,       0  },
+  { "read",         (sqlite3_syscall_ptr)read,       0  },
 #define osRead      ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)
 
 #if defined(USE_PREAD) || defined(SQLITE_ENABLE_LOCKING_STYLE)
-  { "pread",        (void*)pread,      0  },
+  { "pread",        (sqlite3_syscall_ptr)pread,      0  },
 #else
-  { "pread",        (void*)0,          0  },
+  { "pread",        (sqlite3_syscall_ptr)0,          0  },
 #endif
 #define osPread     ((ssize_t(*)(int,void*,size_t,off_t))aSyscall[9].pCurrent)
 
 #if defined(USE_PREAD64)
-  { "pread64",      (void*)pread64,    0  },
+  { "pread64",      (sqlite3_syscall_ptr)pread64,    0  },
 #else
-  { "pread64",      (void*)0,          0  },
+  { "pread64",      (sqlite3_syscall_ptr)0,          0  },
 #endif
 #define osPread64   ((ssize_t(*)(int,void*,size_t,off_t))aSyscall[10].pCurrent)
 
-  { "write",        (void*)write,      0  },
+  { "write",        (sqlite3_syscall_ptr)write,      0  },
 #define osWrite     ((ssize_t(*)(int,const void*,size_t))aSyscall[11].pCurrent)
 
 #if defined(USE_PREAD) || defined(SQLITE_ENABLE_LOCKING_STYLE)
-  { "pwrite",       (void*)pwrite,     0  },
+  { "pwrite",       (sqlite3_syscall_ptr)pwrite,     0  },
 #else
-  { "pwrite",       (void*)0,          0  },
+  { "pwrite",       (sqlite3_syscall_ptr)0,          0  },
 #endif
 #define osPwrite    ((ssize_t(*)(int,const void*,size_t,off_t))\
                     aSyscall[12].pCurrent)
 
 #if defined(USE_PREAD64)
-  { "pwrite64",     (void*)pwrite64,   0  },
+  { "pwrite64",     (sqlite3_syscall_ptr)pwrite64,   0  },
 #else
-  { "pwrite64",     (void*)0,          0  },
+  { "pwrite64",     (sqlite3_syscall_ptr)0,          0  },
 #endif
 #define osPwrite64  ((ssize_t(*)(int,const void*,size_t,off_t))\
                     aSyscall[13].pCurrent)
 
-  { "fchmod",       (void*)fchmod,     0  },
+  { "fchmod",       (sqlite3_syscall_ptr)fchmod,     0  },
 #define osFchmod    ((int(*)(int,mode_t))aSyscall[14].pCurrent)
 
 #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
-  { "fallocate",    (void*)posix_fallocate,  0 },
+  { "fallocate",    (sqlite3_syscall_ptr)posix_fallocate,  0 },
 #else
-  { "fallocate",    (void*)0,                0 },
+  { "fallocate",    (sqlite3_syscall_ptr)0,                0 },
 #endif
 #define osFallocate ((int(*)(int,off_t,off_t)aSyscall[15].pCurrent)
 
@@ -382,12 +382,14 @@ static struct unix_syscall {
 ** system call named zName.
 */
 static int unixSetSystemCall(
-  sqlite3_vfs *pNotUsed,     /* The VFS pointer.  Not used */
-  const char *zName,         /* Name of system call to override */
-  void *pNewFunc             /* Pointer to new system call value */
+  sqlite3_vfs *pNotUsed,        /* The VFS pointer.  Not used */
+  const char *zName,            /* Name of system call to override */
+  sqlite3_syscall_ptr pNewFunc  /* Pointer to new system call value */
 ){
-  int i;
+  unsigned int i;
   int rc = SQLITE_NOTFOUND;
+
+  UNUSED_PARAMETER(pNotUsed);
   if( zName==0 ){
     /* If no zName is given, restore all system calls to their default
     ** settings and return NULL
@@ -422,8 +424,13 @@ static int unixSetSystemCall(
 ** recognized system call name.  NULL is also returned if the system call
 ** is currently undefined.
 */
-static void *unixGetSystemCall(sqlite3_vfs *pNotUsed, const char *zName){
-  int i;
+static sqlite3_syscall_ptr unixGetSystemCall(
+  sqlite3_vfs *pNotUsed,
+  const char *zName
+){
+  unsigned int i;
+
+  UNUSED_PARAMETER(pNotUsed);
   for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
     if( strcmp(zName, aSyscall[i].zName)==0 ) return aSyscall[i].pCurrent;
   }
@@ -437,7 +444,9 @@ static void *unixGetSystemCall(sqlite3_vfs *pNotUsed, const char *zName){
 ** system call.
 */
 static const char *unixNextSystemCall(sqlite3_vfs *p, const char *zName){
-  int i;
+  unsigned int i;
+
+  UNUSED_PARAMETER(p);
   if( zName==0 ){
     i = -1;
   }else{
index 60bbe4e5c6c08593c624c45ce5d21b9f435a9213..d3be1b32a71f18d18c1b82f7edde311535c67022 100644 (file)
@@ -907,6 +907,7 @@ typedef struct sqlite3_mutex sqlite3_mutex;
 ** any of these methods if the iVersion of the VFS is less than 3.
 */
 typedef struct sqlite3_vfs sqlite3_vfs;
+typedef void (*sqlite3_syscall_ptr)(void);
 struct sqlite3_vfs {
   int iVersion;            /* Structure version number (currently 3) */
   int szOsFile;            /* Size of subclassed sqlite3_file */
@@ -936,8 +937,8 @@ struct sqlite3_vfs {
   ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
   ** Those below are for version 3 and greater.
   */
-  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, void *pFunc);
-  void *(*xGetSystemCall)(sqlite3_vfs*, const char *zName);
+  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
+  sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
   const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
   /*
   ** The methods above are in versions 1 through 3 of the sqlite_vfs object.