/ Check-in [fd74d3d9]
Login

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

Overview
Comment:Fix compiler warnings found on Lion.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fd74d3d91721ca404537f195fed04c9edef20bf2
User & Date: drh 2012-09-29 14:45:54
Context
2012-09-29
15:45
Disable the bigfile tests on Macs. check-in: d869edda user: drh tags: trunk
14:45
Fix compiler warnings found on Lion. check-in: fd74d3d9 user: drh tags: trunk
2012-09-28
20:23
Avoid calling sqlite3BtreeEnter() in a corner case where the corresponding database handle mutex (sqlite3.mutex) may not be held. This prevents a potential deadlock or crash that can occur if the backup API, shared-cache mode and SQLITE_HAVE_CODEC are all in use. check-in: 89b8c377 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/tclsqlite.c.

  2363   2363       Tcl_AppendResult(interp, "incrblob not available in this build", 0);
  2364   2364       return TCL_ERROR;
  2365   2365   #else
  2366   2366       int isReadonly = 0;
  2367   2367       const char *zDb = "main";
  2368   2368       const char *zTable;
  2369   2369       const char *zColumn;
  2370         -    sqlite_int64 iRow;
         2370  +    Tcl_WideInt iRow;
  2371   2371   
  2372   2372       /* Check for the -readonly option */
  2373   2373       if( objc>3 && strcmp(Tcl_GetString(objv[2]), "-readonly")==0 ){
  2374   2374         isReadonly = 1;
  2375   2375       }
  2376   2376   
  2377   2377       if( objc!=(5+isReadonly) && objc!=(6+isReadonly) ){

Changes to src/test1.c.

  3063   3063     void * clientData,
  3064   3064     Tcl_Interp *interp,
  3065   3065     int objc,
  3066   3066     Tcl_Obj *CONST objv[]
  3067   3067   ){
  3068   3068     sqlite3_stmt *pStmt;
  3069   3069     int idx;
  3070         -  i64 value;
         3070  +  Tcl_WideInt value;
  3071   3071     int rc;
  3072   3072   
  3073   3073     if( objc!=4 ){
  3074   3074       Tcl_AppendResult(interp, "wrong # args: should be \"",
  3075   3075           Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0);
  3076   3076       return TCL_ERROR;
  3077   3077     }
................................................................................
  4699   4699   static int test_soft_heap_limit(
  4700   4700     void * clientData,
  4701   4701     Tcl_Interp *interp,
  4702   4702     int objc,
  4703   4703     Tcl_Obj *CONST objv[]
  4704   4704   ){
  4705   4705     sqlite3_int64 amt;
  4706         -  sqlite3_int64 N = -1;
         4706  +  Tcl_WideInt N = -1;
  4707   4707     if( objc!=1 && objc!=2 ){
  4708   4708       Tcl_WrongNumArgs(interp, 1, objv, "?N?");
  4709   4709       return TCL_ERROR;
  4710   4710     }
  4711   4711     if( objc==2 ){
  4712   4712       if( Tcl_GetWideIntFromObj(interp, objv[1], &N) ) return TCL_ERROR;
  4713   4713     }
................................................................................
  5092   5092   */
  5093   5093   static int file_control_sizehint_test(
  5094   5094     ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
  5095   5095     Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
  5096   5096     int objc,              /* Number of arguments */
  5097   5097     Tcl_Obj *CONST objv[]  /* Command arguments */
  5098   5098   ){
  5099         -  sqlite3_int64 nSize;            /* Hinted size */
         5099  +  Tcl_WideInt nSize;              /* Hinted size */
  5100   5100     char *zDb;                      /* Db name ("main", "temp" etc.) */
  5101   5101     sqlite3 *db;                    /* Database handle */
  5102   5102     int rc;                         /* file_control() return code */
  5103   5103   
  5104   5104     if( objc!=4 ){
  5105   5105       Tcl_WrongNumArgs(interp, 1, objv, "DB DBNAME SIZE");
  5106   5106       return TCL_ERROR;

Changes to src/test_intarray.c.

   342    342   #ifndef SQLITE_OMIT_VIRTUALTABLE
   343    343     a = sqlite3_malloc( sizeof(a[0])*n );
   344    344     if( a==0 ){
   345    345       Tcl_AppendResult(interp, "SQLITE_NOMEM", (char*)0);
   346    346       return TCL_ERROR;
   347    347     }
   348    348     for(i=0; i<n; i++){
   349         -    a[i] = 0;
   350         -    Tcl_GetWideIntFromObj(0, objv[i+2], &a[i]);
          349  +    Tcl_WideInt x = 0;
          350  +    Tcl_GetWideIntFromObj(0, objv[i+2], &x);
          351  +    a[i] = x;
   351    352     }
   352    353     rc = sqlite3_intarray_bind(pArray, n, a, sqlite3_free);
   353    354     if( rc!=SQLITE_OK ){
   354    355       Tcl_AppendResult(interp, sqlite3TestErrorName(rc), (char*)0);
   355    356       return TCL_ERROR;
   356    357     }
   357    358   #endif

Changes to src/test_quota.c.

  1069   1069       pFile = 0;
  1070   1070     }
  1071   1071     rc = fwrite(pBuf, size, nmemb, p->f);
  1072   1072   
  1073   1073     /* If the write was incomplete, adjust the file size and group size
  1074   1074     ** downward */
  1075   1075     if( rc<nmemb && pFile ){
  1076         -    size_t nWritten = rc>=0 ? rc : 0;
         1076  +    size_t nWritten = rc;
  1077   1077       sqlite3_int64 iNewEnd = iOfst + size*nWritten;
  1078   1078       if( iNewEnd<iEnd ) iNewEnd = iEnd;
  1079   1079       quotaEnter();
  1080   1080       pFile->pGroup->iSize += iNewEnd - pFile->iSize;
  1081   1081       pFile->iSize = iNewEnd;
  1082   1082       quotaLeave();
  1083   1083     }
................................................................................
  1350   1350     Tcl_IncrRefCount(pEval);
  1351   1351     Tcl_ListObjAppendElement(0, pEval, Tcl_NewStringObj(zFilename, -1));
  1352   1352     Tcl_ListObjAppendElement(0, pEval, pVarname);
  1353   1353     Tcl_ListObjAppendElement(0, pEval, Tcl_NewWideIntObj(iSize));
  1354   1354     rc = Tcl_EvalObjEx(p->interp, pEval, TCL_EVAL_GLOBAL);
  1355   1355   
  1356   1356     if( rc==TCL_OK ){
         1357  +    Tcl_WideInt x;
  1357   1358       Tcl_Obj *pLimit = Tcl_ObjGetVar2(p->interp, pVarname, 0, 0);
  1358         -    rc = Tcl_GetWideIntFromObj(p->interp, pLimit, piLimit);
         1359  +    rc = Tcl_GetWideIntFromObj(p->interp, pLimit, &x);
         1360  +    *piLimit = x;
  1359   1361       Tcl_UnsetVar(p->interp, Tcl_GetString(pVarname), 0);
  1360   1362     }
  1361   1363   
  1362   1364     Tcl_DecrRefCount(pEval);
  1363   1365     Tcl_DecrRefCount(pVarname);
  1364   1366     if( rc!=TCL_OK ) Tcl_BackgroundError(p->interp);
  1365   1367   }
................................................................................
  1433   1435   static int test_quota_set(
  1434   1436     void * clientData,
  1435   1437     Tcl_Interp *interp,
  1436   1438     int objc,
  1437   1439     Tcl_Obj *CONST objv[]
  1438   1440   ){
  1439   1441     const char *zPattern;           /* File pattern to configure */
  1440         -  sqlite3_int64 iLimit;           /* Initial quota in bytes */
         1442  +  Tcl_WideInt iLimit;             /* Initial quota in bytes */
  1441   1443     Tcl_Obj *pScript;               /* Tcl script to invoke to increase quota */
  1442   1444     int rc;                         /* Value returned by quota_set() */
  1443   1445     TclQuotaCallback *p;            /* Callback object */
  1444   1446     int nScript;                    /* Length of callback script */
  1445   1447     void (*xDestroy)(void*);        /* Optional destructor for pArg */
  1446   1448     void (*xCallback)(const char *, sqlite3_int64 *, sqlite3_int64, void *);
  1447   1449   
................................................................................
  1609   1611     if( Tcl_GetIntFromObj(interp, objv[3], &nElem) ) return TCL_ERROR;
  1610   1612     zBuf = (char*)sqlite3_malloc( sz*nElem + 1 );
  1611   1613     if( zBuf==0 ){
  1612   1614       Tcl_SetResult(interp, "out of memory", TCL_STATIC);
  1613   1615       return TCL_ERROR;
  1614   1616     }
  1615   1617     got = sqlite3_quota_fread(zBuf, sz, nElem, p);
  1616         -  if( got<0 ) got = 0;
  1617   1618     zBuf[got*sz] = 0;
  1618   1619     Tcl_SetResult(interp, zBuf, TCL_VOLATILE);
  1619   1620     sqlite3_free(zBuf);
  1620   1621     return TCL_OK;
  1621   1622   }
  1622   1623   
  1623   1624   /*