/ Check-in [88134322]
Login

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

Overview
Comment:Changes to avoid "unused parameter" compiler warnings. (CVS 5921)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 88134322c36b41304aaeef99c39b4ef5b495ca3b
User & Date: danielk1977 2008-11-19 09:05:27
Context
2008-11-19
10:22
Simplify the way the pager layer invokes the busy-handler callback. (CVS 5922) check-in: 7bd1ac18 user: danielk1977 tags: trunk
09:05
Changes to avoid "unused parameter" compiler warnings. (CVS 5921) check-in: 88134322 user: danielk1977 tags: trunk
01:20
Add an alternative application-defined pcache implementation and add test cases to permutations.test to invoke it. Added the SQLITE_CONFIG_GETPCACHE method to sqlite3_config(). (CVS 5920) check-in: 16f1e6ec user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that used to generate VDBE code
    13     13   ** that implements the ALTER TABLE command.
    14     14   **
    15         -** $Id: alter.c,v 1.49 2008/10/30 17:21:13 danielk1977 Exp $
           15  +** $Id: alter.c,v 1.50 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** The code in this file only exists if we are not omitting the
    22     22   ** ALTER TABLE logic from the build.
................................................................................
    35     35   **     -> 'CREATE TABLE def(a, b, c)'
    36     36   **
    37     37   ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
    38     38   **     -> 'CREATE INDEX i ON def(a, b, c)'
    39     39   */
    40     40   static void renameTableFunc(
    41     41     sqlite3_context *context,
    42         -  int argc,
           42  +  int NotUsed,
    43     43     sqlite3_value **argv
    44     44   ){
    45     45     unsigned char const *zSql = sqlite3_value_text(argv[0]);
    46     46     unsigned char const *zTableName = sqlite3_value_text(argv[1]);
    47     47   
    48     48     int token;
    49     49     Token tname;
    50     50     unsigned char const *zCsr = zSql;
    51     51     int len = 0;
    52     52     char *zRet;
    53     53   
    54     54     sqlite3 *db = sqlite3_context_db_handle(context);
           55  +
           56  +  UNUSED_PARAMETER(NotUsed);
    55     57   
    56     58     /* The principle used to locate the table name in the CREATE TABLE 
    57     59     ** statement is that the table name is the first non-space token that
    58     60     ** is immediately followed by a TK_LP or TK_USING token.
    59     61     */
    60     62     if( zSql ){
    61     63       do {
................................................................................
    90     92   ** statement. The second is a table name. The table name in the CREATE 
    91     93   ** TRIGGER statement is replaced with the third argument and the result 
    92     94   ** returned. This is analagous to renameTableFunc() above, except for CREATE
    93     95   ** TRIGGER, not CREATE INDEX and CREATE TABLE.
    94     96   */
    95     97   static void renameTriggerFunc(
    96     98     sqlite3_context *context,
    97         -  int argc,
           99  +  int NotUsed,
    98    100     sqlite3_value **argv
    99    101   ){
   100    102     unsigned char const *zSql = sqlite3_value_text(argv[0]);
   101    103     unsigned char const *zTableName = sqlite3_value_text(argv[1]);
   102    104   
   103    105     int token;
   104    106     Token tname;
   105    107     int dist = 3;
   106    108     unsigned char const *zCsr = zSql;
   107    109     int len = 0;
   108    110     char *zRet;
   109         -
   110    111     sqlite3 *db = sqlite3_context_db_handle(context);
          112  +
          113  +  UNUSED_PARAMETER(NotUsed);
   111    114   
   112    115     /* The principle used to locate the table name in the CREATE TRIGGER 
   113    116     ** statement is that the table name is the first token that is immediatedly
   114    117     ** preceded by either TK_ON or TK_DOT and immediatedly followed by one
   115    118     ** of TK_WHEN, TK_BEGIN or TK_FOR.
   116    119     */
   117    120     if( zSql ){

Changes to src/analyze.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code associated with the ANALYZE command.
    13     13   **
    14         -** @(#) $Id: analyze.c,v 1.44 2008/11/03 20:55:07 drh Exp $
           14  +** @(#) $Id: analyze.c,v 1.45 2008/11/19 09:05:27 danielk1977 Exp $
    15     15   */
    16     16   #ifndef SQLITE_OMIT_ANALYZE
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** This routine generates code that opens the sqlite_stat1 table on cursor
    21     21   ** iStatCur.
................................................................................
   352    352   /*
   353    353   ** This callback is invoked once for each index when reading the
   354    354   ** sqlite_stat1 table.  
   355    355   **
   356    356   **     argv[0] = name of the index
   357    357   **     argv[1] = results of analysis - on integer for each column
   358    358   */
   359         -static int analysisLoader(void *pData, int argc, char **argv, char **azNotUsed){
          359  +static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
   360    360     analysisInfo *pInfo = (analysisInfo*)pData;
   361    361     Index *pIndex;
   362    362     int i, c;
   363    363     unsigned int v;
   364    364     const char *z;
          365  +
          366  +  UNUSED_PARAMETER(NotUsed);
   365    367   
   366    368     assert( argc==2 );
   367    369     if( argv==0 || argv[0]==0 || argv[1]==0 ){
   368    370       return 0;
   369    371     }
   370    372     pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase);
   371    373     if( pIndex==0 ){

Changes to src/attach.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to implement the ATTACH and DETACH commands.
    13     13   **
    14         -** $Id: attach.c,v 1.79 2008/10/28 17:52:39 danielk1977 Exp $
           14  +** $Id: attach.c,v 1.80 2008/11/19 09:05:27 danielk1977 Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   #ifndef SQLITE_OMIT_ATTACH
    19     19   /*
    20     20   ** Resolve an expression that was part of an ATTACH or DETACH statement. This
    21     21   ** is slightly different from resolving a normal SQL expression, because simple
................................................................................
    60     60   **     SELECT sqlite_attach(x, y, z)
    61     61   **
    62     62   ** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the
    63     63   ** third argument.
    64     64   */
    65     65   static void attachFunc(
    66     66     sqlite3_context *context,
    67         -  int argc,
           67  +  int NotUsed,
    68     68     sqlite3_value **argv
    69     69   ){
    70     70     int i;
    71     71     int rc = 0;
    72     72     sqlite3 *db = sqlite3_context_db_handle(context);
    73     73     const char *zName;
    74     74     const char *zFile;
    75     75     Db *aNew;
    76     76     char *zErrDyn = 0;
    77     77     char zErr[128];
           78  +
           79  +  UNUSED_PARAMETER(NotUsed);
    78     80   
    79     81     zFile = (const char *)sqlite3_value_text(argv[0]);
    80     82     zName = (const char *)sqlite3_value_text(argv[1]);
    81     83     if( zFile==0 ) zFile = "";
    82     84     if( zName==0 ) zName = "";
    83     85   
    84     86     /* Check for the following errors:
................................................................................
   228    230   **
   229    231   **     DETACH DATABASE x
   230    232   **
   231    233   **     SELECT sqlite_detach(x)
   232    234   */
   233    235   static void detachFunc(
   234    236     sqlite3_context *context,
   235         -  int argc,
          237  +  int NotUsed,
   236    238     sqlite3_value **argv
   237    239   ){
   238    240     const char *zName = (const char *)sqlite3_value_text(argv[0]);
   239    241     sqlite3 *db = sqlite3_context_db_handle(context);
   240    242     int i;
   241    243     Db *pDb = 0;
   242    244     char zErr[128];
          245  +
          246  +  UNUSED_PARAMETER(NotUsed);
   243    247   
   244    248     if( zName==0 ) zName = "";
   245    249     for(i=0; i<db->nDb; i++){
   246    250       pDb = &db->aDb[i];
   247    251       if( pDb->pBt==0 ) continue;
   248    252       if( sqlite3StrICmp(pDb->zName, zName)==0 ) break;
   249    253     }

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.537 2008/11/17 14:20:56 danielk1977 Exp $
           12  +** $Id: btree.c,v 1.538 2008/11/19 09:05:27 danielk1977 Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** See the header comment on "btreeInt.h" for additional information.
    16     16   ** Including a description of file format and an overview of operation.
    17     17   */
    18     18   #include "btreeInt.h"
    19     19   
................................................................................
  6234   6234   /*
  6235   6235   ** Erase the given database page and all its children.  Return
  6236   6236   ** the page to the freelist.
  6237   6237   */
  6238   6238   static int clearDatabasePage(
  6239   6239     BtShared *pBt,           /* The BTree that contains the table */
  6240   6240     Pgno pgno,            /* Page number to clear */
  6241         -  MemPage *pParent,     /* Parent page.  NULL for the root */
  6242   6241     int freePageFlag,     /* Deallocate page if true */
  6243   6242     int *pnChange
  6244   6243   ){
  6245   6244     MemPage *pPage = 0;
  6246   6245     int rc;
  6247   6246     unsigned char *pCell;
  6248   6247     int i;
................................................................................
  6253   6252     }
  6254   6253   
  6255   6254     rc = getAndInitPage(pBt, pgno, &pPage);
  6256   6255     if( rc ) goto cleardatabasepage_out;
  6257   6256     for(i=0; i<pPage->nCell; i++){
  6258   6257       pCell = findCell(pPage, i);
  6259   6258       if( !pPage->leaf ){
  6260         -      rc = clearDatabasePage(pBt, get4byte(pCell), pPage, 1, pnChange);
         6259  +      rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
  6261   6260         if( rc ) goto cleardatabasepage_out;
  6262   6261       }
  6263   6262       rc = clearCell(pPage, pCell);
  6264   6263       if( rc ) goto cleardatabasepage_out;
  6265   6264     }
  6266   6265     if( !pPage->leaf ){
  6267         -    rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), pPage, 1, pnChange);
         6266  +    rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), 1, pnChange);
  6268   6267       if( rc ) goto cleardatabasepage_out;
  6269   6268     }else if( pnChange ){
  6270   6269       assert( pPage->intKey );
  6271   6270       *pnChange += pPage->nCell;
  6272   6271     }
  6273   6272     if( freePageFlag ){
  6274   6273       rc = freePage(pPage);
................................................................................
  6302   6301     if( p->inTrans!=TRANS_WRITE ){
  6303   6302       rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
  6304   6303     }else if( (rc = checkReadLocks(p, iTable, 0, 1))!=SQLITE_OK ){
  6305   6304       /* nothing to do */
  6306   6305     }else if( SQLITE_OK!=(rc = saveAllCursors(pBt, iTable, 0)) ){
  6307   6306       /* nothing to do */
  6308   6307     }else{
  6309         -    rc = clearDatabasePage(pBt, (Pgno)iTable, 0, 0, pnChange);
         6308  +    rc = clearDatabasePage(pBt, (Pgno)iTable, 0, pnChange);
  6310   6309     }
  6311   6310     sqlite3BtreeLeave(p);
  6312   6311     return rc;
  6313   6312   }
  6314   6313   
  6315   6314   /*
  6316   6315   ** Erase all information in a table and add the root of the table to
................................................................................
  6748   6747   **      7.  Verify that the depth of all children is the same.
  6749   6748   **      8.  Make sure this page is at least 33% full or else it is
  6750   6749   **          the root of the tree.
  6751   6750   */
  6752   6751   static int checkTreePage(
  6753   6752     IntegrityCk *pCheck,  /* Context for the sanity check */
  6754   6753     int iPage,            /* Page number of the page to check */
  6755         -  MemPage *pParent,     /* Parent page */
  6756   6754     char *zParentContext  /* Parent context */
  6757   6755   ){
  6758   6756     MemPage *pPage;
  6759   6757     int i, rc, depth, d2, pgno, cnt;
  6760   6758     int hdr, cellStart;
  6761   6759     int nCell;
  6762   6760     u8 *data;
................................................................................
  6818   6816       if( !pPage->leaf ){
  6819   6817         pgno = get4byte(pCell);
  6820   6818   #ifndef SQLITE_OMIT_AUTOVACUUM
  6821   6819         if( pBt->autoVacuum ){
  6822   6820           checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);
  6823   6821         }
  6824   6822   #endif
  6825         -      d2 = checkTreePage(pCheck,pgno,pPage,zContext);
         6823  +      d2 = checkTreePage(pCheck, pgno, zContext);
  6826   6824         if( i>0 && d2!=depth ){
  6827   6825           checkAppendMsg(pCheck, zContext, "Child page depth differs");
  6828   6826         }
  6829   6827         depth = d2;
  6830   6828       }
  6831   6829     }
  6832   6830     if( !pPage->leaf ){
................................................................................
  6834   6832       sqlite3_snprintf(sizeof(zContext), zContext, 
  6835   6833                        "On page %d at right child: ", iPage);
  6836   6834   #ifndef SQLITE_OMIT_AUTOVACUUM
  6837   6835       if( pBt->autoVacuum ){
  6838   6836         checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0);
  6839   6837       }
  6840   6838   #endif
  6841         -    checkTreePage(pCheck, pgno, pPage, zContext);
         6839  +    checkTreePage(pCheck, pgno, zContext);
  6842   6840     }
  6843   6841    
  6844   6842     /* Check for complete coverage of the page
  6845   6843     */
  6846   6844     data = pPage->aData;
  6847   6845     hdr = pPage->hdrOffset;
  6848   6846     hit = sqlite3PageMalloc( pBt->pageSize );
................................................................................
  6981   6979     for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
  6982   6980       if( aRoot[i]==0 ) continue;
  6983   6981   #ifndef SQLITE_OMIT_AUTOVACUUM
  6984   6982       if( pBt->autoVacuum && aRoot[i]>1 ){
  6985   6983         checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0);
  6986   6984       }
  6987   6985   #endif
  6988         -    checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ");
         6986  +    checkTreePage(&sCheck, aRoot[i], "List of tree roots: ");
  6989   6987     }
  6990   6988   
  6991   6989     /* Make sure every page in the file is referenced
  6992   6990     */
  6993   6991     for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){
  6994   6992   #ifdef SQLITE_OMIT_AUTOVACUUM
  6995   6993       if( sCheck.anRef[i]==0 ){

Changes to src/date.c.

    12     12   ** This file contains the C functions that implement date and time
    13     13   ** functions for SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: date.c,v 1.93 2008/11/17 19:18:55 danielk1977 Exp $
           19  +** $Id: date.c,v 1.94 2008/11/19 09:05:27 danielk1977 Exp $
    20     20   **
    21     21   ** SQLite processes all times and dates as Julian Day numbers.  The
    22     22   ** dates and times are stored as the number of days since noon
    23     23   ** in Greenwich on November 24, 4714 B.C. according to the Gregorian
    24     24   ** calendar system. 
    25     25   **
    26     26   ** 1970-01-01 00:00:00 is JD 2440587.5
................................................................................
   964    964   /*
   965    965   ** current_time()
   966    966   **
   967    967   ** This function returns the same value as time('now').
   968    968   */
   969    969   static void ctimeFunc(
   970    970     sqlite3_context *context,
   971         -  int argc,
   972         -  sqlite3_value **argv
          971  +  int NotUsed,
          972  +  sqlite3_value **NotUsed2
   973    973   ){
          974  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   974    975     timeFunc(context, 0, 0);
   975    976   }
   976    977   
   977    978   /*
   978    979   ** current_date()
   979    980   **
   980    981   ** This function returns the same value as date('now').
   981    982   */
   982    983   static void cdateFunc(
   983    984     sqlite3_context *context,
   984         -  int argc,
   985         -  sqlite3_value **argv
          985  +  int NotUsed,
          986  +  sqlite3_value **NotUsed2
   986    987   ){
          988  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   987    989     dateFunc(context, 0, 0);
   988    990   }
   989    991   
   990    992   /*
   991    993   ** current_timestamp()
   992    994   **
   993    995   ** This function returns the same value as datetime('now').
   994    996   */
   995    997   static void ctimestampFunc(
   996    998     sqlite3_context *context,
   997         -  int argc,
   998         -  sqlite3_value **argv
          999  +  int NotUsed,
         1000  +  sqlite3_value **NotUsed2
   999   1001   ){
         1002  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  1000   1003     datetimeFunc(context, 0, 0);
  1001   1004   }
  1002   1005   #endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
  1003   1006   
  1004   1007   #ifdef SQLITE_OMIT_DATETIME_FUNCS
  1005   1008   /*
  1006   1009   ** If the library is compiled to omit the full-scale date and time

Changes to src/delete.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** in order to generate code for DELETE FROM statements.
    14     14   **
    15         -** $Id: delete.c,v 1.186 2008/10/31 10:53:23 danielk1977 Exp $
           15  +** $Id: delete.c,v 1.187 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** Look up every table that is named in pSrc.  If any table is not found,
    21     21   ** add an error message to pParse->zErrMsg and return NULL.  If all tables
    22     22   ** are found, return a pointer to the last table.
................................................................................
   261    261     pTab = sqlite3SrcListLookup(pParse, pTabList);
   262    262     if( pTab==0 )  goto delete_from_cleanup;
   263    263   
   264    264     /* Figure out if we have any triggers and if the table being
   265    265     ** deleted from is a view
   266    266     */
   267    267   #ifndef SQLITE_OMIT_TRIGGER
   268         -  triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0);
          268  +  triggers_exist = sqlite3TriggersExist(pTab, TK_DELETE, 0);
   269    269     isView = pTab->pSelect!=0;
   270    270   #else
   271    271   # define triggers_exist 0
   272    272   # define isView 0
   273    273   #endif
   274    274   #ifdef SQLITE_OMIT_VIEW
   275    275   # undef isView

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.402 2008/11/12 08:07:12 danielk1977 Exp $
           15  +** $Id: expr.c,v 1.403 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Return the 'affinity' of the expression pExpr if any.
    22     22   **
................................................................................
   935    935         testcase( pExpr->op==TK_AGG_COLUMN );
   936    936         pWalker->u.i = 0;
   937    937         return WRC_Abort;
   938    938       default:
   939    939         return WRC_Continue;
   940    940     }
   941    941   }
   942         -static int selectNodeIsConstant(Walker *pWalker, Select *pSelect){
          942  +static int selectNodeIsConstant(Walker *pWalker, Select *NotUsed){
          943  +  UNUSED_PARAMETER(NotUsed);
   943    944     pWalker->u.i = 0;
   944    945     return WRC_Abort;
   945    946   }
   946    947   static int exprIsConst(Expr *p, int initFlag){
   947    948     Walker w;
   948    949     w.u.i = initFlag;
   949    950     w.xExprCallback = exprNodeIsConstant;

Changes to src/func.c.

    12     12   ** This file contains the C functions that implement various SQL
    13     13   ** functions of SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqliteRegisterBuildinFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: func.c,v 1.204 2008/10/28 17:52:39 danielk1977 Exp $
           19  +** $Id: func.c,v 1.205 2008/11/19 09:05:27 danielk1977 Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   #include <ctype.h>
    23     23   #include <stdlib.h>
    24     24   #include <assert.h>
    25     25   #include "vdbeInt.h"
    26     26   
................................................................................
    61     61   }
    62     62   
    63     63   /*
    64     64   ** Return the type of the argument.
    65     65   */
    66     66   static void typeofFunc(
    67     67     sqlite3_context *context,
    68         -  int argc,
           68  +  int NotUsed,
    69     69     sqlite3_value **argv
    70     70   ){
    71     71     const char *z = 0;
           72  +  UNUSED_PARAMETER(NotUsed);
    72     73     switch( sqlite3_value_type(argv[0]) ){
    73     74       case SQLITE_NULL:    z = "null";    break;
    74     75       case SQLITE_INTEGER: z = "integer"; break;
    75     76       case SQLITE_TEXT:    z = "text";    break;
    76     77       case SQLITE_FLOAT:   z = "real";    break;
    77     78       case SQLITE_BLOB:    z = "blob";    break;
    78     79     }
................................................................................
   320    321   }
   321    322   
   322    323   /*
   323    324   ** Implementation of random().  Return a random integer.  
   324    325   */
   325    326   static void randomFunc(
   326    327     sqlite3_context *context,
   327         -  int argc,
   328         -  sqlite3_value **argv
          328  +  int NotUsed,
          329  +  sqlite3_value **NotUsed2
   329    330   ){
   330    331     sqlite_int64 r;
          332  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   331    333     sqlite3_randomness(sizeof(r), &r);
   332    334     if( (r<<1)==0 ) r = 0;  /* Prevent 0x8000.... as the result so that we */
   333    335                             /* can always do abs() of the result */
   334    336     sqlite3_result_int64(context, r);
   335    337   }
   336    338   
   337    339   /*
................................................................................
   359    361   
   360    362   /*
   361    363   ** Implementation of the last_insert_rowid() SQL function.  The return
   362    364   ** value is the same as the sqlite3_last_insert_rowid() API function.
   363    365   */
   364    366   static void last_insert_rowid(
   365    367     sqlite3_context *context, 
   366         -  int arg, 
   367         -  sqlite3_value **argv
          368  +  int NotUsed, 
          369  +  sqlite3_value **NotUsed2
   368    370   ){
   369    371     sqlite3 *db = sqlite3_context_db_handle(context);
          372  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   370    373     sqlite3_result_int64(context, sqlite3_last_insert_rowid(db));
   371    374   }
   372    375   
   373    376   /*
   374    377   ** Implementation of the changes() SQL function.  The return value is the
   375    378   ** same as the sqlite3_changes() API function.
   376    379   */
   377    380   static void changes(
   378    381     sqlite3_context *context,
   379         -  int arg,
   380         -  sqlite3_value **argv
          382  +  int NotUsed,
          383  +  sqlite3_value **NotUsed2
   381    384   ){
   382    385     sqlite3 *db = sqlite3_context_db_handle(context);
          386  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   383    387     sqlite3_result_int(context, sqlite3_changes(db));
   384    388   }
   385    389   
   386    390   /*
   387    391   ** Implementation of the total_changes() SQL function.  The return value is
   388    392   ** the same as the sqlite3_total_changes() API function.
   389    393   */
   390    394   static void total_changes(
   391    395     sqlite3_context *context,
   392         -  int arg,
   393         -  sqlite3_value **argv
          396  +  int NotUsed,
          397  +  sqlite3_value **NotUsed2
   394    398   ){
   395    399     sqlite3 *db = sqlite3_context_db_handle(context);
          400  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   396    401     sqlite3_result_int(context, sqlite3_total_changes(db));
   397    402   }
   398    403   
   399    404   /*
   400    405   ** A structure defining how to do GLOB-style comparisons.
   401    406   */
   402    407   struct compareInfo {
................................................................................
   633    638   /*
   634    639   ** Implementation of the NULLIF(x,y) function.  The result is the first
   635    640   ** argument if the arguments are different.  The result is NULL if the
   636    641   ** arguments are equal to each other.
   637    642   */
   638    643   static void nullifFunc(
   639    644     sqlite3_context *context,
   640         -  int argc,
          645  +  int NotUsed,
   641    646     sqlite3_value **argv
   642    647   ){
   643    648     CollSeq *pColl = sqlite3GetFuncCollSeq(context);
          649  +  UNUSED_PARAMETER(NotUsed);
   644    650     if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){
   645    651       sqlite3_result_value(context, argv[0]);
   646    652     }
   647    653   }
   648    654   
   649    655   /*
   650    656   ** Implementation of the VERSION(*) function.  The result is the version
   651    657   ** of the SQLite library that is running.
   652    658   */
   653    659   static void versionFunc(
   654    660     sqlite3_context *context,
   655         -  int argc,
   656         -  sqlite3_value **argv
          661  +  int NotUsed,
          662  +  sqlite3_value **NotUsed2
   657    663   ){
          664  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   658    665     sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC);
   659    666   }
   660    667   
   661    668   /* Array for converting from half-bytes (nybbles) into ASCII hex
   662    669   ** digits. */
   663    670   static const char hexdigits[] = {
   664    671     '0', '1', '2', '3', '4', '5', '6', '7',
................................................................................
  1111   1118     p = sqlite3_aggregate_context(context, 0);
  1112   1119     sqlite3_result_int64(context, p ? p->n : 0);
  1113   1120   }
  1114   1121   
  1115   1122   /*
  1116   1123   ** Routines to implement min() and max() aggregate functions.
  1117   1124   */
  1118         -static void minmaxStep(sqlite3_context *context, int argc, sqlite3_value **argv){
         1125  +static void minmaxStep(
         1126  +  sqlite3_context *context, 
         1127  +  int NotUsed, 
         1128  +  sqlite3_value **argv
         1129  +){
  1119   1130     Mem *pArg  = (Mem *)argv[0];
  1120   1131     Mem *pBest;
         1132  +  UNUSED_PARAMETER(NotUsed);
  1121   1133   
  1122   1134     if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
  1123   1135     pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest));
  1124   1136     if( !pBest ) return;
  1125   1137   
  1126   1138     if( pBest->flags ){
  1127   1139       int max;

Changes to src/insert.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle INSERT statements in SQLite.
    14     14   **
    15         -** $Id: insert.c,v 1.252 2008/11/17 19:18:55 danielk1977 Exp $
           15  +** $Id: insert.c,v 1.253 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** Set P4 of the most recently inserted opcode to a column affinity
    21     21   ** string for index pIdx. A column affinity string has one character
    22     22   ** for each column in the table, according to the affinity of the column:
................................................................................
   426    426       goto insert_cleanup;
   427    427     }
   428    428   
   429    429     /* Figure out if we have any triggers and if the table being
   430    430     ** inserted into is a view
   431    431     */
   432    432   #ifndef SQLITE_OMIT_TRIGGER
   433         -  triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0);
          433  +  triggers_exist = sqlite3TriggersExist(pTab, TK_INSERT, 0);
   434    434     isView = pTab->pSelect!=0;
   435    435   #else
   436    436   # define triggers_exist 0
   437    437   # define isView 0
   438    438   #endif
   439    439   #ifdef SQLITE_OMIT_VIEW
   440    440   # undef isView
