/ Check-in [e9d05cbb]
Login

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

Overview
Comment:Fix typos and comments and make minor changes to a few function names, as suggested by readership.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e9d05cbb7676cbda83f1b3b71447404d7edde898
User & Date: drh 2012-01-04 12:57:45
Context
2012-01-05
11:43
Remove the SQLITE_FCNTL_SYNC_OMITTED cases from the unix and windows VFSes as they are no longer needed because of check-in [fd3822f1f2]. check-in: 7cf568a1 user: drh tags: trunk
2012-01-04
12:57
Fix typos and comments and make minor changes to a few function names, as suggested by readership. check-in: e9d05cbb user: drh tags: trunk
2012-01-03
14:50
Make sure filenames passed into sqlite3OsOpen() always have the extra zero-terminators needed by sqlite3_uri_parameter(). check-in: d73e93cf user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/insert.c.

  1103   1103   **                                return code of SQLITE_CONSTRAINT.
  1104   1104   **
  1105   1105   **  any              ABORT        Back out changes from the current command
  1106   1106   **                                only (do not do a complete rollback) then
  1107   1107   **                                cause sqlite3_exec() to return immediately
  1108   1108   **                                with SQLITE_CONSTRAINT.
  1109   1109   **
  1110         -**  any              FAIL         Sqlite_exec() returns immediately with a
         1110  +**  any              FAIL         Sqlite3_exec() returns immediately with a
  1111   1111   **                                return code of SQLITE_CONSTRAINT.  The
  1112   1112   **                                transaction is not rolled back and any
  1113   1113   **                                prior changes are retained.
  1114   1114   **
  1115   1115   **  any              IGNORE       The record number and data is popped from
  1116   1116   **                                the stack and there is an immediate jump
  1117   1117   **                                to label ignoreDest.

Changes to src/mutex.c.

   146    146     return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
   147    147   }
   148    148   int sqlite3_mutex_notheld(sqlite3_mutex *p){
   149    149     return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
   150    150   }
   151    151   #endif
   152    152   
   153         -#endif /* SQLITE_MUTEX_OMIT */
          153  +#endif /* !defined(SQLITE_MUTEX_OMIT) */

Changes to src/mutex_noop.c.

   198    198   ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation
   199    199   ** is used regardless of the run-time threadsafety setting.
   200    200   */
   201    201   #ifdef SQLITE_MUTEX_NOOP
   202    202   sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
   203    203     return sqlite3NoopMutex();
   204    204   }
   205         -#endif /* SQLITE_MUTEX_NOOP */
   206         -#endif /* SQLITE_MUTEX_OMIT */
          205  +#endif /* defined(SQLITE_MUTEX_NOOP) */
          206  +#endif /* !defined(SQLITE_MUTEX_OMIT) */

Changes to src/mutex_unix.c.

   344    344       0
   345    345   #endif
   346    346     };
   347    347   
   348    348     return &sMutex;
   349    349   }
   350    350   
   351         -#endif /* SQLITE_MUTEX_PTHREAD */
          351  +#endif /* SQLITE_MUTEX_PTHREADS */

Changes to src/sqlite.h.in.

  5394   5394   ** The SQLite source code contains multiple implementations
  5395   5395   ** of these mutex routines.  An appropriate implementation
  5396   5396   ** is selected automatically at compile-time.  ^(The following
  5397   5397   ** implementations are available in the SQLite core:
  5398   5398   **
  5399   5399   ** <ul>
  5400   5400   ** <li>   SQLITE_MUTEX_OS2
  5401         -** <li>   SQLITE_MUTEX_PTHREAD
         5401  +** <li>   SQLITE_MUTEX_PTHREADS
  5402   5402   ** <li>   SQLITE_MUTEX_W32
  5403   5403   ** <li>   SQLITE_MUTEX_NOOP
  5404   5404   ** </ul>)^
  5405   5405   **
  5406   5406   ** ^The SQLITE_MUTEX_NOOP implementation is a set of routines
  5407   5407   ** that does no real locking and is appropriate for use in
  5408   5408   ** a single-threaded application.  ^The SQLITE_MUTEX_OS2,
  5409         -** SQLITE_MUTEX_PTHREAD, and SQLITE_MUTEX_W32 implementations
         5409  +** SQLITE_MUTEX_PTHREADS, and SQLITE_MUTEX_W32 implementations
  5410   5410   ** are appropriate for use on OS/2, Unix, and Windows.
  5411   5411   **
  5412   5412   ** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor
  5413   5413   ** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex
  5414   5414   ** implementation is included with the library. In this case the
  5415   5415   ** application must supply a custom mutex implementation using the
  5416   5416   ** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function

