/ Check-in [ed2dda93]
Login

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

Overview
Comment:More compiler warning fixes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ed2dda9329ca42e9c0be1986c78b091051e7598f
User & Date: drh 2011-06-20 19:00:30
Context
2011-06-20
20:15
Remove the SQLITE_OMIT_CONFLICT_CLAUSE preprocessor define which was no longer in use. check-in: 90249559 user: drh tags: trunk
19:00
More compiler warning fixes. check-in: ed2dda93 user: drh tags: trunk
18:27
Fix compiler warnings in lemon by removing some of the code added by Ryan Gordon in [1e8b842039cc0]. check-in: 76b18b2b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

  4350   4350     Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab;
  4351   4351     int rc = SQLITE_OK;
  4352   4352     int iCol;
  4353   4353   
  4354   4354     if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){
  4355   4355       assert( pCsr->nDoc>0 );
  4356   4356       for(iCol=0; iCol<pTab->nColumn; iCol++){
  4357         -      aiOut[iCol*3 + 1] = pCsr->nDoc;
  4358         -      aiOut[iCol*3 + 2] = pCsr->nDoc;
         4357  +      aiOut[iCol*3 + 1] = (u32)pCsr->nDoc;
         4358  +      aiOut[iCol*3 + 2] = (u32)pCsr->nDoc;
  4359   4359       }
  4360   4360     }else{
  4361   4361       rc = fts3EvalGatherStats(pCsr, pExpr);
  4362   4362       if( rc==SQLITE_OK ){
  4363   4363         assert( pExpr->aMI );
  4364   4364         for(iCol=0; iCol<pTab->nColumn; iCol++){
  4365   4365           aiOut[iCol*3 + 1] = pExpr->aMI[iCol*3 + 1];

Changes to ext/fts3/fts3Int.h.

   245    245     sqlite3_int64 iPrevId;          /* Previous id read from aDoclist */
   246    246     char *pNextId;                  /* Pointer into the body of aDoclist */
   247    247     char *aDoclist;                 /* List of docids for full-text queries */
   248    248     int nDoclist;                   /* Size of buffer at aDoclist */
   249    249     u8 bDesc;                       /* True to sort in descending order */
   250    250     int eEvalmode;                  /* An FTS3_EVAL_XX constant */
   251    251     int nRowAvg;                    /* Average size of database rows, in pages */
   252         -  int nDoc;                       /* Documents in table */
          252  +  sqlite3_int64 nDoc;             /* Documents in table */
   253    253   
   254    254     int isMatchinfoNeeded;          /* True when aMatchinfo[] needs filling in */
   255    255     u32 *aMatchinfo;                /* Information about most recent match */
   256    256     int nMatchinfo;                 /* Number of elements in aMatchinfo[] */
   257    257     char *zMatchinfo;               /* Matchinfo specification */
   258    258   };
   259    259   

Changes to ext/fts3/fts3_write.c.

  1319   1319     assert( pgsz>0 );
  1320   1320   
  1321   1321     for(ii=0; rc==SQLITE_OK && ii<pMsr->nSegment; ii++){
  1322   1322       Fts3SegReader *pReader = pMsr->apSegment[ii];
  1323   1323       if( !fts3SegReaderIsPending(pReader) 
  1324   1324        && !fts3SegReaderIsRootOnly(pReader) 
  1325   1325       ){
  1326         -      int jj;
         1326  +      sqlite3_int64 jj;
  1327   1327         for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){
  1328   1328           int nBlob;
  1329   1329           rc = sqlite3Fts3ReadBlock(p, jj, 0, &nBlob, 0);
  1330   1330           if( rc!=SQLITE_OK ) break;
  1331   1331           if( (nBlob+35)>pgsz ){
  1332   1332             nOvfl += (nBlob + 34)/pgsz;
  1333   1333           }

Changes to ext/rtree/rtree.c.

  1417   1417   /*
  1418   1418   ** Return the N-dimensional volumn of the cell stored in *p.
  1419   1419   */
  1420   1420   static float cellArea(Rtree *pRtree, RtreeCell *p){
  1421   1421     float area = 1.0;
  1422   1422     int ii;
  1423   1423     for(ii=0; ii<(pRtree->nDim*2); ii+=2){
  1424         -    area = area * (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
         1424  +    area = (float)(area * (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])));
  1425   1425     }
  1426   1426     return area;
  1427   1427   }
  1428   1428   
  1429   1429   /*
  1430   1430   ** Return the margin length of cell p. The margin length is the sum
  1431   1431   ** of the objects size in each dimension.
  1432   1432   */
  1433   1433   static float cellMargin(Rtree *pRtree, RtreeCell *p){
  1434   1434     float margin = 0.0;
  1435   1435     int ii;
  1436   1436     for(ii=0; ii<(pRtree->nDim*2); ii+=2){
  1437         -    margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
         1437  +    margin += (float)(DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
  1438   1438     }
  1439   1439     return margin;
  1440   1440   }
  1441   1441   
  1442   1442   /*
  1443   1443   ** Store the union of cells p1 and p2 in p1.
  1444   1444   */
................................................................................
  1515   1515           x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj]));
  1516   1516           x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1]));
  1517   1517   
  1518   1518           if( x2<x1 ){
  1519   1519             o = 0.0;
  1520   1520             break;
  1521   1521           }else{
  1522         -          o = o * (x2-x1);
         1522  +          o = o * (float)(x2-x1);
  1523   1523           }
  1524   1524         }
  1525   1525         overlap += o;
  1526   1526       }
  1527   1527     }
  1528   1528     return overlap;
  1529   1529   }