................................................................................
   932    932         sqlite3CompleteInsertion(
   933    933             pParse,
   934    934             pTab,
   935    935             baseCur,
   936    936             regIns,
   937    937             aRegIdx,
   938    938             0,
   939         -          0,
   940    939             (triggers_exist & TRIGGER_AFTER)!=0 ? newIdx : -1,
   941    940             appendFlag
   942    941          );
   943    942       }
   944    943     }
   945    944   
   946    945     /* Update the count of rows that are inserted
................................................................................
  1324   1323   */
  1325   1324   void sqlite3CompleteInsertion(
  1326   1325     Parse *pParse,      /* The parser context */
  1327   1326     Table *pTab,        /* the table into which we are inserting */
  1328   1327     int baseCur,        /* Index of a read/write cursor pointing at pTab */
  1329   1328     int regRowid,       /* Range of content */
  1330   1329     int *aRegIdx,       /* Register used by each index.  0 for unused indices */
  1331         -  int rowidChng,      /* True if the record number will change */
  1332   1330     int isUpdate,       /* True for UPDATE, False for INSERT */
  1333   1331     int newIdx,         /* Index of NEW table for triggers.  -1 if none */
  1334   1332     int appendBias      /* True if this is likely to be an append */
  1335   1333   ){
  1336   1334     int i;
  1337   1335     Vdbe *v;
  1338   1336     int nIdx;

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.513 2008/11/19 01:20:26 drh Exp $
           17  +** $Id: main.c,v 1.514 2008/11/19 09:05:27 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <ctype.h>
    21     21   
    22     22   #ifdef SQLITE_ENABLE_FTS3
    23     23   # include "fts3.h"
    24     24   #endif
................................................................................
   511    511   static int nocaseCollatingFunc(
   512    512     void *NotUsed,
   513    513     int nKey1, const void *pKey1,
   514    514     int nKey2, const void *pKey2
   515    515   ){
   516    516     int r = sqlite3StrNICmp(
   517    517         (const char *)pKey1, (const char *)pKey2, (nKey1<nKey2)?nKey1:nKey2);
          518  +  UNUSED_PARAMETER(NotUsed);
   518    519     if( 0==r ){
   519    520       r = nKey1-nKey2;
   520    521     }
   521    522     return r;
   522    523   }
   523    524   
   524    525   /*

Changes to src/malloc.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** Memory allocation functions used throughout sqlite.
    14     14   **
    15         -** $Id: malloc.c,v 1.47 2008/11/18 07:27:24 danielk1977 Exp $
           15  +** $Id: malloc.c,v 1.48 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <stdarg.h>
    19     19   #include <ctype.h>
    20     20   
    21     21   /*
    22     22   ** This routine runs when the memory allocator sees that the
    23     23   ** total memory allocation is about to exceed the soft heap
    24     24   ** limit.
    25     25   */
    26     26   static void softHeapLimitEnforcer(
    27     27     void *NotUsed, 
    28         -  sqlite3_int64 inUse,
           28  +  sqlite3_int64 NotUsed2,
    29     29     int allocSize
    30     30   ){
           31  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
    31     32     sqlite3_release_memory(allocSize);
    32     33   }
    33     34   
    34     35   /*
    35     36   ** Set the soft heap-size limit for the library. Passing a zero or 
    36     37   ** negative value indicates no limit.
    37     38   */
................................................................................
    65     66     int nRet = 0;
    66     67   #if 0
    67     68     nRet += sqlite3VdbeReleaseMemory(n);
    68     69   #endif
    69     70     nRet += sqlite3PcacheReleaseMemory(n-nRet);
    70     71     return nRet;
    71     72   #else
           73  +  UNUSED_PARAMETER(n);
    72     74     return SQLITE_OK;
    73     75   #endif
    74     76   }
    75     77   
    76     78   /*
    77     79   ** State information local to the memory allocation subsystem.
    78     80   */

