/ Check-in [44375a34]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Silence some harmless uninitialized local variable warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | msvcW4
Files: files | file ages | folders
SHA1: 44375a34e59d1b0f0d765a99dcc7e6f30a4be7f7
User & Date: mistachkin 2015-01-12 19:59:12
Context
2015-01-12
20:20
Add two more classes of harmless MSVC compiler warnings. check-in: de30d5b0 user: mistachkin tags: msvcW4
19:59
Silence some harmless uninitialized local variable warnings. check-in: 44375a34 user: mistachkin tags: msvcW4
19:49
Harmless compiler warning fixes for 'testfixture' and the miscellaneous extensions when built with the MSVC makefile. check-in: 923fd660 user: mistachkin tags: msvcW4
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/amatch.c.

   394    394   }
   395    395   
   396    396   /* Remove node pOld from the tree.  pOld must be an element of the tree or
   397    397   ** the AVL tree will become corrupt.
   398    398   */
   399    399   static void amatchAvlRemove(amatch_avl **ppHead, amatch_avl *pOld){
   400    400     amatch_avl **ppParent;
   401         -  amatch_avl *pBalance;
          401  +  amatch_avl *pBalance = 0;
   402    402     /* assert( amatchAvlSearch(*ppHead, pOld->zKey)==pOld ); */
   403    403     ppParent = amatchAvlFromPtr(pOld, ppHead);
   404    404     if( pOld->pBefore==0 && pOld->pAfter==0 ){
   405    405       *ppParent = 0;
   406    406       pBalance = pOld->pUp;
   407    407     }else if( pOld->pBefore && pOld->pAfter ){
   408    408       amatch_avl *pX, *pY;

Changes to ext/misc/spellfix.c.

   352    352   ** then this value is always the number of bytes in zB (i.e. strlen(zB)).
   353    353   ** If zA does end in a '*', then it is the number of bytes in the prefix
   354    354   ** of zB that was deemed to match zA.
   355    355   */
   356    356   static int editdist1(const char *zA, const char *zB, int *pnMatch){
   357    357     int nA, nB;            /* Number of characters in zA[] and zB[] */
   358    358     int xA, xB;            /* Loop counters for zA[] and zB[] */
   359         -  char cA, cB;           /* Current character of zA and zB */
          359  +  char cA = 0, cB;       /* Current character of zA and zB */
   360    360     char cAprev, cBprev;   /* Previous character of zA and zB */
   361    361     char cAnext, cBnext;   /* Next character in zA and zB */
   362    362     int d;                 /* North-west cost value */
   363    363     int dc = 0;            /* North-west character value */
   364    364     int res;               /* Final result */
   365    365     int *m;                /* The cost matrix */
   366    366     char *cx;              /* Corresponding character values */

Changes to src/tclsqlite.c.

  1089   1089   static int dbPrepareAndBind(
  1090   1090     SqliteDb *pDb,                  /* Database object */
  1091   1091     char const *zIn,                /* SQL to compile */
  1092   1092     char const **pzOut,             /* OUT: Pointer to next SQL statement */
  1093   1093     SqlPreparedStmt **ppPreStmt     /* OUT: Object used to cache statement */
  1094   1094   ){
  1095   1095     const char *zSql = zIn;         /* Pointer to first SQL statement in zIn */
  1096         -  sqlite3_stmt *pStmt;            /* Prepared statement object */
         1096  +  sqlite3_stmt *pStmt = 0;        /* Prepared statement object */
  1097   1097     SqlPreparedStmt *pPreStmt;      /* Pointer to cached statement */
  1098   1098     int nSql;                       /* Length of zSql in bytes */
  1099         -  int nVar;                       /* Number of variables in statement */
         1099  +  int nVar = 0;                   /* Number of variables in statement */
  1100   1100     int iParm = 0;                  /* Next free entry in apParm */
  1101   1101     char c;
  1102   1102     int i;
  1103   1103     Tcl_Interp *interp = pDb->interp;
  1104   1104   
  1105   1105     *ppPreStmt = 0;
  1106   1106   

Changes to src/test_malloc.c.

  1334   1334   static int test_status(
  1335   1335     void * clientData,
  1336   1336     Tcl_Interp *interp,
  1337   1337     int objc,
  1338   1338     Tcl_Obj *CONST objv[]
  1339   1339   ){
  1340   1340     int rc, iValue, mxValue;
  1341         -  int i, op, resetFlag;
         1341  +  int i, op = 0, resetFlag;
  1342   1342     const char *zOpName;
  1343   1343     static const struct {
  1344   1344       const char *zName;
  1345   1345       int op;
  1346   1346     } aOp[] = {
  1347   1347       { "SQLITE_STATUS_MEMORY_USED",         SQLITE_STATUS_MEMORY_USED         },
  1348   1348       { "SQLITE_STATUS_MALLOC_SIZE",         SQLITE_STATUS_MALLOC_SIZE         },
................................................................................
  1391   1391   static int test_db_status(
  1392   1392     void * clientData,
  1393   1393     Tcl_Interp *interp,
  1394   1394     int objc,
  1395   1395     Tcl_Obj *CONST objv[]
  1396   1396   ){
  1397   1397     int rc, iValue, mxValue;
  1398         -  int i, op, resetFlag;
         1398  +  int i, op = 0, resetFlag;
  1399   1399     const char *zOpName;
  1400   1400     sqlite3 *db;
  1401   1401     extern int getDbPointer(Tcl_Interp*, const char*, sqlite3**);
  1402   1402     static const struct {
  1403   1403       const char *zName;
  1404   1404       int op;
  1405   1405     } aOp[] = {

Changes to src/test_multiplex.c.

   402    402   static void multiplexControlFunc(
   403    403     sqlite3_context *context,
   404    404     int argc,
   405    405     sqlite3_value **argv
   406    406   ){
   407    407     int rc = SQLITE_OK;
   408    408     sqlite3 *db = sqlite3_context_db_handle(context);
   409         -  int op;
          409  +  int op = 0;
   410    410     int iVal;
   411    411   
   412    412     if( !db || argc!=2 ){ 
   413    413       rc = SQLITE_ERROR; 
   414    414     }else{
   415    415       /* extract params */
   416    416       op = sqlite3_value_int(argv[0]);

Changes to src/test_quota.c.

   885    885   }
   886    886   
   887    887   /*
   888    888   ** Bring the named file under quota management.  Or if it is already under
   889    889   ** management, update its size.
   890    890   */
   891    891   int sqlite3_quota_file(const char *zFilename){
   892         -  char *zFull;
          892  +  char *zFull = 0;
   893    893     sqlite3_file *fd;
   894    894     int rc;
   895    895     int outFlags = 0;
   896    896     sqlite3_int64 iSize;
   897    897     int nAlloc = gQuota.sThisVfs.szOsFile + gQuota.sThisVfs.mxPathname+2;
   898    898   
   899    899     /* Allocate space for a file-handle and the full path for file zFilename */

Changes to src/test_vfs.c.

   417    417   */
   418    418   static int tvfsSync(sqlite3_file *pFile, int flags){
   419    419     int rc = SQLITE_OK;
   420    420     TestvfsFd *pFd = tvfsGetFd(pFile);
   421    421     Testvfs *p = (Testvfs *)pFd->pVfs->pAppData;
   422    422   
   423    423     if( p->pScript && p->mask&TESTVFS_SYNC_MASK ){
   424         -    char *zFlags;
          424  +    char *zFlags = 0;
   425    425   
   426    426       switch( flags ){
   427    427         case SQLITE_SYNC_NORMAL:
   428    428           zFlags = "normal";
   429    429           break;
   430    430         case SQLITE_SYNC_FULL:
   431    431           zFlags = "full";
................................................................................
  1221   1221       ** TESTVFS ioerr ?IFAIL PERSIST?
  1222   1222       **
  1223   1223       **   Where IFAIL is an integer and PERSIST is boolean.
  1224   1224       */
  1225   1225       case CMD_CANTOPENERR:
  1226   1226       case CMD_IOERR:
  1227   1227       case CMD_FULLERR: {
  1228         -      TestFaultInject *pTest;
         1228  +      TestFaultInject *pTest = 0;
  1229   1229         int iRet;
  1230   1230   
  1231   1231         switch( aSubcmd[i].eCmd ){
  1232   1232           case CMD_IOERR: pTest = &p->ioerr_err; break;
  1233   1233           case CMD_FULLERR: pTest = &p->full_err; break;
  1234   1234           case CMD_CANTOPENERR: pTest = &p->cantopen_err; break;
  1235   1235           default: assert(0);