Skip to content

Commit

Permalink
All sqlite warnigs fixed!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
jokedst committed Jan 26, 2018
1 parent 50a45b5 commit 117e2fe
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CsvQuery/CsharpSqlite/crypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ static int sqlite3CodecAttach( sqlite3 db, int nDb, string zKey, int nKey )
codec_ctx ctx;
int rc;
////Pager pPager = pDb.pBt.pBt.pPager;
sqlite3_file fd;
//sqlite3_file fd;

ctx = new codec_ctx();//sqlite3Malloc(sizeof(codec_ctx);
//if(ctx == null) return SQLITE_NOMEM;
Expand Down
5 changes: 3 additions & 2 deletions CsvQuery/CsharpSqlite/main_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3125,9 +3125,10 @@ static int sqlite3_file_control( sqlite3 db, string zDbName, int op, ref sqlite3
#if (SQLITE_SILVERLIGHT || WINDOWS_MOBILE || SQLITE_WINRT)
pArg = (long)-1; // not supported
#else
pArg = (long)fd.fs.Handle;
//pArg = (long)fd.fs.Handle;
pArg = (long) fd.fs.SafeFileHandle.DangerousGetHandle();
#endif
rc = SQLITE_OK;
rc = SQLITE_OK;
}
else if ( fd.pMethods != null )
{
Expand Down
2 changes: 1 addition & 1 deletion CsvQuery/CsharpSqlite/os_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int sqlite3OsInit()
** Locate a VFS by name. If no name is given, simply return the
** first VFS on the list.
*/
static bool isInit = false;
//static bool isInit = false;

static public sqlite3_vfs sqlite3_vfs_find(string zVfs)
{
Expand Down
11 changes: 4 additions & 7 deletions CsvQuery/CsharpSqlite/os_win_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void Clear()
#if SQLITE_TEST
int sqlite3_os_type = 0;
#else
static int sqlite3_os_type = 0;
//static int sqlite3_os_type = 0;
#endif

/*
Expand Down Expand Up @@ -940,8 +940,6 @@ static int winRead(
sqlite3_int64 offset /* Begin reading at this offset */
)
{

long rc;
sqlite3_file pFile = id;
int nRead; /* Number of bytes actually read from file */

Expand Down Expand Up @@ -1159,7 +1157,6 @@ static int winSync( sqlite3_file id, int flags )
{
#if !(NDEBUG) || !(SQLITE_NO_SYNC) || (SQLITE_DEBUG)
sqlite3_file pFile = (sqlite3_file)id;
bool rc;
#else
UNUSED_PARAMETER(id);
#endif
Expand Down Expand Up @@ -3172,7 +3169,7 @@ StringBuilder zFull /* Output buffer */
#endif

#if !SQLITE_OS_WINCE && !__CYGWIN__
int nByte;
//int nByte;
//string zConverted;
string zOut = null;

Expand Down Expand Up @@ -3213,7 +3210,7 @@ StringBuilder zFull /* Output buffer */
zOut = Path.GetFullPath( zRelative ); // was unicodeToUtf8(zTemp);
#endif
}
catch ( Exception e )
catch ( Exception )
{
zOut = zRelative;
}
Expand Down Expand Up @@ -3724,7 +3721,7 @@ public virtual int SharedLockFile( sqlite3_file pFile, long offset, long length
ovlp.OffsetHigh = 0;
ovlp.EventHandle = IntPtr.Zero;

return LockFileEx( pFile.fs.Handle, LOCKFILE_FAIL_IMMEDIATELY, 0, (uint)length, 0, ref ovlp ) ? 1 : 0;
return LockFileEx( pFile.fs.SafeFileHandle.DangerousGetHandle(), LOCKFILE_FAIL_IMMEDIATELY, 0, (uint)length, 0, ref ovlp ) ? 1 : 0;
#else
return 1;
#endif
Expand Down
2 changes: 1 addition & 1 deletion CsvQuery/CsharpSqlite/select_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4288,7 +4288,7 @@ static void explainSimpleCount(Parse a, Table b, Index c){}
** This routine does NOT free the Select structure passed in. The
** calling function needs to do that.
*/
static SelectDest sdDummy = null;
//static SelectDest sdDummy = null;
//static bool bDummy = false;

static int sqlite3Select(
Expand Down
4 changes: 2 additions & 2 deletions CsvQuery/CsharpSqlite/sqliteInt_h.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ static bool unlikely( bool X )
const int ;//#define SQLITE_UTF16NATIVE SQLITE_UTF16LE
#else
static u8 SQLITE_BIGENDIAN = 0;//#define SQLITE_BIGENDIAN (*(char )(&sqlite3one)==0)
static u8 SQLITE_LITTLEENDIAN = 1;//#define SQLITE_LITTLEENDIAN (*(char )(&sqlite3one)==1)
//static u8 SQLITE_LITTLEENDIAN = 1;//#define SQLITE_LITTLEENDIAN (*(char )(&sqlite3one)==1)
static u8 SQLITE_UTF16NATIVE = ( SQLITE_BIGENDIAN != 0 ? SQLITE_UTF16BE : SQLITE_UTF16LE );//#define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
#endif

Expand Down Expand Up @@ -687,7 +687,7 @@ static int ArraySize<T>( T[] x )
** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT.
*/
//#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3DbFree)
static dxDel SQLITE_DYNAMIC;
static dxDel SQLITE_DYNAMIC = null;

/*
** When SQLITE_OMIT_WSD is defined, it means that the target platform does
Expand Down
4 changes: 2 additions & 2 deletions CsvQuery/CsharpSqlite/vdbe_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ Vdbe p /* The VDBE */
case OP_ShiftRight:
{ /* same as TK_RSHIFT, in1, in2, ref3 */
i64 iA;
u64 uA;
//u64 uA;
i64 iB;
u8 op;

Expand Down Expand Up @@ -6311,7 +6311,7 @@ Vdbe p /* The VDBE */
Pager pPager; /* Pager associated with pBt */
int eNew; /* New journal mode */
int eOld; /* The old journal mode */
string zFilename; /* Name of database file for pPager */
//string zFilename; /* Name of database file for pPager */

eNew = pOp.p3;
Debug.Assert( eNew == PAGER_JOURNALMODE_DELETE
Expand Down
8 changes: 4 additions & 4 deletions CsvQuery/CsharpSqlite/vdbeaux_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ Parse pParse /* Parsing context */
int n; /* Loop counter */
//u8 zCsr; /* Memory available for allocation */
//u8 zEnd; /* First byte past allocated memory */
int nByte; /* How much extra memory is needed */
//int nByte; /* How much extra memory is needed */

Debug.Assert( p != null );
Debug.Assert( pParse != null );
Expand Down Expand Up @@ -3854,13 +3854,13 @@ int szSpace /* Size of pSpace[] in bytes */
{
byte[] aKey = pKey;
UnpackedRecord p; /* The unpacked record that we will return */
int nByte; /* Memory space needed to hold p, in bytes */
//int nByte; /* Memory space needed to hold p, in bytes */
int d;
u32 idx;
int u; /* Unsigned loop counter */
int szHdr = 0;
Mem pMem;
int nOff; /* Increase pSpace by this much to 8-byte align it */
//int nOff; /* Increase pSpace by this much to 8-byte align it */

/*
** We want to shift the pointer pSpace up such that it is 8-byte aligned.
Expand Down Expand Up @@ -3917,7 +3917,7 @@ static void sqlite3VdbeDeleteUnpackedRecord( UnpackedRecord p )
{
#if SQLITE_DEBUG
////int i;
Mem pMem;
//Mem pMem;
Debug.Assert( p != null );
Debug.Assert( ( p.flags & UNPACKED_NEED_DESTROY ) != 0 );
//for ( i = 0, pMem = p->aMem ; i < p->nField ; i++, pMem++ )
Expand Down
2 changes: 1 addition & 1 deletion CsvQuery/CsharpSqlite/vdbemem_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void expandBlob( Mem P )
*/
static int sqlite3VdbeChangeEncoding( Mem pMem, int desiredEnc )
{
int rc;
// int rc;
Debug.Assert( ( pMem.flags & MEM_RowSet ) == 0 );
Debug.Assert( desiredEnc == SQLITE_UTF8 || desiredEnc == SQLITE_UTF16LE
|| desiredEnc == SQLITE_UTF16BE );
Expand Down
2 changes: 1 addition & 1 deletion CsvQuery/CsharpSqlite/vtab_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ Expr pExpr /* First argument to the function */
FuncDef pNew;
int rc = 0;
string zLowerName;
string z;
//string z;

/* Check to see the left operand is a column in a virtual table */
if ( NEVER( pExpr == null ) )
Expand Down
6 changes: 3 additions & 3 deletions CsvQuery/CsharpSqlite/where_c.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ WhereCost pCost /* Lowest cost query plan */
double logN; /* log(nTableRow) */
double costTempIdx; /* per-query cost of the transient index */
WhereTerm pTerm; /* A single term of the WHERE clause */
WhereTerm pWCEnd; /* End of pWC.a[] */
//WhereTerm pWCEnd; /* End of pWC.a[] */
Table pTable; /* Table that might be indexed */

if ( pParse.nQueryLoop <= (double)1 )
Expand Down Expand Up @@ -2138,8 +2138,8 @@ static void constructAutomaticIndex(
{
int nColumn; /* Number of columns in the constructed index */
WhereTerm pTerm; /* A single term of the WHERE clause */
WhereTerm pWCEnd; /* End of pWC.a[] */
int nByte; /* Byte of memory needed for pIdx */
//WhereTerm pWCEnd; /* End of pWC.a[] */
//int nByte; /* Byte of memory needed for pIdx */
Index pIdx; /* Object describing the transient index */
Vdbe v; /* Prepared statement under construction */
int regIsInit; /* Register set by initialization */
Expand Down

0 comments on commit 117e2fe

Please sign in to comment.