diff options
author | drh <drh@noemail.net> | 2015-04-30 12:31:49 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-04-30 12:31:49 +0000 |
commit | 6a412b8be937d526fc927f4a451f1c33d8c4375d (patch) | |
tree | 8623d693f4135cd0d3fb877613990f7021bde4ff /src | |
parent | f3cdcdccbeedd4de04d74eb95ecc244eb90e4082 (diff) | |
download | sqlite-6a412b8be937d526fc927f4a451f1c33d8c4375d.tar.gz sqlite-6a412b8be937d526fc927f4a451f1c33d8c4375d.zip |
Fix signed/unsigned comparison compiler warnings. Add the
SQLITE_OMIT_RANDOMNESS compile-time option to cause the PRNG to be seeded
identically on every run, for testing purposes.
FossilOrigin-Name: 93ce2bca701efc67aeb517c4d641bde71332e8a0
Diffstat (limited to 'src')
-rw-r--r-- | src/loadext.c | 6 | ||||
-rw-r--r-- | src/os_unix.c | 2 | ||||
-rw-r--r-- | src/os_win.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/loadext.c b/src/loadext.c index 19850786d..5a2b9d297 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -653,7 +653,7 @@ int sqlite3_auto_extension(void (*xInit)(void)){ }else #endif { - int i; + u32 i; #if SQLITE_THREADSAFE sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); #endif @@ -697,7 +697,7 @@ int sqlite3_cancel_auto_extension(void (*xInit)(void)){ int n = 0; wsdAutoextInit; sqlite3_mutex_enter(mutex); - for(i=wsdAutoext.nExt-1; i>=0; i--){ + for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ if( wsdAutoext.aExt[i]==xInit ){ wsdAutoext.nExt--; wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt]; @@ -735,7 +735,7 @@ void sqlite3_reset_auto_extension(void){ ** If anything goes wrong, set an error in the database connection. */ void sqlite3AutoLoadExtensions(sqlite3 *db){ - int i; + u32 i; int go = 1; int rc; int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*); diff --git a/src/os_unix.c b/src/os_unix.c index 74710a8b7..9ec100323 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -6135,7 +6135,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){ */ memset(zBuf, 0, nBuf); randomnessPid = osGetpid(0); -#if !defined(SQLITE_TEST) +#if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS) { int fd, got; fd = robust_open("/dev/urandom", O_RDONLY, 0); diff --git a/src/os_win.c b/src/os_win.c index ece7103c9..0ebea5afc 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5372,7 +5372,7 @@ static void winDlClose(sqlite3_vfs *pVfs, void *pHandle){ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ int n = 0; UNUSED_PARAMETER(pVfs); -#if defined(SQLITE_TEST) +#if defined(SQLITE_TEST) || defined(SQLITE_OMIT_RANDOMNESS) n = nBuf; memset(zBuf, 0, nBuf); #else @@ -5406,7 +5406,6 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ memcpy(&zBuf[n], &i, sizeof(i)); n += sizeof(i); } -#endif #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID if( sizeof(UUID)<=nBuf-n ){ UUID id; @@ -5423,6 +5422,7 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ n += sizeof(UUID); } #endif +#endif /* defined(SQLITE_TEST) || defined(SQLITE_ZERO_PRNG_SEED) */ return n; } |