aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2015-01-12 21:43:00 +0000
committermistachkin <mistachkin@noemail.net>2015-01-12 21:43:00 +0000
commit9ab31fcee1b23700863377df7de1af0826b6df9c (patch)
tree5f29dc9c11cff0627a95af0d6f456ceb501b04bd /src/tclsqlite.c
parent8d9da63dacde128e546f84cb34392188aab1be83 (diff)
parent189143d355334b248d7748ae049a08591ec13d47 (diff)
downloadsqlite-9ab31fcee1b23700863377df7de1af0826b6df9c.tar.gz
sqlite-9ab31fcee1b23700863377df7de1af0826b6df9c.zip
Fix harmless compiler warnings when using -W4 with MSVC.
FossilOrigin-Name: e693e11d1b9265974c32bddba873ea30a4d0b708
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 852f966a8..a912e8aba 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -25,6 +25,14 @@
** hundreds of new commands used for testing
** SQLite. This option implies -DSQLITE_TCLMD5.
*/
+
+/*
+** If requested, include the SQLite compiler options file for MSVC.
+*/
+#if defined(INCLUDE_MSVC_H)
+#include "msvc.h"
+#endif
+
#include "tcl.h"
#include <errno.h>
@@ -1085,10 +1093,10 @@ static int dbPrepareAndBind(
SqlPreparedStmt **ppPreStmt /* OUT: Object used to cache statement */
){
const char *zSql = zIn; /* Pointer to first SQL statement in zIn */
- sqlite3_stmt *pStmt; /* Prepared statement object */
+ sqlite3_stmt *pStmt = 0; /* Prepared statement object */
SqlPreparedStmt *pPreStmt; /* Pointer to cached statement */
int nSql; /* Length of zSql in bytes */
- int nVar; /* Number of variables in statement */
+ int nVar = 0; /* Number of variables in statement */
int iParm = 0; /* Next free entry in apParm */
char c;
int i;
@@ -3102,7 +3110,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** The EXTERN macros are required by TCL in order to work on windows.
*/
EXTERN int Sqlite3_Init(Tcl_Interp *interp){
- int rc = Tcl_InitStubs(interp, "8.4", 0)==0 ? TCL_ERROR : TCL_OK;
+ int rc = Tcl_InitStubs(interp, "8.4", 0) ? TCL_OK : TCL_ERROR;
if( rc==TCL_OK ){
Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0);
#ifndef SQLITE_3_SUFFIX_ONLY