Changes to src/test_func.c.


Changes to src/vdbe.c.

    48     48   
    49     49   /*
    50     50   ** Invoke this macro on memory cells just prior to changing the
    51     51   ** value of the cell.  This macro verifies that shallow copies are
    52     52   ** not misused.
    53     53   */
    54     54   #ifdef SQLITE_DEBUG
    55         -# define memAboutToChange(P,M) sqlite3VdbeMemPrepareToChange(P,M)
           55  +# define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M)
    56     56   #else
    57     57   # define memAboutToChange(P,M)
    58     58   #endif
    59     59   
    60     60   /*
    61     61   ** The following global variable is incremented every time a cursor
    62     62   ** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes.  The test
................................................................................
    66     66   */
    67     67   #ifdef SQLITE_TEST
    68     68   int sqlite3_search_count = 0;
    69     69   #endif
    70     70   
    71     71   /*
    72     72   ** When this global variable is positive, it gets decremented once before
    73         -** each instruction in the VDBE.  When reaches zero, the u1.isInterrupted
    74         -** field of the sqlite3 structure is set in order to simulate and interrupt.
           73  +** each instruction in the VDBE.  When it reaches zero, the u1.isInterrupted
           74  +** field of the sqlite3 structure is set in order to simulate an interrupt.
    75     75   **
    76     76   ** This facility is used for testing purposes only.  It does not function
    77     77   ** in an ordinary build.
    78     78   */
    79     79   #ifdef SQLITE_TEST
    80     80   int sqlite3_interrupt_count = 0;
    81     81   #endif
