/ Check-in [01c4b5b8]
Login

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

Overview
Comment:Fix compiler warnings on MSVC build.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:01c4b5b84ec7ce589e20ea66e80011f092ab32f0
User & Date: shane 2009-11-03 19:42:31
Context
2009-11-04
01:56
Report errors back up to the ATTACH command if the codec fails to initialize. check-in: a6c69610 user: drh tags: trunk
2009-11-03
22:34
Customizations for OSX contributed by Apple. check-in: 941a01eb user: adam tags: apple-osx
19:42
Fix compiler warnings on MSVC build. check-in: 01c4b5b8 user: shane tags: trunk
19:18
Enhancements to lemon to generate more compact action tables and to avoid making array bounds tests that can never fail on action table calculations. check-in: 27d8e684 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

configure became a regular file.


Changes to src/expr.c.

   567    567     assert( !ExprHasAnyProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly) );
   568    568     z = pExpr->u.zToken;
   569    569     assert( z!=0 );
   570    570     assert( z[0]!=0 );
   571    571     if( z[1]==0 ){
   572    572       /* Wildcard of the form "?".  Assign the next variable number */
   573    573       assert( z[0]=='?' );
          574  +#if SQLITE_MAX_VARIABLE_NUMBER<=32767
          575  +    pExpr->iColumn = (i16)(++pParse->nVar);
          576  +#else
   574    577       pExpr->iColumn = ++pParse->nVar;
          578  +#endif
   575    579     }else if( z[0]=='?' ){
   576    580       /* Wildcard of the form "?nnn".  Convert "nnn" to an integer and
   577    581       ** use it as the variable number */
   578         -    int i;
   579         -    pExpr->iColumn = i = atoi((char*)&z[1]);
          582  +    int i = atoi((char*)&z[1]);
          583  +#if SQLITE_MAX_VARIABLE_NUMBER<=32767
          584  +    pExpr->iColumn = (i16)i;
          585  +#else
          586  +    pExpr->iColumn = i;
          587  +#endif
   580    588       testcase( i==0 );
   581    589       testcase( i==1 );
   582    590       testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
   583    591       testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
   584    592       if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
   585    593         sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
   586    594             db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]);
................................................................................
   601    609         assert( pE!=0 );
   602    610         if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){
   603    611           pExpr->iColumn = pE->iColumn;
   604    612           break;
   605    613         }
   606    614       }
   607    615       if( i>=pParse->nVarExpr ){
          616  +#if SQLITE_MAX_VARIABLE_NUMBER<=32767
          617  +      pExpr->iColumn = (i16)(++pParse->nVar);
          618  +#else
   608    619         pExpr->iColumn = ++pParse->nVar;
          620  +#endif
   609    621         if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
   610    622           pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
   611    623           pParse->apVarExpr =
   612    624               sqlite3DbReallocOrFree(
   613    625                 db,
   614    626                 pParse->apVarExpr,
   615    627                 pParse->nVarExprAlloc*sizeof(pParse->apVarExpr[0])

Changes to src/os_win.c.

  1250   1250   static int getLastErrorMsg(int nBuf, char *zBuf){
  1251   1251     /* FormatMessage returns 0 on failure.  Otherwise it
  1252   1252     ** returns the number of TCHARs written to the output
  1253   1253     ** buffer, excluding the terminating null char.
  1254   1254     */
  1255   1255     DWORD error = GetLastError();
  1256   1256     DWORD dwLen = 0;
  1257         -  char *zOut;
         1257  +  char *zOut = 0;
  1258   1258   
  1259   1259     if( isNT() ){
  1260   1260       WCHAR *zTempWide = NULL;
  1261   1261       dwLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
  1262   1262                              NULL,
  1263   1263                              error,
  1264   1264                              0,

Changes to src/resolve.c.

   403    403     if( p ){
   404    404       struct SrcList_item *pItem = &pSrc->a[iSrc];
   405    405       p->pTab = pItem->pTab;
   406    406       p->iTable = pItem->iCursor;
   407    407       if( p->pTab->iPKey==iCol ){
   408    408         p->iColumn = -1;
   409    409       }else{
          410  +#if SQLITE_MAX_VARIABLE_NUMBER<=32767
          411  +      p->iColumn = (i16)iCol;
          412  +#else
   410    413         p->iColumn = iCol;
          414  +#endif
   411    415         pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
   412    416       }
   413    417       ExprSetProperty(p, EP_Resolved);
   414    418     }
   415    419     return p;
   416    420   }
   417    421   

Changes to src/vdbeaux.c.

    56     56     assert( isPrepareV2==1 || isPrepareV2==0 );
    57     57     if( p==0 ) return;
    58     58   #ifdef SQLITE_OMIT_TRACE
    59     59     if( !isPrepareV2 ) return;
    60     60   #endif
    61     61     assert( p->zSql==0 );
    62     62     p->zSql = sqlite3DbStrNDup(p->db, z, n);
    63         -  p->isPrepareV2 = isPrepareV2;
           63  +  p->isPrepareV2 = (u8)isPrepareV2;
    64     64   }
    65     65   
    66     66   /*
    67     67   ** Return the SQL associated with a prepared statement
    68     68   */
    69     69   const char *sqlite3_sql(sqlite3_stmt *pStmt){
    70     70     Vdbe *p = (Vdbe *)pStmt;
................................................................................
  1355   1355         }
  1356   1356         zCsr = p->pFree;
  1357   1357         zEnd = &zCsr[nByte];
  1358   1358       }while( nByte && !db->mallocFailed );
  1359   1359   
  1360   1360       p->nCursor = (u16)nCursor;
  1361   1361       if( p->aVar ){
  1362         -      p->nVar = nVar;
         1362  +      p->nVar = (u16)nVar;
  1363   1363         for(n=0; n<nVar; n++){
  1364   1364           p->aVar[n].flags = MEM_Null;
  1365   1365           p->aVar[n].db = db;
  1366   1366         }
  1367   1367       }
  1368   1368       if( p->aMem ){
  1369   1369         p->aMem--;                      /* aMem[] goes from 1..nMem */