Changes to src/mem1.c.

    13     13   ** This file contains low-level memory allocation drivers for when
    14     14   ** SQLite will use the standard C-library malloc/realloc/free interface
    15     15   ** to obtain the memory it needs.
    16     16   **
    17     17   ** This file contains implementations of the low-level memory allocation
    18     18   ** routines specified in the sqlite3_mem_methods object.
    19     19   **
    20         -** $Id: mem1.c,v 1.27 2008/10/28 18:58:20 drh Exp $
           20  +** $Id: mem1.c,v 1.28 2008/11/19 09:05:27 danielk1977 Exp $
    21     21   */
    22     22   #include "sqliteInt.h"
    23     23   
    24     24   /*
    25     25   ** This version of the memory allocator is the default.  It is
    26     26   ** used when no other memory allocator is specified using compile-time
    27     27   ** macros.
................................................................................
   106    106     return (n+7) & ~7;
   107    107   }
   108    108   
   109    109   /*
   110    110   ** Initialize this module.
   111    111   */
   112    112   static int sqlite3MemInit(void *NotUsed){
          113  +  UNUSED_PARAMETER(NotUsed);
   113    114     return SQLITE_OK;
   114    115   }
   115    116   
   116    117   /*
   117    118   ** Deinitialize this module.
   118    119   */
   119    120   static void sqlite3MemShutdown(void *NotUsed){
          121  +  UNUSED_PARAMETER(NotUsed);
   120    122     return;
   121    123   }
   122    124   
   123    125   /*
   124    126   ** This routine is the only routine in this file with external linkage.
   125    127   **
   126    128   ** Populate the low-level memory allocation function pointers in

Changes to src/memjournal.c.

    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains code use to implement an in-memory rollback journal.
    14     14   ** The in-memory rollback journal is used to journal transactions for
    15     15   ** ":memory:" databases and when the journal_mode=MEMORY pragma is used.
    16     16   **
    17         -** @(#) $Id: memjournal.c,v 1.3 2008/11/12 15:24:28 drh Exp $
           17  +** @(#) $Id: memjournal.c,v 1.4 2008/11/19 09:05:27 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   
    21     21   /* Forward references to internal structures */
    22     22   typedef struct MemJournal MemJournal;
    23     23   typedef struct FilePoint FilePoint;
    24     24   typedef struct FileChunk FileChunk;
