diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 4 | ||||
-rw-r--r-- | src/date.c | 4 | ||||
-rw-r--r-- | src/os_win.c | 16 | ||||
-rw-r--r-- | src/shell.c | 9 | ||||
-rw-r--r-- | src/utf.c | 15 |
5 files changed, 36 insertions, 12 deletions
diff --git a/src/build.c b/src/build.c index 477b8e448..c6f82e77a 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.507 2008/12/10 21:19:57 drh Exp $ +** $Id: build.c,v 1.508 2008/12/10 22:30:25 shane Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -3056,7 +3056,7 @@ SrcList *sqlite3SrcListEnlarge( for(i=pSrc->nSrc-1; i>=iStart; i--){ pSrc->a[i+nExtra] = pSrc->a[i]; } - pSrc->nSrc += (u16)nExtra; + pSrc->nSrc += (i16)nExtra; /* Zero the newly allocated slots */ memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra); diff --git a/src/date.c b/src/date.c index cb38747ee..73cbe5e6c 100644 --- a/src/date.c +++ b/src/date.c @@ -16,7 +16,7 @@ ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.97 2008/12/10 21:19:57 drh Exp $ +** $Id: date.c,v 1.98 2008/12/10 22:30:25 shane Exp $ ** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon @@ -550,7 +550,7 @@ static int parseModifier(const char *zMod, DateTime *p){ ** seconds since 1970. Convert to a real julian day number. */ if( strcmp(z, "unixepoch")==0 && p->validJD ){ - p->iJD = p->iJD*10/864000 + 210866760000000LL; + p->iJD = p->iJD/86400 + 210866760000000LL; clearYMD_HMS_TZ(p); rc = 0; } diff --git a/src/os_win.c b/src/os_win.c index 90791c792..c26f70295 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -12,7 +12,7 @@ ** ** This file contains code that is specific to windows. ** -** $Id: os_win.c,v 1.143 2008/12/10 21:19:57 drh Exp $ +** $Id: os_win.c,v 1.144 2008/12/10 22:30:25 shane Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_WIN /* This file is used for windows only */ @@ -743,7 +743,11 @@ int sqlite3_fullsync_count = 0; ** Make sure all writes to a particular file are committed to disk. */ static int winSync(sqlite3_file *id, int flags){ +#ifndef SQLITE_NO_SYNC winFile *pFile = (winFile*)id; +#else + UNUSED_PARAMETER(id); +#endif OSTRACE3("SYNC %d lock=%d\n", pFile->h, pFile->locktype); #ifdef SQLITE_TEST if( flags & SQLITE_SYNC_FULL ){ @@ -1050,6 +1054,7 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){ ** same for both. */ static int winSectorSize(sqlite3_file *id){ + UNUSED_PARAMETER(id); return SQLITE_DEFAULT_SECTOR_SIZE; } @@ -1057,6 +1062,7 @@ static int winSectorSize(sqlite3_file *id){ ** Return a vector of device characteristics. */ static int winDeviceCharacteristics(sqlite3_file *id){ + UNUSED_PARAMETER(id); return 0; } @@ -1217,6 +1223,8 @@ static int winOpen( const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */ char zTmpname[MAX_PATH+1]; /* Buffer used to create temp filename */ + UNUSED_PARAMETER(pVfs); + /* If the second argument to this function is NULL, generate a ** temporary file name to use */ @@ -1352,6 +1360,8 @@ static int winDelete( DWORD rc; DWORD error = 0; void *zConverted = convertUtf8Filename(zFilename); + UNUSED_PARAMETER(pVfs); + UNUSED_PARAMETER(syncDir); if( zConverted==0 ){ return SQLITE_NOMEM; } @@ -1395,6 +1405,7 @@ static int winAccess( DWORD attr; int rc = 0; void *zConverted = convertUtf8Filename(zFilename); + UNUSED_PARAMETER(pVfs); if( zConverted==0 ){ return SQLITE_NOMEM; } @@ -1439,11 +1450,13 @@ static int winFullPathname( ){ #if defined(__CYGWIN__) + UNUSED_PARAMETER(nFull); cygwin_conv_to_full_win32_path(zRelative, zFull); return SQLITE_OK; #endif #if SQLITE_OS_WINCE + UNUSED_PARAMETER(nFull); /* WinCE has no concept of a relative pathname, or so I am told. */ sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zRelative); return SQLITE_OK; @@ -1453,6 +1466,7 @@ static int winFullPathname( int nByte; void *zConverted; char *zOut; + UNUSED_PARAMETER(nFull); zConverted = convertUtf8Filename(zRelative); if( isNT() ){ WCHAR *zTemp; diff --git a/src/shell.c b/src/shell.c index 04fafcd79..bb0e5a524 100644 --- a/src/shell.c +++ b/src/shell.c @@ -12,8 +12,13 @@ ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.193 2008/12/10 22:15:00 drh Exp $ +** $Id: shell.c,v 1.194 2008/12/10 22:30:25 shane Exp $ */ +#if defined(_WIN32) || defined(WIN32) +/* This needs to come before any includes for MSVC compiler */ +#define _CRT_SECURE_NO_WARNINGS +#endif + #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -48,6 +53,8 @@ #if defined(_WIN32) || defined(WIN32) # include <io.h> +#define isatty(h) _isatty(h) +#define access(f,m) _access((f),(m)) #else /* Make sure isatty() has a prototype. */ @@ -12,7 +12,7 @@ ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** -** $Id: utf.c,v 1.69 2008/12/10 19:26:24 drh Exp $ +** $Id: utf.c,v 1.70 2008/12/10 22:30:25 shane Exp $ ** ** Notes on UTF-8: ** @@ -51,7 +51,7 @@ const int sqlite3one = 1; ** This lookup table is used to help decode the first byte of ** a multi-byte UTF8 character. */ -static const unsigned char sqlite3UtfTrans1[] = { +static const unsigned char sqlite3Utf8Trans1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, @@ -159,7 +159,7 @@ static const unsigned char sqlite3UtfTrans1[] = { #define READ_UTF8(zIn, zTerm, c) \ c = *(zIn++); \ if( c>=0xc0 ){ \ - c = sqlite3UtfTrans1[c-0xc0]; \ + c = sqlite3Utf8Trans1[c-0xc0]; \ while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \ c = (c<<6) + (0x3f & *(zIn++)); \ } \ @@ -495,7 +495,8 @@ void sqlite3UtfSelfTest(void){ for(i=0; i<0x00110000; i++){ z = zBuf; WRITE_UTF8(z, i); - n = z-zBuf; + n = (int)(z-zBuf); + assert( n>0 && n<=4 ); z[0] = 0; zTerm = z; z = zBuf; @@ -510,7 +511,8 @@ void sqlite3UtfSelfTest(void){ if( i>=0xD800 && i<0xE000 ) continue; z = zBuf; WRITE_UTF16LE(z, i); - n = z-zBuf; + n = (int)(z-zBuf); + assert( n>0 && n<=4 ); z[0] = 0; z = zBuf; READ_UTF16LE(z, c); @@ -521,7 +523,8 @@ void sqlite3UtfSelfTest(void){ if( i>=0xD800 && i<0xE000 ) continue; z = zBuf; WRITE_UTF16BE(z, i); - n = z-zBuf; + n = (int)(z-zBuf); + assert( n>0 && n<=4 ); z[0] = 0; z = zBuf; READ_UTF16BE(z, c); |