................................................................................
   192    192   ** Allocate VdbeCursor number iCur.  Return a pointer to it.  Return NULL
   193    193   ** if we run out of memory.
   194    194   */
   195    195   static VdbeCursor *allocateCursor(
   196    196     Vdbe *p,              /* The virtual machine */
   197    197     int iCur,             /* Index of the new VdbeCursor */
   198    198     int nField,           /* Number of fields in the table or index */
   199         -  int iDb,              /* When database the cursor belongs to, or -1 */
          199  +  int iDb,              /* Database the cursor belongs to, or -1 */
   200    200     int isBtreeCursor     /* True for B-Tree.  False for pseudo-table or vtab */
   201    201   ){
   202    202     /* Find the memory cell that will be used to store the blob of memory
   203    203     ** required for this VdbeCursor structure. It is convenient to use a 
   204    204     ** vdbe memory cell to manage the memory allocation required for a
   205    205     ** VdbeCursor structure for the following reasons:
   206    206     **
................................................................................
   474    474   /*
   475    475   ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
   476    476   ** sqlite3_interrupt() routine has been called.  If it has been, then
   477    477   ** processing of the VDBE program is interrupted.
   478    478   **
   479    479   ** This macro added to every instruction that does a jump in order to
   480    480   ** implement a loop.  This test used to be on every single instruction,
   481         -** but that meant we more testing that we needed.  By only testing the
          481  +** but that meant we more testing than we needed.  By only testing the
   482    482   ** flag on jump instructions, we get a (small) speed improvement.
   483    483   */
   484    484   #define CHECK_FOR_INTERRUPT \
   485    485      if( db->u1.isInterrupted ) goto abort_due_to_interrupt;
   486    486   
   487    487   
   488    488   #ifndef NDEBUG
................................................................................
   669    669       */
   670    670       assert( pOp->opflags==sqlite3OpcodeProperty[pOp->opcode] );
   671    671       if( pOp->opflags & OPFLG_OUT2_PRERELEASE ){
   672    672         assert( pOp->p2>0 );
   673    673         assert( pOp->p2<=p->nMem );
   674    674         pOut = &aMem[pOp->p2];
   675    675         memAboutToChange(p, pOut);
   676         -      MemReleaseExt(pOut);
          676  +      VdbeMemRelease(pOut);
   677    677         pOut->flags = MEM_Int;
   678    678       }
   679    679   
   680    680       /* Sanity checking on other operands */
   681    681   #ifdef SQLITE_DEBUG
   682    682       if( (pOp->opflags & OPFLG_IN1)!=0 ){
   683    683         assert( pOp->p1>0 );
................................................................................
   973    973     int cnt;
   974    974     cnt = pOp->p3-pOp->p2;
   975    975     assert( pOp->p3<=p->nMem );
   976    976     pOut->flags = MEM_Null;
   977    977     while( cnt>0 ){
   978    978       pOut++;
   979    979       memAboutToChange(p, pOut);
   980         -    MemReleaseExt(pOut);
          980  +    VdbeMemRelease(pOut);
   981    981       pOut->flags = MEM_Null;
   982    982       cnt--;
   983    983     }
   984    984     break;
   985    985   }
   986    986   
   987    987   
................................................................................
  2371   2371     ** then there are not enough fields in the record to satisfy the
  2372   2372     ** request.  In this case, set the value NULL or to P4 if P4 is
  2373   2373     ** a pointer to a Mem object.
  2374   2374     */
  2375   2375     if( aOffset[p2] ){
  2376   2376       assert( rc==SQLITE_OK );
  2377   2377       if( zRec ){
  2378         -      MemReleaseExt(pDest);
         2378  +      VdbeMemRelease(pDest);
  2379   2379         sqlite3VdbeSerialGet((u8 *)&zRec[aOffset[p2]], aType[p2], pDest);
  2380   2380       }else{
  2381   2381         len = sqlite3VdbeSerialTypeLen(aType[p2]);
  2382   2382         sqlite3VdbeMemMove(&sMem, pDest);
  2383   2383         rc = sqlite3VdbeMemFromBtree(pCrsr, aOffset[p2], len, pC->isIndex, &sMem);
  2384   2384         if( rc!=SQLITE_OK ){
  2385   2385           goto op_column_out;

Changes to src/vdbeInt.h.

   404    404   double sqlite3VdbeRealValue(Mem*);
   405    405   void sqlite3VdbeIntegerAffinity(Mem*);
   406    406   int sqlite3VdbeMemRealify(Mem*);
   407    407   int sqlite3VdbeMemNumerify(Mem*);
   408    408   int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
   409    409   void sqlite3VdbeMemRelease(Mem *p);
   410    410   void sqlite3VdbeMemReleaseExternal(Mem *p);
   411         -#define MemReleaseExt(X)  \
          411  +#define VdbeMemRelease(X)  \
   412    412     if((X)->flags&(MEM_Agg|MEM_Dyn|MEM_RowSet|MEM_Frame)) \
   413    413       sqlite3VdbeMemReleaseExternal(X);
   414    414   int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
   415    415   const char *sqlite3OpcodeName(int);
   416    416   int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
   417    417   int sqlite3VdbeCloseStatement(Vdbe *, int);
   418    418   void sqlite3VdbeFrameDelete(VdbeFrame*);
................................................................................
   443    443     void sqlite3VdbeLeave(Vdbe*);
   444    444   #else
   445    445   # define sqlite3VdbeEnter(X)
   446    446   # define sqlite3VdbeLeave(X)
   447    447   #endif
   448    448   
   449    449   #ifdef SQLITE_DEBUG
   450         -void sqlite3VdbeMemPrepareToChange(Vdbe*,Mem*);
          450  +void sqlite3VdbeMemAboutToChange(Vdbe*,Mem*);
   451    451   #endif
   452    452   
   453    453   #ifndef SQLITE_OMIT_FOREIGN_KEY
   454    454   int sqlite3VdbeCheckFk(Vdbe *, int);
   455    455   #else
   456    456   # define sqlite3VdbeCheckFk(p,i) 0
   457    457   #endif

Changes to src/vdbeaux.c.

   192    192     int addr = sqlite3VdbeAddOp3(p, op, p1, p2, p3);
   193    193     sqlite3VdbeChangeP4(p, addr, zP4, p4type);
   194    194     return addr;
   195    195   }
   196    196   
   197    197   /*
   198    198   ** Add an OP_ParseSchema opcode.  This routine is broken out from
   199         -** sqlite3VdbeAddOp4() since it needs to also local all btrees.
          199  +** sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees
          200  +** as having been used.
   200    201   **
   201    202   ** The zWhere string must have been obtained from sqlite3_malloc().
   202    203   ** This routine will take ownership of the allocated memory.
   203    204   */
   204    205   void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *zWhere){
   205    206     int j;
   206    207     int addr = sqlite3VdbeAddOp3(p, OP_ParseSchema, iDb, 0, 0);
................................................................................
   959    960   }
   960    961   #endif
   961    962   
   962    963   /*
   963    964   ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
   964    965   **
   965    966   ** The prepared statements need to know in advance the complete set of
   966         -** attached databases that they will be using.  A mask of these databases
   967         -** is maintained in p->btreeMask and is used for locking and other purposes.
          967  +** attached databases that will be use.  A mask of these databases
          968  +** is maintained in p->btreeMask.  The p->lockMask value is the subset of
          969  +** p->btreeMask of databases that will require a lock.
   968    970   */
   969    971   void sqlite3VdbeUsesBtree(Vdbe *p, int i){
   970    972     assert( i>=0 && i<p->db->nDb && i<(int)sizeof(yDbMask)*8 );
   971    973     assert( i<(int)sizeof(p->btreeMask)*8 );
   972    974     p->btreeMask |= ((yDbMask)1)<<i;
   973    975     if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){
   974    976       p->lockMask |= ((yDbMask)1)<<i;

Changes to src/vdbemem.c.

   288    288   
   289    289   /*
   290    290   ** Release any memory held by the Mem. This may leave the Mem in an
   291    291   ** inconsistent state, for example with (Mem.z==0) and
   292    292   ** (Mem.type==SQLITE_TEXT).
   293    293   */
   294    294   void sqlite3VdbeMemRelease(Mem *p){
   295         -  MemReleaseExt(p);
          295  +  VdbeMemRelease(p);
   296    296     sqlite3DbFree(p->db, p->zMalloc);
   297    297     p->z = 0;
   298    298     p->zMalloc = 0;
   299    299     p->xDel = 0;
   300    300   }
   301    301   
   302    302   /*
................................................................................
   584    584   ** This routine prepares a memory cell for modication by breaking
   585    585   ** its link to a shallow copy and by marking any current shallow
   586    586   ** copies of this cell as invalid.
   587    587   **
   588    588   ** This is used for testing and debugging only - to make sure shallow
   589    589   ** copies are not misused.
   590    590   */
   591         -void sqlite3VdbeMemPrepareToChange(Vdbe *pVdbe, Mem *pMem){
          591  +void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
   592    592     int i;
   593    593     Mem *pX;
   594    594     for(i=1, pX=&pVdbe->aMem[1]; i<=pVdbe->nMem; i++, pX++){
   595    595       if( pX->pScopyFrom==pMem ){
   596    596         pX->flags |= MEM_Invalid;
   597    597         pX->pScopyFrom = 0;
   598    598       }
................................................................................
   610    610   ** Make an shallow copy of pFrom into pTo.  Prior contents of
   611    611   ** pTo are freed.  The pFrom->z field is not duplicated.  If
   612    612   ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z
   613    613   ** and flags gets srcType (either MEM_Ephem or MEM_Static).
   614    614   */
   615    615   void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
   616    616     assert( (pFrom->flags & MEM_RowSet)==0 );
   617         -  MemReleaseExt(pTo);
          617  +  VdbeMemRelease(pTo);
   618    618     memcpy(pTo, pFrom, MEMCELLSIZE);
   619    619     pTo->xDel = 0;
   620    620     if( (pFrom->flags&MEM_Static)==0 ){
   621    621       pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem);
   622    622       assert( srcType==MEM_Ephem || srcType==MEM_Static );
   623    623       pTo->flags |= srcType;
   624    624     }
................................................................................
   628    628   ** Make a full copy of pFrom into pTo.  Prior contents of pTo are
   629    629   ** freed before the copy is made.
   630    630   */
   631    631   int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
   632    632     int rc = SQLITE_OK;
   633    633   
   634    634     assert( (pFrom->flags & MEM_RowSet)==0 );
   635         -  MemReleaseExt(pTo);
          635  +  VdbeMemRelease(pTo);
   636    636     memcpy(pTo, pFrom, MEMCELLSIZE);
   637    637     pTo->flags &= ~MEM_Dyn;
   638    638   
   639    639     if( pTo->flags&(MEM_Str|MEM_Blob) ){
   640    640       if( 0==(pFrom->flags&MEM_Static) ){
   641    641         pTo->flags |= MEM_Ephem;
   642    642         rc = sqlite3VdbeMemMakeWriteable(pTo);