................................................................................
   180    180     return SQLITE_OK;
   181    181   }
   182    182   
   183    183   
   184    184   /*
   185    185   ** Sync the file.
   186    186   */
   187         -static int memjrnlSync(sqlite3_file *pJfd, int flags){
          187  +static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){
          188  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   188    189     return SQLITE_OK;
   189    190   }
   190    191   
   191    192   /*
   192    193   ** Query the size of the file in bytes.
   193    194   */
   194    195   static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){

Changes to src/os_unix.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains code that is specific to Unix systems.
    14     14   **
    15         -** $Id: os_unix.c,v 1.211 2008/11/17 19:18:55 danielk1977 Exp $
           15  +** $Id: os_unix.c,v 1.212 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #if SQLITE_OS_UNIX              /* This file is used on unix only */
    19     19   
    20     20   /*
    21     21   ** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several
    22     22   ** alternative locking implementations are provided:
................................................................................
   766    766   ** locking style based on its value.  These values and assignments are 
   767    767   ** based on Darwin/OSX behavior and have not been thoroughly tested on 
   768    768   ** other systems.
   769    769   **
   770    770   ** If SQLITE_ENABLE_LOCKING_STYLE is not defined, this function always
   771    771   ** returns LOCKING_STYLE_POSIX.
   772    772   */
          773  +#if SQLITE_ENABLE_LOCKING_STYLE
   773    774   static int detectLockingStyle(
   774    775     sqlite3_vfs *pVfs,
   775    776     const char *filePath, 
   776    777     int fd
   777    778   ){
   778         -#if SQLITE_ENABLE_LOCKING_STYLE
   779    779   #if defined(__RTP__) || defined(_WRS_KERNEL)
   780    780     if( !filePath ){
   781    781       return LOCKING_STYLE_NONE;
   782    782     }
   783    783     if( pVfs->pAppData ){
   784    784       return SQLITE_PTR_TO_INT(pVfs->pAppData);
   785    785     }
................................................................................
   822    822           return aMap[i].eLockingStyle;
   823    823         }
   824    824       }
   825    825     }
   826    826   
   827    827     /* Default case. Handles, amongst others, "nfs". */
   828    828     return testLockingStyle(fd);  
   829         -#endif
   830         -#endif
          829  +#endif /* if defined(__RTP__) || defined(_WRS_KERNEL) */
   831    830     return LOCKING_STYLE_POSIX;
   832    831   }
          832  +#else
          833  +  #define detectLockingStyle(x,y,z) LOCKING_STYLE_POSIX
          834  +#endif /* ifdef SQLITE_ENABLE_LOCKING_STYLE */
   833    835   
   834    836   /*
   835    837   ** Given a file descriptor, locate lockInfo and openCnt structures that
   836    838   ** describes that file descriptor.  Create new ones if necessary.  The
   837    839   ** return values might be uninitialized if an error occurs.
   838    840   **
   839    841   ** Return an appropriate error code.

Changes to src/pcache1.c.

    12     12   **
    13     13   ** This file implements the default page cache implementation (the
    14     14   ** sqlite3_pcache interface). It also contains part of the implementation
    15     15   ** of the SQLITE_CONFIG_PAGECACHE and sqlite3_release_memory() features.
    16     16   ** If the default page cache implementation is overriden, then neither of
    17     17   ** these two features are available.
    18     18   **
    19         -** @(#) $Id: pcache1.c,v 1.2 2008/11/15 11:22:45 danielk1977 Exp $
           19  +** @(#) $Id: pcache1.c,v 1.3 2008/11/19 09:05:27 danielk1977 Exp $
    20     20   */
    21     21   
    22     22   #include "sqliteInt.h"
    23     23   
    24     24   typedef struct PCache1 PCache1;
    25     25   typedef struct PgHdr1 PgHdr1;
    26     26   typedef struct PgFreeslot PgFreeslot;