................................................................................
  1534   1534     Rtree *pRtree, 
  1535   1535     RtreeCell *p, 
  1536   1536     RtreeCell *pInsert, 
  1537   1537     RtreeCell *aCell, 
  1538   1538     int nCell, 
  1539   1539     int iExclude
  1540   1540   ){
  1541         -  float before;
  1542         -  float after;
         1541  +  double before;
         1542  +  double after;
  1543   1543     before = cellOverlap(pRtree, p, aCell, nCell, iExclude);
  1544   1544     cellUnion(pRtree, p, pInsert);
  1545   1545     after = cellOverlap(pRtree, p, aCell, nCell, iExclude);
  1546         -  return after-before;
         1546  +  return (float)(after-before);
  1547   1547   }
  1548   1548   #endif
  1549   1549   
  1550   1550   
  1551   1551   /*
  1552   1552   ** This function implements the ChooseLeaf algorithm from Gutman[84].
  1553   1553   ** ChooseSubTree in r*tree terminology.
................................................................................
  2484   2484       if( ii==(nCell-1) ){
  2485   2485         memcpy(&aCell[ii], pCell, sizeof(RtreeCell));
  2486   2486       }else{
  2487   2487         nodeGetCell(pRtree, pNode, ii, &aCell[ii]);
  2488   2488       }
  2489   2489       aOrder[ii] = ii;
  2490   2490       for(iDim=0; iDim<pRtree->nDim; iDim++){
  2491         -      aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2]);
  2492         -      aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2+1]);
         2491  +      aCenterCoord[iDim] += (float)DCOORD(aCell[ii].aCoord[iDim*2]);
         2492  +      aCenterCoord[iDim] += (float)DCOORD(aCell[ii].aCoord[iDim*2+1]);
  2493   2493       }
  2494   2494     }
  2495   2495     for(iDim=0; iDim<pRtree->nDim; iDim++){
  2496         -    aCenterCoord[iDim] = aCenterCoord[iDim]/((float)nCell*2.0);
         2496  +    aCenterCoord[iDim] = (float)(aCenterCoord[iDim]/((float)nCell*2.0));
  2497   2497     }
  2498   2498   
  2499   2499     for(ii=0; ii<nCell; ii++){
  2500   2500       aDistance[ii] = 0.0;
  2501   2501       for(iDim=0; iDim<pRtree->nDim; iDim++){
  2502         -      float coord = DCOORD(aCell[ii].aCoord[iDim*2+1]) - 
  2503         -          DCOORD(aCell[ii].aCoord[iDim*2]);
         2502  +      float coord = (float)(DCOORD(aCell[ii].aCoord[iDim*2+1]) - 
         2503  +          DCOORD(aCell[ii].aCoord[iDim*2]));
  2504   2504         aDistance[ii] += (coord-aCenterCoord[iDim])*(coord-aCenterCoord[iDim]);
  2505   2505       }
  2506   2506     }
  2507   2507   
  2508   2508     SortByDistance(aOrder, nCell, aDistance, aSpare);
  2509   2509     nodeZero(pRtree, pNode);
  2510   2510   
................................................................................
  2595   2595       RtreeNode *pInsert;
  2596   2596       RtreeCell cell;
  2597   2597       nodeGetCell(pRtree, pNode, ii, &cell);
  2598   2598   
  2599   2599       /* Find a node to store this cell in. pNode->iNode currently contains
  2600   2600       ** the height of the sub-tree headed by the cell.
  2601   2601       */
  2602         -    rc = ChooseLeaf(pRtree, &cell, pNode->iNode, &pInsert);
         2602  +    rc = ChooseLeaf(pRtree, &cell, (int)pNode->iNode, &pInsert);
  2603   2603       if( rc==SQLITE_OK ){
  2604   2604         int rc2;
  2605         -      rc = rtreeInsertCell(pRtree, pInsert, &cell, pNode->iNode);
         2605  +      rc = rtreeInsertCell(pRtree, pInsert, &cell, (int)pNode->iNode);
  2606   2606         rc2 = nodeRelease(pRtree, pInsert);
  2607   2607         if( rc==SQLITE_OK ){
  2608   2608           rc = rc2;
  2609   2609         }
  2610   2610       }
  2611   2611     }
  2612   2612     return rc;

