/ Check-in [e1e64307]
Login

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

Overview
Comment:Fix compiler warnings with MSVC build. (CVS 6761)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e1e6430752449a34671b6c89326b03ac36ea6d9a
User & Date: shane 2009-06-15 16:27:08
Context
2009-06-15
18:32
Updates to resolve.c to facilitate full coverage testing. (CVS 6762) check-in: c50f0f28 user: drh tags: trunk
16:27
Fix compiler warnings with MSVC build. (CVS 6761) check-in: e1e64307 user: shane tags: trunk
03:28
Version 3.6.15 (CVS 6760) check-in: aff34826 user: drh tags: trunk, release, version-3.6.15
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.627 2009/06/14 12:47:11 drh Exp $
           12  +** $Id: btree.c,v 1.628 2009/06/15 16:27:08 shane Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** See the header comment on "btreeInt.h" for additional information.
    16     16   ** Including a description of file format and an overview of operation.
    17     17   */
    18     18   #include "btreeInt.h"
    19     19   
................................................................................
  1187   1187         }
  1188   1188         next = get2byte(&data[pc]);
  1189   1189         size = get2byte(&data[pc+2]);
  1190   1190         if( next>0 && next<=pc+size+3 ){
  1191   1191           /* Free blocks must be in accending order */
  1192   1192           return SQLITE_CORRUPT_BKPT; 
  1193   1193         }
  1194         -      nFree += size;
         1194  +      nFree = nFree + size;
  1195   1195         pc = next;
  1196   1196       }
  1197   1197   
  1198   1198       /* At this point, nFree contains the sum of the offset to the start
  1199   1199       ** of the cell-content area plus the number of free bytes within
  1200   1200       ** the cell-content area. If this is greater than the usable-size
  1201   1201       ** of the page, then the page must be corrupted. This check also
................................................................................
  5331   5331     BtShared *pBt;               /* The whole database */
  5332   5332     int nCell = 0;               /* Number of cells in apCell[] */
  5333   5333     int nMaxCells = 0;           /* Allocated size of apCell, szCell, aFrom. */
  5334   5334     int nOld = 0;                /* Number of pages in apOld[] */
  5335   5335     int nNew = 0;                /* Number of pages in apNew[] */
  5336   5336     int i, j, k;                 /* Loop counters */
  5337   5337     int nxDiv;                   /* Next divider slot in pParent->aCell[] */
  5338         -  int rc;                      /* The return code */
         5338  +  int rc = SQLITE_OK;          /* The return code */
  5339   5339     int leafCorrection;          /* 4 if pPage is a leaf.  0 if not */
  5340   5340     int leafData;                /* True if pPage is a leaf of a LEAFDATA tree */
  5341   5341     int usableSpace;             /* Bytes in pPage beyond the header */
  5342   5342     int pageFlags;               /* Value of pPage->aData[0] */
  5343   5343     int subtotal;                /* Subtotal of bytes in cells on one page */
  5344   5344     int iSpace1 = 0;             /* First unused byte of aSpace1[] */
  5345   5345     int iOvflSpace = 0;          /* First unused byte of aOvflSpace[] */

Changes to src/vtab.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to help implement virtual tables.
    13     13   **
    14         -** $Id: vtab.c,v 1.90 2009/06/02 21:31:39 drh Exp $
           14  +** $Id: vtab.c,v 1.91 2009/06/15 16:27:08 shane Exp $
    15     15   */
    16     16   #ifndef SQLITE_OMIT_VIRTUALTABLE
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** The actual function that does the work of creating a new module.
    21     21   ** This function implements the sqlite3_create_module() and