................................................................................
   376    376   
   377    377   /******************************************************************************/
   378    378   /******** sqlite3_pcache Methods **********************************************/
   379    379   
   380    380   /*
   381    381   ** Implementation of the sqlite3_pcache.xInit method.
   382    382   */
   383         -static int pcache1Init(void *pUnused){
          383  +static int pcache1Init(void *NotUsed){
          384  +  UNUSED_PARAMETER(NotUsed);
   384    385     memset(&pcache1, 0, sizeof(pcache1));
   385    386     if( sqlite3GlobalConfig.bCoreMutex ){
   386    387       pcache1.mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_LRU);
   387    388     }
   388    389     return SQLITE_OK;
   389    390   }
   390    391   
   391    392   /*
   392    393   ** Implementation of the sqlite3_pcache.xShutdown method.
   393    394   */
   394         -static void pcache1Shutdown(void *pUnused){
          395  +static void pcache1Shutdown(void *NotUsed){
          396  +  UNUSED_PARAMETER(NotUsed);
   395    397     /* no-op */
   396    398   }
   397    399   
   398    400   /*
   399    401   ** Implementation of the sqlite3_pcache.xCreate method.
   400    402   **
   401    403   ** Allocate a new cache.

Changes to src/prepare.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains the implementation of the sqlite3_prepare()
    13     13   ** interface, and routines that contribute to loading the database schema
    14     14   ** from disk.
    15     15   **
    16         -** $Id: prepare.c,v 1.99 2008/11/17 19:18:55 danielk1977 Exp $
           16  +** $Id: prepare.c,v 1.100 2008/11/19 09:05:27 danielk1977 Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include <ctype.h>
    20     20   
    21     21   /*
    22     22   ** Fill the InitData structure with an error message that indicates
    23     23   ** that the database is corrupt.
................................................................................
    48     48   ** Each callback contains the following information:
    49     49   **
    50     50   **     argv[0] = name of thing being created
    51     51   **     argv[1] = root page number for table or index. 0 for trigger or view.
    52     52   **     argv[2] = SQL text for the CREATE statement.
    53     53   **
    54     54   */
    55         -int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
           55  +int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
    56     56     InitData *pData = (InitData*)pInit;
    57     57     sqlite3 *db = pData->db;
    58     58     int iDb = pData->iDb;
    59     59   
           60  +  UNUSED_PARAMETER(NotUsed);
    60     61     assert( sqlite3_mutex_held(db->mutex) );
    61     62     DbClearProperty(db, iDb, DB_Empty);
    62     63     if( db->mallocFailed ){
    63     64       corruptSchema(pData, argv[0], 0);
    64     65       return SQLITE_NOMEM;
    65     66     }
    66     67   

Changes to src/select.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle SELECT statements in SQLite.
    14     14   **
    15         -** $Id: select.c,v 1.485 2008/11/17 19:18:55 danielk1977 Exp $
           15  +** $Id: select.c,v 1.486 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   
    20     20   /*
    21     21   ** Delete all the content of a Select structure but do not deallocate
    22     22   ** the select structure itself.
................................................................................
  2917   2917   ** a min()/max() query if:
  2918   2918   **
  2919   2919   **   1. There is a single object in the FROM clause.
  2920   2920   **
  2921   2921   **   2. There is a single expression in the result set, and it is
  2922   2922   **      either min(x) or max(x), where x is a column reference.
  2923   2923   */
  2924         -static int minMaxQuery(Parse *pParse, Select *p){
         2924  +static int minMaxQuery(Select *p){
  2925   2925     Expr *pExpr;
  2926   2926     ExprList *pEList = p->pEList;
  2927   2927   
  2928   2928     if( pEList->nExpr!=1 ) return WHERE_ORDERBY_NORMAL;
  2929   2929     pExpr = pEList->a[0].pExpr;
  2930   2930     pEList = pExpr->pList;
  2931   2931     if( pExpr->op!=TK_AGG_FUNCTION || pEList==0 || pEList->nExpr!=1 ) return 0;
................................................................................
  3217   3217   **
  3218   3218   ** When this routine is the Walker.xExprCallback then expression trees
  3219   3219   ** are walked without any actions being taken at each node.  Presumably,
  3220   3220   ** when this routine is used for Walker.xExprCallback then 
  3221   3221   ** Walker.xSelectCallback is set to do something useful for every 
  3222   3222   ** subquery in the parser tree.
  3223   3223   */
  3224         -static int exprWalkNoop(Walker *pWalker, Expr *pExpr){
         3224  +static int exprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
         3225  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  3225   3226     return WRC_Continue;
  3226   3227   }
  3227   3228   
  3228   3229   /*
  3229   3230   ** This routine "expands" a SELECT statement and all of its subqueries.
  3230   3231   ** For additional information on what it means to "expand" a SELECT
  3231   3232   ** statement, see the comment on the selectExpand worker callback above.
................................................................................
  4008   4009         **     for x.
  4009   4010         **
  4010   4011         **   + The optimizer code in where.c (the thing that decides which
  4011   4012         **     index or indices to use) should place a different priority on 
  4012   4013         **     satisfying the 'ORDER BY' clause than it does in other cases.
  4013   4014         **     Refer to code and comments in where.c for details.
  4014   4015         */
  4015         -      flag = minMaxQuery(pParse, p);
         4016  +      flag = minMaxQuery(p);
  4016   4017         if( flag ){
  4017   4018           pDel = pMinMax = sqlite3ExprListDup(db, p->pEList->a[0].pExpr->pList);
  4018   4019           if( pMinMax && !db->mallocFailed ){
  4019   4020             pMinMax->a[0].sortOrder = flag!=WHERE_ORDERBY_MIN;
  4020   4021             pMinMax->a[0].pExpr->op = TK_COLUMN;
  4021   4022           }
  4022   4023         }

Changes to src/sqliteInt.h.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Internal interface definitions for SQLite.
    13     13   **
    14         -** @(#) $Id: sqliteInt.h,v 1.796 2008/11/18 07:27:24 danielk1977 Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.797 2008/11/19 09:05:27 danielk1977 Exp $
    15     15   */
    16     16   #ifndef _SQLITEINT_H_
    17     17   #define _SQLITEINT_H_
    18     18   
    19     19   /*
    20     20   ** Include the configuration header output by 'configure' if we're using the
    21     21   ** autoconf-based build
................................................................................
   474    474     void *sqlite3_wsd_find(void *K, int L);
   475    475   #else
   476    476     #define SQLITE_WSD 
   477    477     #define GLOBAL(t,v) v
   478    478     #define sqlite3GlobalConfig sqlite3Config
   479    479   #endif
   480    480   
          481  +#define UNUSED_PARAMETER(x) (void)(x)
          482  +#define UNUSED_PARAMETER2(x,y) (void)(x),(void)(y)
          483  +
   481    484   /*
   482    485   ** Forward references to structures
   483    486   */
   484    487   typedef struct AggInfo AggInfo;
   485    488   typedef struct AuthContext AuthContext;
   486    489   typedef struct Bitvec Bitvec;
   487    490   typedef struct CollSeq CollSeq;
................................................................................
  2219   2222   int sqlite3ExprIsInteger(Expr*, int*);
  2220   2223   int sqlite3IsRowid(const char*);
  2221   2224   void sqlite3GenerateRowDelete(Parse*, Table*, int, int, int);
  2222   2225   void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int*);
  2223   2226   int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int);
  2224   2227   void sqlite3GenerateConstraintChecks(Parse*,Table*,int,int,
  2225   2228                                        int*,int,int,int,int);
  2226         -void sqlite3CompleteInsertion(Parse*, Table*, int, int, int*,int,int,int,int);
         2229  +void sqlite3CompleteInsertion(Parse*, Table*, int, int, int*, int, int, int);
  2227   2230   int sqlite3OpenTableAndIndices(Parse*, Table*, int, int);
  2228   2231   void sqlite3BeginWriteOperation(Parse*, int, int);
  2229   2232   Expr *sqlite3ExprDup(sqlite3*,Expr*);
  2230   2233   void sqlite3TokenCopy(sqlite3*,Token*, Token*);
  2231   2234   ExprList *sqlite3ExprListDup(sqlite3*,ExprList*);
  2232   2235   SrcList *sqlite3SrcListDup(sqlite3*,SrcList*);
  2233   2236   IdList *sqlite3IdListDup(sqlite3*,IdList*);
................................................................................
  2255   2258   
  2256   2259   #ifndef SQLITE_OMIT_TRIGGER
  2257   2260     void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*,
  2258   2261                              Expr*,int, int);
  2259   2262     void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
  2260   2263     void sqlite3DropTrigger(Parse*, SrcList*, int);
  2261   2264     void sqlite3DropTriggerPtr(Parse*, Trigger*);
  2262         -  int sqlite3TriggersExist(Parse*, Table*, int, ExprList*);
         2265  +  int sqlite3TriggersExist(Table*, int, ExprList*);
  2263   2266     int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int, 
  2264   2267                              int, int, u32*, u32*);
  2265   2268     void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
  2266   2269     void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
  2267   2270     TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*);
  2268   2271     TriggerStep *sqlite3TriggerInsertStep(sqlite3*,Token*, IdList*,
  2269   2272                                           ExprList*,Select*,int);
  2270   2273     TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, int);
  2271   2274     TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*);
  2272   2275     void sqlite3DeleteTrigger(sqlite3*, Trigger*);
  2273   2276     void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
  2274   2277   #else
  2275         -# define sqlite3TriggersExist(A,B,C,D,E,F) 0
         2278  +# define sqlite3TriggersExist(B,C,D,E,F) 0
  2276   2279   # define sqlite3DeleteTrigger(A,B)
  2277   2280   # define sqlite3DropTriggerPtr(A,B)
  2278   2281   # define sqlite3UnlinkAndDeleteTrigger(A,B,C)
  2279   2282   # define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I,J,K) 0
  2280   2283   #endif
  2281   2284   
  2282   2285   int sqlite3JoinType(Parse*, Token*, Token*, Token*);