Changes to src/tclsqlite.c.

   757    757             int bytes = sqlite3_value_bytes(pIn);
   758    758             pVal = Tcl_NewByteArrayObj(sqlite3_value_blob(pIn), bytes);
   759    759             break;
   760    760           }
   761    761           case SQLITE_INTEGER: {
   762    762             sqlite_int64 v = sqlite3_value_int64(pIn);
   763    763             if( v>=-2147483647 && v<=2147483647 ){
   764         -            pVal = Tcl_NewIntObj(v);
          764  +            pVal = Tcl_NewIntObj((int)v);
   765    765             }else{
   766    766               pVal = Tcl_NewWideIntObj(v);
   767    767             }
   768    768             break;
   769    769           }
   770    770           case SQLITE_FLOAT: {
   771    771             double r = sqlite3_value_double(pIn);
................................................................................
  1437   1437         const char *zBlob = sqlite3_column_blob(pStmt, iCol);
  1438   1438         if( !zBlob ) bytes = 0;
  1439   1439         return Tcl_NewByteArrayObj((u8*)zBlob, bytes);
  1440   1440       }
  1441   1441       case SQLITE_INTEGER: {
  1442   1442         sqlite_int64 v = sqlite3_column_int64(pStmt, iCol);
  1443   1443         if( v>=-2147483647 && v<=2147483647 ){
  1444         -        return Tcl_NewIntObj(v);
         1444  +        return Tcl_NewIntObj((int)v);
  1445   1445         }else{
  1446   1446           return Tcl_NewWideIntObj(v);
  1447   1447         }
  1448   1448       }
  1449   1449       case SQLITE_FLOAT: {
  1450   1450         return Tcl_NewDoubleObj(sqlite3_column_double(pStmt, iCol));
  1451   1451       }
................................................................................
  2363   2363         int len;
  2364   2364         char *zNull = Tcl_GetStringFromObj(objv[2], &len);
  2365   2365         if( pDb->zNull ){
  2366   2366           Tcl_Free(pDb->zNull);
  2367   2367         }
  2368   2368         if( zNull && len>0 ){
  2369   2369           pDb->zNull = Tcl_Alloc( len + 1 );
  2370         -        strncpy(pDb->zNull, zNull, len);
         2370  +        memcpy(pDb->zNull, zNull, len);
  2371   2371           pDb->zNull[len] = '\0';
  2372   2372         }else{
  2373   2373           pDb->zNull = 0;
  2374   2374         }
  2375   2375       }
  2376   2376       Tcl_SetObjResult(interp, dbTextToObj(pDb->zNull));
  2377   2377       break;