Removed some more dead code and fixed some unresolved externals for WINCE. Ticket #3420. (CVS 5837)

FossilOrigin-Name: 5276e31d42070e7b94bd6050c4fa484dfbfe98ca
This commit is contained in:
shane 2008-10-22 16:55:47 +00:00
parent 049fc21db9
commit 891adeac5c
3 changed files with 57 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Make\ssure\svariable\sdeclarations\soccur\sfirst\sin\scode\sblocks.\s(CVS\s5836)
D 2008-10-22T16:26:48
C Removed\ssome\smore\sdead\scode\sand\sfixed\ssome\sunresolved\sexternals\sfor\sWINCE.\s\sTicket\s#3420.\s(CVS\s5837)
D 2008-10-22T16:55:47
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 4352ab12369706c793f3e8165db35b102c929998
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -138,7 +138,7 @@ F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
F src/os_os2.c 24221ff5ab20cf3472e3ec7eec595f759de55298
F src/os_unix.c 5e3b3c9a54546249c1317cff5343e965192f7f2b
F src/os_win.c 13bed718f62d64031b17bb3685adcf994dbf0232
F src/os_win.c a26292f39a73a446aa56b01871e73545da8ce3e4
F src/pager.c 8377118bd5ae055b66683926b264f6c04442317e
F src/pager.h 4a57b219c0765fe1870238064e3f46e4eb2cf5af
F src/parse.y f4620f42b5e0141e20243b5f963d0fc9c180ab9b
@ -650,7 +650,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P a8bb5acf708c8f7e52d3f67b85094116386f10fa
R 710931e3f1f060e772777d1613d702dc
P b78f44c91fcf3920e69c11a6f72e8f032905a3c7
R d00295cf1e272f696a9fb6229b295e8f
U shane
Z 69aead5e2a809ed3469cd42f7cb51300
Z b93484f56f8f995214898bd38d76728c

View File

@ -1 +1 @@
b78f44c91fcf3920e69c11a6f72e8f032905a3c7
5276e31d42070e7b94bd6050c4fa484dfbfe98ca

View File

@ -12,7 +12,7 @@
**
** This file contains code that is specific to windows.
**
** $Id: os_win.c,v 1.135 2008/10/12 02:27:39 shane Exp $
** $Id: os_win.c,v 1.136 2008/10/22 16:55:47 shane Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_WIN /* This file is used for windows only */
@ -73,7 +73,7 @@
** Determine if we are dealing with WindowsCE - which has a much
** reduced API.
*/
#if defined(SQLITE_OS_WINCE)
#if SQLITE_OS_WINCE
# define AreFileApisANSI() 1
#endif
@ -790,11 +790,15 @@ static int getReadLock(winFile *pFile){
ovlp.hEvent = 0;
res = LockFileEx(pFile->h, LOCKFILE_FAIL_IMMEDIATELY,
0, SHARED_SIZE, 0, &ovlp);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
*/
#if SQLITE_OS_WINCE==0
}else{
int lk;
sqlite3_randomness(sizeof(lk), &lk);
pFile->sharedLockByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1);
res = LockFile(pFile->h, SHARED_FIRST+pFile->sharedLockByte, 0, 1, 0);
#endif
}
return res;
}
@ -806,8 +810,12 @@ static int unlockReadLock(winFile *pFile){
int res;
if( isNT() ){
res = UnlockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
*/
#if SQLITE_OS_WINCE==0
}else{
res = UnlockFile(pFile->h, SHARED_FIRST + pFile->sharedLockByte, 0, 1, 0);
#endif
}
return res;
}
@ -1080,8 +1088,12 @@ static void *convertUtf8Filename(const char *zFilename){
void *zConverted = 0;
if( isNT() ){
zConverted = utf8ToUnicode(zFilename);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
*/
#if SQLITE_OS_WINCE==0
}else{
zConverted = utf8ToMbcs(zFilename);
#endif
}
/* caller will handle out of memory */
return zConverted;
@ -1111,6 +1123,11 @@ static int getTempname(int nBuf, char *zBuf){
}else{
return SQLITE_NOMEM;
}
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}else{
char *zUtf8;
char zMbcsPath[MAX_PATH];
@ -1122,6 +1139,7 @@ static int getTempname(int nBuf, char *zBuf){
}else{
return SQLITE_NOMEM;
}
#endif
}
for(i=strlen(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){}
zTempPath[i] = 0;
@ -1249,6 +1267,11 @@ static int winOpen(
dwFlagsAndAttributes,
NULL
);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}else{
h = CreateFileA((char*)zConverted,
dwDesiredAccess,
@ -1258,6 +1281,7 @@ static int winOpen(
dwFlagsAndAttributes,
NULL
);
#endif
}
if( h==INVALID_HANDLE_VALUE ){
free(zConverted);
@ -1331,6 +1355,11 @@ static int winDelete(
|| ((error = GetLastError()) == ERROR_ACCESS_DENIED))
&& (++cnt < MX_DELETION_ATTEMPTS)
&& (Sleep(100), 1) );
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}else{
do{
DeleteFileA(zConverted);
@ -1338,6 +1367,7 @@ static int winDelete(
|| ((error = GetLastError()) == ERROR_ACCESS_DENIED))
&& (++cnt < MX_DELETION_ATTEMPTS)
&& (Sleep(100), 1) );
#endif
}
free(zConverted);
OSTRACE2("DELETE \"%s\"\n", zFilename);
@ -1362,8 +1392,14 @@ static int winAccess(
}
if( isNT() ){
attr = GetFileAttributesW((WCHAR*)zConverted);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}else{
attr = GetFileAttributesA((char*)zConverted);
#endif
}
free(zConverted);
switch( flags ){
@ -1422,6 +1458,11 @@ static int winFullPathname(
free(zConverted);
zOut = unicodeToUtf8(zTemp);
free(zTemp);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}else{
char *zTemp;
nByte = GetFullPathNameA((char*)zConverted, 0, 0, 0) + 3;
@ -1434,6 +1475,7 @@ static int winFullPathname(
free(zConverted);
zOut = mbcsToUtf8(zTemp);
free(zTemp);
#endif
}
if( zOut ){
sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zOut);
@ -1462,8 +1504,14 @@ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
}
if( isNT() ){
h = LoadLibraryW((WCHAR*)zConverted);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}else{
h = LoadLibraryA((char*)zConverted);
#endif
}
free(zConverted);
return (void*)h;