................................................................................
    98     98   }
    99     99   
   100    100   /*
   101    101   ** Unlock a virtual table.  When the last lock is removed,
   102    102   ** disconnect the virtual table.
   103    103   */
   104    104   void sqlite3VtabUnlock(sqlite3 *db, sqlite3_vtab *pVtab){
          105  +#ifndef SQLITE_DEBUG
          106  +  UNUSED_PARAMETER(db);
          107  +#endif
   105    108     assert( pVtab->nRef>0 );
   106    109     pVtab->nRef--;
   107    110     assert(db);
   108    111     assert( sqlite3SafetyCheckOk(db) );
   109    112     if( pVtab->nRef==0 ){
   110    113   #ifdef SQLITE_DEBUG
   111    114       if( db->magic==SQLITE_MAGIC_BUSY ){

Changes to src/where.c.

    12     12   ** This module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.  This module is responsible for
    14     14   ** generating the code that loops through a table looking for applicable
    15     15   ** rows.  Indices are selected and used to speed the search when doing
    16     16   ** so is applicable.  Because this module is responsible for selecting
    17     17   ** indices, you might also think of this module as the "query optimizer".
    18     18   **
    19         -** $Id: where.c,v 1.406 2009/06/11 17:04:28 drh Exp $
           19  +** $Id: where.c,v 1.407 2009/06/15 16:27:08 shane Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   
    23     23   /*
    24     24   ** Trace output macros
    25     25   */
    26     26   #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
................................................................................
   657    657     if( pColl==0 ) return 0;
   658    658     if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) &&
   659    659         (pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){
   660    660       return 0;
   661    661     }
   662    662     if( sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ) return 0;
   663    663     z = pRight->u.zToken;
   664         -  cnt = 0;
   665    664     if( ALWAYS(z) ){
          665  +    cnt = 0;
   666    666       while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
   667    667         cnt++;
   668    668       }
          669  +    if( cnt!=0 && c!=0 && 255!=(u8)z[cnt-1] ){
          670  +      *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
          671  +      *pnPattern = cnt;
          672  +      return 1;
          673  +    }
   669    674     }
   670         -  if( cnt==0 || c==0 || 255==(u8)z[cnt-1] ){
   671         -    return 0;
   672         -  }
   673         -  *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
   674         -  *pnPattern = cnt;
   675         -  return 1;
          675  +  return 0;
   676    676   }
   677    677   #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
   678    678   
   679    679   
   680    680   #ifndef SQLITE_OMIT_VIRTUALTABLE
   681    681   /*
   682    682   ** Check to see if the given expression is of the form
................................................................................
  2872   2872       **
  2873   2873       */
  2874   2874       WhereClause *pOrWc;    /* The OR-clause broken out into subterms */
  2875   2875       WhereTerm *pFinal;     /* Final subterm within the OR-clause. */
  2876   2876       SrcList oneTab;        /* Shortened table list */
  2877   2877   
  2878   2878       int regReturn = ++pParse->nMem;           /* Register used with OP_Gosub */
  2879         -    int regRowset;                            /* Register for RowSet object */
  2880         -    int regRowid;                             /* Register holding rowid */
         2879  +    int regRowset = 0;                        /* Register for RowSet object */
         2880  +    int regRowid = 0;                         /* Register holding rowid */
  2881   2881       int iLoopBody = sqlite3VdbeMakeLabel(v);  /* Start of loop body */
  2882   2882       int iRetInit;                             /* Address of regReturn init */
  2883   2883       int ii;
  2884   2884      
  2885   2885       pTerm = pLevel->plan.u.pTerm;
  2886   2886       assert( pTerm!=0 );
  2887   2887       assert( pTerm->eOperator==WO_OR );
................................................................................
  2921   2921                           WHERE_OMIT_OPEN | WHERE_OMIT_CLOSE | WHERE_FORCE_TABLE);
  2922   2922           if( pSubWInfo ){
  2923   2923             if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){
  2924   2924               int iSet = ((ii==pOrWc->nTerm-1)?-1:ii);
  2925   2925               int r;
  2926   2926               r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, 
  2927   2927                                            regRowid, 0);
  2928         -            sqlite3VdbeAddOp4(v, OP_RowSetTest, regRowset, 
         2928  +            sqlite3VdbeAddOp4(v, OP_RowSetTest, regRowset,
  2929   2929                                 sqlite3VdbeCurrentAddr(v)+2,
  2930   2930                                 r, SQLITE_INT_TO_PTR(iSet), P4_INT32);
  2931   2931             }
  2932   2932             sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody);
  2933   2933   
  2934   2934             /* Finish the loop through table entries that match term pOrTerm. */
  2935   2935             sqlite3WhereEnd(pSubWInfo);