mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Fixed some compiler warnings in WINCE only sections when using the MSVC compiler.
FossilOrigin-Name: 1f0a93e17d6291268da909699ce1a5a7619ae637
This commit is contained in:
31
src/os_win.c
31
src/os_win.c
@@ -309,8 +309,8 @@ struct tm *__cdecl localtime(const time_t *t)
|
||||
sqlite3_int64 t64;
|
||||
t64 = *t;
|
||||
t64 = (t64 + 11644473600)*10000000;
|
||||
uTm.dwLowDateTime = t64 & 0xFFFFFFFF;
|
||||
uTm.dwHighDateTime= t64 >> 32;
|
||||
uTm.dwLowDateTime = (DWORD)(t64 & 0xFFFFFFFF);
|
||||
uTm.dwHighDateTime= (DWORD)(t64 >> 32);
|
||||
FileTimeToLocalFileTime(&uTm,&lTm);
|
||||
FileTimeToSystemTime(&lTm,&pTm);
|
||||
y.tm_year = pTm.wYear - 1900;
|
||||
@@ -330,7 +330,7 @@ struct tm *__cdecl localtime(const time_t *t)
|
||||
#define UnlockFile(a,b,c,d,e) winceUnlockFile(&a, b, c, d, e)
|
||||
#define LockFileEx(a,b,c,d,e,f) winceLockFileEx(&a, b, c, d, e, f)
|
||||
|
||||
#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-offsetof(winFile,h)]
|
||||
#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)]
|
||||
|
||||
/*
|
||||
** Acquire a lock on the handle h
|
||||
@@ -469,6 +469,9 @@ static BOOL winceLockFile(
|
||||
winFile *pFile = HANDLE_TO_WINFILE(phFile);
|
||||
BOOL bReturn = FALSE;
|
||||
|
||||
UNUSED_PARAMETER(dwFileOffsetHigh);
|
||||
UNUSED_PARAMETER(nNumberOfBytesToLockHigh);
|
||||
|
||||
if (!pFile->hMutex) return TRUE;
|
||||
winceMutexAcquire(pFile->hMutex);
|
||||
|
||||
@@ -530,14 +533,17 @@ static BOOL winceUnlockFile(
|
||||
winFile *pFile = HANDLE_TO_WINFILE(phFile);
|
||||
BOOL bReturn = FALSE;
|
||||
|
||||
UNUSED_PARAMETER(dwFileOffsetHigh);
|
||||
UNUSED_PARAMETER(nNumberOfBytesToUnlockHigh);
|
||||
|
||||
if (!pFile->hMutex) return TRUE;
|
||||
winceMutexAcquire(pFile->hMutex);
|
||||
|
||||
/* Releasing a reader lock or an exclusive lock */
|
||||
if (dwFileOffsetLow >= SHARED_FIRST &&
|
||||
dwFileOffsetLow < SHARED_FIRST + SHARED_SIZE){
|
||||
if (dwFileOffsetLow == SHARED_FIRST){
|
||||
/* Did we have an exclusive lock? */
|
||||
if (pFile->local.bExclusive){
|
||||
assert(nNumberOfBytesToUnlockLow == SHARED_SIZE);
|
||||
pFile->local.bExclusive = FALSE;
|
||||
pFile->shared->bExclusive = FALSE;
|
||||
bReturn = TRUE;
|
||||
@@ -545,6 +551,7 @@ static BOOL winceUnlockFile(
|
||||
|
||||
/* Did we just have a reader lock? */
|
||||
else if (pFile->local.nReaders){
|
||||
assert(nNumberOfBytesToUnlockLow == 1);
|
||||
pFile->local.nReaders --;
|
||||
if (pFile->local.nReaders == 0)
|
||||
{
|
||||
@@ -586,6 +593,9 @@ static BOOL winceLockFileEx(
|
||||
DWORD nNumberOfBytesToLockHigh,
|
||||
LPOVERLAPPED lpOverlapped
|
||||
){
|
||||
UNUSED_PARAMETER(dwReserved);
|
||||
UNUSED_PARAMETER(nNumberOfBytesToLockHigh);
|
||||
|
||||
/* If the caller wants a shared read lock, forward this call
|
||||
** to winceLockFile */
|
||||
if (lpOverlapped->Offset == SHARED_FIRST &&
|
||||
@@ -1592,9 +1602,15 @@ static int getSectorSize(
|
||||
const char *zRelative /* UTF-8 file name */
|
||||
){
|
||||
DWORD bytesPerSector = SQLITE_DEFAULT_SECTOR_SIZE;
|
||||
/* GetDiskFreeSpace is not supported under WINCE */
|
||||
#if SQLITE_OS_WINCE
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
UNUSED_PARAMETER(zRelative);
|
||||
#else
|
||||
char zFullpath[MAX_PATH+1];
|
||||
int rc;
|
||||
DWORD dwRet = 0, dwDummy;
|
||||
DWORD dwRet = 0;
|
||||
DWORD dwDummy;
|
||||
|
||||
/*
|
||||
** We need to get the full path name of the file
|
||||
@@ -1620,7 +1636,6 @@ static int getSectorSize(
|
||||
&bytesPerSector,
|
||||
&dwDummy,
|
||||
&dwDummy);
|
||||
#if SQLITE_OS_WINCE==0
|
||||
}else{
|
||||
/* trim path to just drive reference */
|
||||
CHAR *p = (CHAR *)zConverted;
|
||||
@@ -1635,7 +1650,6 @@ static int getSectorSize(
|
||||
&bytesPerSector,
|
||||
&dwDummy,
|
||||
&dwDummy);
|
||||
#endif
|
||||
}
|
||||
free(zConverted);
|
||||
}
|
||||
@@ -1643,6 +1657,7 @@ static int getSectorSize(
|
||||
bytesPerSector = SQLITE_DEFAULT_SECTOR_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return (int) bytesPerSector;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user