Changes to src/trigger.c.

     6      6   **    May you do good and not evil.
     7      7   **    May you find forgiveness for yourself and forgive others.
     8      8   **    May you share freely, never taking more than you give.
     9      9   **
    10     10   *************************************************************************
    11     11   **
    12     12   **
    13         -** $Id: trigger.c,v 1.129 2008/08/20 16:35:10 drh Exp $
           13  +** $Id: trigger.c,v 1.130 2008/11/19 09:05:27 danielk1977 Exp $
    14     14   */
    15     15   #include "sqliteInt.h"
    16     16   
    17     17   #ifndef SQLITE_OMIT_TRIGGER
    18     18   /*
    19     19   ** Delete a linked list of TriggerStep structures.
    20     20   */
................................................................................
   599    599   ** that are being updated.  Triggers only match if the ON clause of the
   600    600   ** trigger definition overlaps the set of columns being updated.
   601    601   **
   602    602   ** The returned bit vector is some combination of TRIGGER_BEFORE and
   603    603   ** TRIGGER_AFTER.
   604    604   */
   605    605   int sqlite3TriggersExist(
   606         -  Parse *pParse,          /* Used to check for recursive triggers */
   607    606     Table *pTab,            /* The table the contains the triggers */
   608    607     int op,                 /* one of TK_DELETE, TK_INSERT, TK_UPDATE */
   609    608     ExprList *pChanges      /* Columns that change in an UPDATE statement */
   610    609   ){
   611    610     Trigger *pTrigger;
   612    611     int mask = 0;
   613    612   

Changes to src/update.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle UPDATE statements.
    14     14   **
    15         -** $Id: update.c,v 1.186 2008/10/31 10:53:23 danielk1977 Exp $
           15  +** $Id: update.c,v 1.187 2008/11/19 09:05:27 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   #ifndef SQLITE_OMIT_VIRTUALTABLE
    20     20   /* Forward declaration */
    21     21   static void updateVirtualTable(
    22     22     Parse *pParse,       /* The parsing context */
................................................................................
   138    138     if( pTab==0 ) goto update_cleanup;
   139    139     iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
   140    140   
   141    141     /* Figure out if we have any triggers and if the table being
   142    142     ** updated is a view
   143    143     */
   144    144   #ifndef SQLITE_OMIT_TRIGGER
   145         -  triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges);
          145  +  triggers_exist = sqlite3TriggersExist(pTab, TK_UPDATE, pChanges);
   146    146     isView = pTab->pSelect!=0;
   147    147   #else
   148    148   # define triggers_exist 0
   149    149   # define isView 0
   150    150   #endif
   151    151   #ifdef SQLITE_OMIT_VIEW
   152    152   # undef isView
................................................................................
   521    521         sqlite3VdbeAddOp2(v, OP_Delete, iCur, 0);
   522    522       }
   523    523       sqlite3VdbeJumpHere(v, j1);
   524    524   
   525    525       /* Create the new index entries and the new record.
   526    526       */
   527    527       sqlite3CompleteInsertion(pParse, pTab, iCur, regNewRowid, 
   528         -                             aRegIdx, chngRowid, 1, -1, 0);
          528  +                             aRegIdx, 1, -1, 0);
   529    529     }
   530    530   
   531    531     /* Increment the row counter 
   532    532     */
   533    533     if( db->flags & SQLITE_CountRows && !pParse->trigStack){
   534    534       sqlite3VdbeAddOp2(v, OP_AddImm, regRowCount, 1);
   535    535     }

