/ Check-in [78862252]
Login

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

Overview
Comment:Fix some harmless compiler warnings seen with MSVC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 78862252da7f59d4737ed16f4ccf100cea27d8b421db31051afbaa8d96f24de3
User & Date: mistachkin 2018-09-12 01:05:26
Context
2018-09-12
08:51
Fix an invalid pointer comparison triggered by renaming a table column when there are views with explicit column names in the schema. check-in: 572de7e4 user: dan tags: trunk
01:05
Fix some harmless compiler warnings seen with MSVC. check-in: 78862252 user: mistachkin tags: trunk
00:48
For MSVC, migrate some commonly used shell compilation options to the library. check-in: 68a71e5f user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/json1.c.

  1832   1832     if( pStr ){
  1833   1833       pStr->pCtx = ctx;
  1834   1834       jsonAppendChar(pStr, ']');
  1835   1835       if( pStr->bErr ){
  1836   1836         if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
  1837   1837         assert( pStr->bStatic );
  1838   1838       }else if( isFinal ){
  1839         -      sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
         1839  +      sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
  1840   1840                             pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
  1841   1841         pStr->bStatic = 1;
  1842   1842       }else{
  1843         -      sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT);
         1843  +      sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT);
  1844   1844         pStr->nUsed--;
  1845   1845       }
  1846   1846     }else{
  1847   1847       sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC);
  1848   1848     }
  1849   1849     sqlite3_result_subtype(ctx, JSON_SUBTYPE);
  1850   1850   }
................................................................................
  1885   1885       if( z[i]=='"' ){
  1886   1886         inStr = !inStr;
  1887   1887       }else if( z[i]=='\\' ){
  1888   1888         i++;
  1889   1889       }
  1890   1890     }
  1891   1891     pStr->nUsed -= i;      
  1892         -  memmove(&z[1], &z[i+1], pStr->nUsed-1);
         1892  +  memmove(&z[1], &z[i+1], (size_t)pStr->nUsed-1);
  1893   1893   }
  1894   1894   #else
  1895   1895   # define jsonGroupInverse 0
  1896   1896   #endif
  1897   1897   
  1898   1898   
  1899   1899   /*
................................................................................
  1931   1931     pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0);
  1932   1932     if( pStr ){
  1933   1933       jsonAppendChar(pStr, '}');
  1934   1934       if( pStr->bErr ){
  1935   1935         if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
  1936   1936         assert( pStr->bStatic );
  1937   1937       }else if( isFinal ){
  1938         -      sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
         1938  +      sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
  1939   1939                             pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
  1940   1940         pStr->bStatic = 1;
  1941   1941       }else{
  1942         -      sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT);
         1942  +      sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT);
  1943   1943         pStr->nUsed--;
  1944   1944       }
  1945   1945     }else{
  1946   1946       sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC);
  1947   1947     }
  1948   1948     sqlite3_result_subtype(ctx, JSON_SUBTYPE);
  1949   1949   }

Changes to ext/rtree/geopoly.c.

   176    176         }
   177    177         if( c<'0' || c>'9' ) return 0;
   178    178         continue;
   179    179       }
   180    180       break;
   181    181     }
   182    182     if( z[j-1]<'0' ) return 0;
   183         -  if( pVal ) *pVal = atof((const char*)p->z);
          183  +  if( pVal ) *pVal = (GeoCoord)atof((const char*)p->z);
   184    184     p->z += j;
   185    185     return 1;
   186    186   }
   187    187   
   188    188   /*
   189    189   ** If the input is a well-formed JSON array of coordinates with at least
   190    190   ** four coordinates and where each coordinate is itself a two-value array,
................................................................................
   431    431     double F = sqlite3_value_double(argv[6]);
   432    432     GeoCoord x1, y1, x0, y0;
   433    433     int ii;
   434    434     if( p ){
   435    435       for(ii=0; ii<p->nVertex; ii++){
   436    436         x0 = p->a[ii*2];
   437    437         y0 = p->a[ii*2+1];
   438         -      x1 = A*x0 + B*y0 + E;
   439         -      y1 = C*x0 + D*y0 + F;
          438  +      x1 = (GeoCoord)(A*x0 + B*y0 + E);
          439  +      y1 = (GeoCoord)(C*x0 + D*y0 + F);
   440    440         p->a[ii*2] = x1;
   441    441         p->a[ii*2+1] = y1;
   442    442       }
   443    443       sqlite3_result_blob(context, p->hdr, 
   444    444          4+8*p->nVertex, SQLITE_TRANSIENT);
   445    445       sqlite3_free(p);
   446    446     }
................................................................................
   507    507     }
   508    508     if( p ){
   509    509       int ii;
   510    510       mnX = mxX = p->a[0];
   511    511       mnY = mxY = p->a[1];
   512    512       for(ii=1; ii<p->nVertex; ii++){
   513    513         double r = p->a[ii*2];
   514         -      if( r<mnX ) mnX = r;
   515         -      else if( r>mxX ) mxX = r;
          514  +      if( r<mnX ) mnX = (float)r;
          515  +      else if( r>mxX ) mxX = (float)r;
   516    516         r = p->a[ii*2+1];
   517         -      if( r<mnY ) mnY = r;
   518         -      else if( r>mxY ) mxY = r;
          517  +      if( r<mnY ) mnY = (float)r;
          518  +      else if( r>mxY ) mxY = (float)r;
   519    519       }
   520    520       if( pRc ) *pRc = SQLITE_OK;
   521    521       if( aCoord==0 ){
   522    522         geopolyBboxFill:
   523    523         pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6);
   524    524         if( pOut==0 ){
   525    525           sqlite3_free(p);

Changes to ext/rtree/rtree.c.

  3269   3269   **   BEGIN;
  3270   3270   **     INSERT INTO rtree...
  3271   3271   **     DROP TABLE <tablename>;    -- Would fail with SQLITE_LOCKED
  3272   3272   **   COMMIT;
  3273   3273   */
  3274   3274   static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){
  3275   3275     Rtree *pRtree = (Rtree *)pVtab;
  3276         -  int iwt = pRtree->inWrTrans;
         3276  +  u8 iwt = pRtree->inWrTrans;
  3277   3277     UNUSED_PARAMETER(iSavepoint);
  3278   3278     pRtree->inWrTrans = 0;
  3279   3279     nodeBlobReset(pRtree);
  3280   3280     pRtree->inWrTrans = iwt;
  3281   3281     return SQLITE_OK;
  3282   3282   }
  3283   3283   

Changes to src/memdb.c.

    12     12   **
    13     13   ** This file implements an in-memory VFS. A database is held as a contiguous
    14     14   ** block of memory.
    15     15   **
    16     16   ** This file also implements interface sqlite3_serialize() and
    17     17   ** sqlite3_deserialize().
    18     18   */
    19         -#ifdef SQLITE_ENABLE_DESERIALIZE
    20     19   #include "sqliteInt.h"
           20  +#ifdef SQLITE_ENABLE_DESERIALIZE
    21     21   
    22     22   /*
    23     23   ** Forward declaration of objects used by this utility
    24     24   */
    25     25   typedef struct sqlite3_vfs MemVfs;
    26     26   typedef struct MemFile MemFile;
    27     27