/ Check-in [139eecbe]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix minor compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 139eecbe1b072711a36128f1eeb24fc3e3bacc1c
User & Date: drh 2011-05-07 14:40:29
Context
2011-05-07
18:18
Return SQLITE_MISUSE from the sqlite3_open_v2() function if the 3rd parameter is not a valid set of bit-values. check-in: 3c926ce0 user: drh tags: trunk
14:40
Fix minor compiler warnings. check-in: 139eecbe user: drh tags: trunk
2011-05-06
18:55
Merge the uri branch with the trunk. check-in: 88df33c4 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/attach.c.

    68     68     int i;
    69     69     int rc = 0;
    70     70     sqlite3 *db = sqlite3_context_db_handle(context);
    71     71     const char *zName;
    72     72     const char *zFile;
    73     73     char *zPath = 0;
    74     74     char *zErr = 0;
    75         -  int flags;
           75  +  unsigned int flags;
    76     76     Db *aNew;
    77     77     char *zErrDyn = 0;
    78     78     sqlite3_vfs *pVfs;
    79     79   
    80     80     UNUSED_PARAMETER(NotUsed);
    81     81   
    82     82     zFile = (const char *)sqlite3_value_text(argv[0]);

Changes to src/main.c.

  1813   1813   ** may be set to point to a buffer containing an English language error 
  1814   1814   ** message. It is the responsibility of the caller to eventually release
  1815   1815   ** this buffer by calling sqlite3_free().
  1816   1816   */
  1817   1817   int sqlite3ParseUri(
  1818   1818     const char *zDefaultVfs,        /* VFS to use if no "vfs=xxx" query option */
  1819   1819     const char *zUri,               /* Nul-terminated URI to parse */
  1820         -  int *pFlags,                    /* IN/OUT: SQLITE_OPEN_XXX flags */
         1820  +  unsigned int *pFlags,           /* IN/OUT: SQLITE_OPEN_XXX flags */
  1821   1821     sqlite3_vfs **ppVfs,            /* OUT: VFS to use */ 
  1822   1822     char **pzFile,                  /* OUT: Filename component of URI */
  1823   1823     char **pzErrMsg                 /* OUT: Error message (if rc!=SQLITE_OK) */
  1824   1824   ){
  1825   1825     int rc = SQLITE_OK;
  1826         -  int flags = *pFlags;
         1826  +  unsigned int flags = *pFlags;
  1827   1827     const char *zVfs = zDefaultVfs;
  1828   1828     char *zFile;
  1829   1829     int nUri = sqlite3Strlen30(zUri);
  1830   1830   
  1831   1831     assert( *pzErrMsg==0 );
  1832   1832   
  1833   1833     if( ((flags & SQLITE_OPEN_URI) || sqlite3GlobalConfig.bOpenUri) 
................................................................................
  1968   1968           }
  1969   1969   
  1970   1970           if( aMode ){
  1971   1971             int i;
  1972   1972             int mode = 0;
  1973   1973             for(i=0; aMode[i].z; i++){
  1974   1974               const char *z = aMode[i].z;
  1975         -            if( nVal==strlen(z) && 0==memcmp(zVal, z, nVal) ){
         1975  +            if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){
  1976   1976                 mode = aMode[i].mode;
  1977   1977                 break;
  1978   1978               }
  1979   1979             }
  1980   1980             if( mode==0 ){
  1981   1981               *pzErrMsg = sqlite3_mprintf("no such %s mode: %s", zModeType, zVal);
  1982   1982               rc = SQLITE_ERROR;
................................................................................
  2021   2021   ** This routine does the work of opening a database on behalf of
  2022   2022   ** sqlite3_open() and sqlite3_open16(). The database filename "zFilename"  
  2023   2023   ** is UTF-8 encoded.
  2024   2024   */
  2025   2025   static int openDatabase(
  2026   2026     const char *zFilename, /* Database filename UTF-8 encoded */
  2027   2027     sqlite3 **ppDb,        /* OUT: Returned database handle */
  2028         -  unsigned flags,        /* Operational flags */
         2028  +  unsigned int flags,    /* Operational flags */
  2029   2029     const char *zVfs       /* Name of the VFS to use */
  2030   2030   ){
  2031   2031     sqlite3 *db;                    /* Store allocated handle here */
  2032   2032     int rc;                         /* Return code */
  2033   2033     int isThreadsafe;               /* True for threadsafe connections */
  2034   2034     char *zOpen = 0;                /* Filename argument to pass to BtreeOpen() */
  2035   2035     char *zErrMsg = 0;              /* Error message from sqlite3ParseUri() */
................................................................................
  2290   2290   }
  2291   2291   int sqlite3_open_v2(
  2292   2292     const char *filename,   /* Database filename (UTF-8) */
  2293   2293     sqlite3 **ppDb,         /* OUT: SQLite db handle */
  2294   2294     int flags,              /* Flags */
  2295   2295     const char *zVfs        /* Name of VFS module to use */
  2296   2296   ){
  2297         -  return openDatabase(filename, ppDb, flags, zVfs);
         2297  +  return openDatabase(filename, ppDb, (unsigned int)flags, zVfs);
  2298   2298   }
  2299   2299   
  2300   2300   #ifndef SQLITE_OMIT_UTF16
  2301   2301   /*
  2302   2302   ** Open a new database handle.
  2303   2303   */
  2304   2304   int sqlite3_open16(

Changes to src/sqliteInt.h.

   799    799   ** consistently.
   800    800   */
   801    801   struct sqlite3 {
   802    802     sqlite3_vfs *pVfs;            /* OS Interface */
   803    803     int nDb;                      /* Number of backends currently in use */
   804    804     Db *aDb;                      /* All backends */
   805    805     int flags;                    /* Miscellaneous flags. See below */
   806         -  int openFlags;                /* Flags passed to sqlite3_vfs.xOpen() */
          806  +  unsigned int openFlags;       /* Flags passed to sqlite3_vfs.xOpen() */
   807    807     int errCode;                  /* Most recent error code (SQLITE_*) */
   808    808     int errMask;                  /* & result codes with this before returning */
   809    809     u8 autoCommit;                /* The auto-commit flag. */
   810    810     u8 temp_store;                /* 1: file 2: memory 0: default */
   811    811     u8 mallocFailed;              /* True if we have seen a malloc failure */
   812    812     u8 dfltLockMode;              /* Default locking-mode for attached dbs */
   813    813     signed char nextAutovac;      /* Autovac setting after VACUUM if >=0 */
................................................................................
  2669   2669   void sqlite3AddNotNull(Parse*, int);
  2670   2670   void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
  2671   2671   void sqlite3AddCheckConstraint(Parse*, Expr*);
  2672   2672   void sqlite3AddColumnType(Parse*,Token*);
  2673   2673   void sqlite3AddDefaultValue(Parse*,ExprSpan*);
  2674   2674   void sqlite3AddCollateType(Parse*, Token*);
  2675   2675   void sqlite3EndTable(Parse*,Token*,Token*,Select*);
  2676         -int sqlite3ParseUri(const char*,const char*,int*,sqlite3_vfs**,char**,char **);
         2676  +int sqlite3ParseUri(const char*,const char*,unsigned int*,
         2677  +                    sqlite3_vfs**,char**,char **);
  2677   2678   
  2678   2679   Bitvec *sqlite3BitvecCreate(u32);
  2679   2680   int sqlite3BitvecTest(Bitvec*, u32);
  2680   2681   int sqlite3BitvecSet(Bitvec*, u32);
  2681   2682   void sqlite3BitvecClear(Bitvec*, u32, void*);
  2682   2683   void sqlite3BitvecDestroy(Bitvec*);
  2683   2684   u32 sqlite3BitvecSize(Bitvec*);