Changes to src/vdbeapi.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains code use to implement APIs that are part of the
    14     14   ** VDBE.
    15     15   **
    16         -** $Id: vdbeapi.c,v 1.148 2008/11/05 16:37:35 drh Exp $
           16  +** $Id: vdbeapi.c,v 1.149 2008/11/19 09:05:27 danielk1977 Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "vdbeInt.h"
    20     20   
    21     21   #if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
    22     22   /*
    23     23   ** The following structure contains pointers to the end points of a
................................................................................
   597    597   ** wrong context.  The sqlite3_overload_function() API might construct
   598    598   ** SQL function that use this routine so that the functions will exist
   599    599   ** for name resolution but are actually overloaded by the xFindFunction
   600    600   ** method of virtual tables.
   601    601   */
   602    602   void sqlite3InvalidFunction(
   603    603     sqlite3_context *context,  /* The function calling context */
   604         -  int argc,                  /* Number of arguments to the function */
   605         -  sqlite3_value **argv       /* Value of each argument */
          604  +  int NotUsed,               /* Number of arguments to the function */
          605  +  sqlite3_value **NotUsed2   /* Value of each argument */
   606    606   ){
   607    607     const char *zName = context->pFunc->zName;
   608    608     char *zErr;
          609  +  UNUSED_PARAMETER2(NotUsed, NotUsed2);
   609    610     zErr = sqlite3MPrintf(0,
   610    611         "unable to use function %s in the requested context", zName);
   611    612     sqlite3_result_error(context, zErr, -1);
   612    613     sqlite3_free(zErr);
   613    614   }
   614    615   
   615    616   /*