From c8bde37d199230099ea1521313c08b156378417b Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 18 Jun 2012 08:00:56 +0000 Subject: [PATCH 1/2] Fix a few compilation issues that can occur with certain compilers (e.g. GCC 2.95.3, MSVC). FossilOrigin-Name: f970a3de61fe2ebaf1778c4a3383cfdc52299162 --- ext/fts3/fts3_unicode2.c | 2 +- manifest | 21 ++++++++++++--------- manifest.uuid | 2 +- src/mutex_w32.c | 3 +-- src/shell.c | 10 ++++++---- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ext/fts3/fts3_unicode2.c b/ext/fts3/fts3_unicode2.c index 226d5ee419..3c24569026 100644 --- a/ext/fts3/fts3_unicode2.c +++ b/ext/fts3/fts3_unicode2.c @@ -146,7 +146,7 @@ int sqlite3FtsUnicodeIsalnum(int c){ } assert( aEntry[0]=aEntry[iRes] ); - return (c >= ((aEntry[iRes]>>10) + (aEntry[iRes]&0x3FF))); + return (((unsigned int)c) >= ((aEntry[iRes]>>10) + (aEntry[iRes]&0x3FF))); } return 1; } diff --git a/manifest b/manifest index 1043803b95..d36e959c74 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sLemon,\swhen\scomparing\sthe\soutput\sto\sthe\s*.h\sfile\sto\ssee\sif\sit\shas\schanged,\nmake\ssure\sthat\sthe\sproposed\snew\soutput\sand\sthe\spreexisting\soutput\sare\sthe\nsame\ssize\sbefore\sdeciding\sthat\sthey\sare\sthe\ssame. -D 2012-06-16T15:26:31.082 +C Fix\sa\sfew\scompilation\sissues\sthat\scan\soccur\swith\scertain\scompilers\s(e.g.\sGCC\s2.95.3,\sMSVC). +D 2012-06-18T08:00:56.560 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in d17fddaa4e81f93a7c9c7c0808aacb3fc95f79f4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -71,7 +71,7 @@ F ext/fts3/fts3_tokenizer.c e94a8b901066031437ccfe4769fc76370257cede F ext/fts3/fts3_tokenizer.h 66dec98e365854b6cd2d54f1a96bb6d428fc5a68 F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004 F ext/fts3/fts3_unicode.c 49e36e6ba59f79e6bd6a8bfe434570fe48d20559 -F ext/fts3/fts3_unicode2.c 2965d217c37079f1dbbdbd2c58f843be285d73f2 +F ext/fts3/fts3_unicode2.c a863f05f758af36777dffc2facc898bc73fec896 F ext/fts3/fts3_write.c 794438f904cdf4516b258e530c0065efadb7b9b5 F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9 F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100 @@ -158,7 +158,7 @@ F src/mutex.h 2a79e0c10c26412546b501ee0f3d92b42decf63e F src/mutex_noop.c 7682796b7d8d39bf1c138248858efcd10c9e1553 F src/mutex_os2.c 882d735098c07c8c6a5472b8dd66e19675fe117f F src/mutex_unix.c c3a4e00f96ba068a8dbef34084465979aaf369cc -F src/mutex_w32.c db8970270841e2385a43602477e84c4b19aff1db +F src/mutex_w32.c aedeaae3a850f6237ad142206911e3053a393e02 F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30 F src/os.c e1acdc09ff3ac2412945cca9766e2dcf4675f31c F src/os.h 38aabd5e3ecd4162332076f55bb09cec02165cca @@ -179,7 +179,7 @@ F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50 F src/resolve.c b3c70ab28cac60de33684c9aa9e5138dcf71d6dd F src/rowset.c f6a49f3e9579428024662f6e2931832511f831a1 F src/select.c f6c4833c4d8e94714761d99013d74f381e084f1d -F src/shell.c c16f72e34f611f060546709564c121a67cb2b31b +F src/shell.c 79cbf565f50c7b9ab0a622e0a7d612ad3b97a685 F src/sqlite.h.in 39f041ce71a0d994e2487014fc9e8721595f5bc0 F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477 F src/sqliteInt.h 29b5348f0056d9b46d0bb94d4853db21568afde9 @@ -1005,7 +1005,10 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P f5b5a13f7394dc143aa136f1d4faba6839eaa6dc -R 1f8bdd1a411e91223aef9522ba34a3e6 -U drh -Z 53f96406b6eec20edfa4ee33fc7d7346 +P 0c2fb18d25217ada7e75dcab8b342bbc632875d8 +R 1fec034065f8f455e31652ddfa62f1cf +T *branch * compiler-compat +T *sym-compiler-compat * +T -sym-trunk * +U mistachkin +Z 855dea24159ac5797cf9bffe7655aa6d diff --git a/manifest.uuid b/manifest.uuid index 0425283c18..9a664fabef 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0c2fb18d25217ada7e75dcab8b342bbc632875d8 \ No newline at end of file +f970a3de61fe2ebaf1778c4a3383cfdc52299162 \ No newline at end of file diff --git a/src/mutex_w32.c b/src/mutex_w32.c index accf9ef8a2..56b4a4d925 100644 --- a/src/mutex_w32.c +++ b/src/mutex_w32.c @@ -109,8 +109,6 @@ static int winMutex_isInit = 0; */ static long winMutex_lock = 0; -extern void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ - static int winMutexInit(void){ /* The first to increment to 1 does actual initialization */ if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){ @@ -126,6 +124,7 @@ static int winMutexInit(void){ }else{ /* Someone else is in the process of initing the static mutexes */ while( !winMutex_isInit ){ + extern void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ sqlite3_win32_sleep(1); } } diff --git a/src/shell.c b/src/shell.c index 801ad2ca27..3f28680235 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2697,10 +2697,12 @@ static char *find_home_dir(void){ if( home_dir ) return home_dir; #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) - struct passwd *pwent; - uid_t uid = getuid(); - if( (pwent=getpwuid(uid)) != NULL) { - home_dir = pwent->pw_dir; + { + struct passwd *pwent; + uid_t uid = getuid(); + if( (pwent=getpwuid(uid)) != NULL) { + home_dir = pwent->pw_dir; + } } #endif From 9721c21c41c9443c804a9d3f2489703f9ae10234 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 18 Jun 2012 17:15:29 +0000 Subject: [PATCH 2/2] Allow the SQLITE_API macro to apply to the sqlite3_win32_sleep function. FossilOrigin-Name: 21266c68afb067ff40062df1e8b383dfd247c17b --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/mutex_w32.c | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index d36e959c74..5f05b6d64e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sfew\scompilation\sissues\sthat\scan\soccur\swith\scertain\scompilers\s(e.g.\sGCC\s2.95.3,\sMSVC). -D 2012-06-18T08:00:56.560 +C Allow\sthe\sSQLITE_API\smacro\sto\sapply\sto\sthe\ssqlite3_win32_sleep\sfunction. +D 2012-06-18T17:15:29.347 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in d17fddaa4e81f93a7c9c7c0808aacb3fc95f79f4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -158,7 +158,7 @@ F src/mutex.h 2a79e0c10c26412546b501ee0f3d92b42decf63e F src/mutex_noop.c 7682796b7d8d39bf1c138248858efcd10c9e1553 F src/mutex_os2.c 882d735098c07c8c6a5472b8dd66e19675fe117f F src/mutex_unix.c c3a4e00f96ba068a8dbef34084465979aaf369cc -F src/mutex_w32.c aedeaae3a850f6237ad142206911e3053a393e02 +F src/mutex_w32.c 32a9b3841e2d757355f0012b860b1bc5e01eafa0 F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30 F src/os.c e1acdc09ff3ac2412945cca9766e2dcf4675f31c F src/os.h 38aabd5e3ecd4162332076f55bb09cec02165cca @@ -1005,10 +1005,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 0c2fb18d25217ada7e75dcab8b342bbc632875d8 -R 1fec034065f8f455e31652ddfa62f1cf -T *branch * compiler-compat -T *sym-compiler-compat * -T -sym-trunk * +P f970a3de61fe2ebaf1778c4a3383cfdc52299162 +R f7c2f2158f3710573c689aa0bb5b67ff U mistachkin -Z 855dea24159ac5797cf9bffe7655aa6d +Z 6375ed0474e573645b8013045823eb03 diff --git a/manifest.uuid b/manifest.uuid index 9a664fabef..94bee6bf1f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f970a3de61fe2ebaf1778c4a3383cfdc52299162 \ No newline at end of file +21266c68afb067ff40062df1e8b383dfd247c17b \ No newline at end of file diff --git a/src/mutex_w32.c b/src/mutex_w32.c index 56b4a4d925..27d10af5bd 100644 --- a/src/mutex_w32.c +++ b/src/mutex_w32.c @@ -109,6 +109,8 @@ static int winMutex_isInit = 0; */ static long winMutex_lock = 0; +void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ + static int winMutexInit(void){ /* The first to increment to 1 does actual initialization */ if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){ @@ -124,7 +126,6 @@ static int winMutexInit(void){ }else{ /* Someone else is in the process of initing the static mutexes */ while( !winMutex_isInit ){ - extern void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ sqlite3_win32_sleep(1); } }