/ Check-in [d1abe8a1]
Login

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

Overview
Comment:Fix some compiler warnings that show up when building the amalgamation only. (CVS 5927)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d1abe8a1c9a990b02c71d6c249436381c9fde443
User & Date: danielk1977 2008-11-19 16:52:44
Context
2008-11-19
18:30
Update the SECURE_DELETE code to track the latest changes in the pager. (CVS 5928) check-in: e058f509 user: drh tags: trunk
16:52
Fix some compiler warnings that show up when building the amalgamation only. (CVS 5927) check-in: d1abe8a1 user: danielk1977 tags: trunk
14:35
Fix a few more compiler warnings. (CVS 5926) check-in: 70b2f683 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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.45 2008/11/19 09:05:27 danielk1977 Exp $
           14  +** @(#) $Id: analyze.c,v 1.46 2008/11/19 16:52:44 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.
................................................................................
   359    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    365   
   366         -  UNUSED_PARAMETER(NotUsed);
   367         -
   368    366     assert( argc==2 );
          367  +  UNUSED_PARAMETER2(NotUsed, argc);
          368  +
   369    369     if( argv==0 || argv[0]==0 || argv[1]==0 ){
   370    370       return 0;
   371    371     }
   372    372     pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase);
   373    373     if( pIndex==0 ){
   374    374       return 0;
   375    375     }

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.403 2008/11/19 09:05:27 danielk1977 Exp $
           15  +** $Id: expr.c,v 1.404 2008/11/19 16:52:44 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   **
................................................................................
  1456   1456   **
  1457   1457   ** The z[] string will probably not be zero-terminated.  But the 
  1458   1458   ** z[n] character is guaranteed to be something that does not look
  1459   1459   ** like the continuation of the number.
  1460   1460   */
  1461   1461   static void codeReal(Vdbe *v, const char *z, int n, int negateFlag, int iMem){
  1462   1462     assert( z || v==0 || sqlite3VdbeDb(v)->mallocFailed );
         1463  +  assert( !z || !isdigit(z[n]) );
         1464  +  UNUSED_PARAMETER(n);
  1463   1465     if( z ){
  1464   1466       double value;
  1465   1467       char *zV;
  1466         -    assert( !isdigit(z[n]) );
  1467   1468       sqlite3AtoF(z, &value);
  1468   1469       if( sqlite3IsNaN(value) ){
  1469   1470         sqlite3VdbeAddOp2(v, OP_Null, 0, iMem);
  1470   1471       }else{
  1471   1472         if( negateFlag ) value = -value;
  1472   1473         zV = dup8bytes(v, (char*)&value);
  1473   1474         sqlite3VdbeAddOp4(v, OP_Real, 0, iMem, 0, zV, P4_REAL);

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.205 2008/11/19 09:05:27 danielk1977 Exp $
           19  +** $Id: func.c,v 1.206 2008/11/19 16:52:44 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   
................................................................................
    88     88     sqlite3_context *context,
    89     89     int argc,
    90     90     sqlite3_value **argv
    91     91   ){
    92     92     int len;
    93     93   
    94     94     assert( argc==1 );
           95  +  UNUSED_PARAMETER(argc);
    95     96     switch( sqlite3_value_type(argv[0]) ){
    96     97       case SQLITE_BLOB:
    97     98       case SQLITE_INTEGER:
    98     99       case SQLITE_FLOAT: {
    99    100         sqlite3_result_int(context, sqlite3_value_bytes(argv[0]));
   100    101         break;
   101    102       }
................................................................................
   118    119   }
   119    120   
   120    121   /*
   121    122   ** Implementation of the abs() function
   122    123   */
   123    124   static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
   124    125     assert( argc==1 );
          126  +  UNUSED_PARAMETER(argc);
   125    127     switch( sqlite3_value_type(argv[0]) ){
   126    128       case SQLITE_INTEGER: {
   127    129         i64 iVal = sqlite3_value_int64(argv[0]);
   128    130         if( iVal<0 ){
   129    131           if( (iVal<<1)==0 ){
   130    132             sqlite3_result_error(context, "integer overflow", -1);
   131    133             return;
................................................................................
   344    346     sqlite3_context *context,
   345    347     int argc,
   346    348     sqlite3_value **argv
   347    349   ){
   348    350     int n;
   349    351     unsigned char *p;
   350    352     assert( argc==1 );
          353  +  UNUSED_PARAMETER(argc);
   351    354     n = sqlite3_value_int(argv[0]);
   352    355     if( n<1 ){
   353    356       n = 1;
   354    357     }
   355    358     p = contextMalloc(context, n);
   356    359     if( p ){
   357    360       sqlite3_randomness(n, p);
................................................................................
   750    753     int argc,
   751    754     sqlite3_value **argv
   752    755   ){
   753    756     int i, n;
   754    757     const unsigned char *pBlob;
   755    758     char *zHex, *z;
   756    759     assert( argc==1 );
          760  +  UNUSED_PARAMETER(argc);
   757    761     pBlob = sqlite3_value_blob(argv[0]);
   758    762     n = sqlite3_value_bytes(argv[0]);
   759    763     assert( pBlob==sqlite3_value_blob(argv[0]) );  /* No encoding change */
   760    764     z = zHex = contextMalloc(context, ((i64)n)*2 + 1);
   761    765     if( zHex ){
   762    766       for(i=0; i<n; i++, pBlob++){
   763    767         unsigned char c = *pBlob;
................................................................................
   775    779   static void zeroblobFunc(
   776    780     sqlite3_context *context,
   777    781     int argc,
   778    782     sqlite3_value **argv
   779    783   ){
   780    784     i64 n;
   781    785     assert( argc==1 );
          786  +  UNUSED_PARAMETER(argc);
   782    787     n = sqlite3_value_int64(argv[0]);
   783    788     if( n>SQLITE_MAX_LENGTH ){
   784    789       sqlite3_result_error_toobig(context);
   785    790     }else{
   786    791       sqlite3_result_zeroblob(context, n);
   787    792     }
   788    793   }
................................................................................
   806    811     int nPattern;            /* Size of zPattern */
   807    812     int nRep;                /* Size of zRep */
   808    813     i64 nOut;                /* Maximum size of zOut */
   809    814     int loopLimit;           /* Last zStr[] that might match zPattern[] */
   810    815     int i, j;                /* Loop counters */
   811    816   
   812    817     assert( argc==3 );
          818  +  UNUSED_PARAMETER(argc);
   813    819     zStr = sqlite3_value_text(argv[0]);
   814    820     if( zStr==0 ) return;
   815    821     nStr = sqlite3_value_bytes(argv[0]);
   816    822     assert( zStr==sqlite3_value_text(argv[0]) );  /* No encoding change */
   817    823     zPattern = sqlite3_value_text(argv[1]);
   818    824     if( zPattern==0 || zPattern[0]==0 ) return;
   819    825     nPattern = sqlite3_value_bytes(argv[1]);
................................................................................
  1043   1049   ** value.  TOTAL never fails, but SUM might through an exception if
  1044   1050   ** it overflows an integer.
  1045   1051   */
  1046   1052   static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){
  1047   1053     SumCtx *p;
  1048   1054     int type;
  1049   1055     assert( argc==1 );
         1056  +  UNUSED_PARAMETER(argc);
  1050   1057     p = sqlite3_aggregate_context(context, sizeof(*p));
  1051   1058     type = sqlite3_value_numeric_type(argv[0]);
  1052   1059     if( p && type!=SQLITE_NULL ){
  1053   1060       p->cnt++;
  1054   1061       if( type==SQLITE_INTEGER ){
  1055   1062         i64 v = sqlite3_value_int64(argv[0]);
  1056   1063         p->rSum += v;

Changes to src/mem3.c.

    19     19   ** implementations. Once sqlite3_initialize() has been called,
    20     20   ** the amount of memory available to SQLite is fixed and cannot
    21     21   ** be changed.
    22     22   **
    23     23   ** This version of the memory allocation subsystem is included
    24     24   ** in the build only if SQLITE_ENABLE_MEMSYS3 is defined.
    25     25   **
    26         -** $Id: mem3.c,v 1.24 2008/11/19 14:35:47 danielk1977 Exp $
           26  +** $Id: mem3.c,v 1.25 2008/11/19 16:52:44 danielk1977 Exp $
    27     27   */
    28     28   #include "sqliteInt.h"
    29     29   
    30     30   /*
    31     31   ** This version of the memory allocator is only built into the library
    32     32   ** SQLITE_ENABLE_MEMSYS3 is defined. Defining this symbol does not
    33     33   ** mean that the library will use a memory-pool by default, just that
................................................................................
   651    651     fprintf(out, "mxUsed=%d\n", mem3.nPool*8 - mem3.mnMaster*8);
   652    652     sqlite3_mutex_leave(mem3.mutex);
   653    653     if( out==stdout ){
   654    654       fflush(stdout);
   655    655     }else{
   656    656       fclose(out);
   657    657     }
          658  +#else
          659  +  UNUSED_PARAMETER(zFilename);
   658    660   #endif
   659    661   }
   660    662   
   661    663   /*
   662    664   ** This routine is the only routine in this file with external 
   663    665   ** linkage.
   664    666   **

Changes to src/mem5.c.

    19     19   ** implementations. Once sqlite3_initialize() has been called,
    20     20   ** the amount of memory available to SQLite is fixed and cannot
    21     21   ** be changed.
    22     22   **
    23     23   ** This version of the memory allocation subsystem is included
    24     24   ** in the build only if SQLITE_ENABLE_MEMSYS5 is defined.
    25     25   **
    26         -** $Id: mem5.c,v 1.18 2008/11/19 14:35:47 danielk1977 Exp $
           26  +** $Id: mem5.c,v 1.19 2008/11/19 16:52:44 danielk1977 Exp $
    27     27   */
    28     28   #include "sqliteInt.h"
    29     29   
    30     30   /*
    31     31   ** This version of the memory allocator is used only when 
    32     32   ** SQLITE_ENABLE_MEMSYS5 is defined.
    33     33   */
................................................................................
   457    457     fprintf(out, "mem5.maxRequest   = %u\n", mem5.maxRequest);
   458    458     memsys5Leave();
   459    459     if( out==stdout ){
   460    460       fflush(stdout);
   461    461     }else{
   462    462       fclose(out);
   463    463     }
          464  +#else
          465  +  UNUSED_PARAMETER(zFilename);
   464    466   #endif
   465    467   }
   466    468   
   467    469   /*
   468    470   ** This routine is the only routine in this file with external 
   469    471   ** linkage. It returns a pointer to a static sqlite3_mem_methods
   470    472   ** struct populated with the memsys5 methods.

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.4 2008/11/19 09:05:27 danielk1977 Exp $
           17  +** @(#) $Id: memjournal.c,v 1.5 2008/11/19 16:52:44 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;
................................................................................
   119    119     int nWrite = iAmt;
   120    120     u8 *zWrite = (u8 *)zBuf;
   121    121   
   122    122     /* An in-memory journal file should only ever be appended to. Random
   123    123     ** access writes are not required by sqlite.
   124    124     */
   125    125     assert(iOfst==p->endpoint.iOffset);
          126  +  UNUSED_PARAMETER(iOfst);
   126    127   
   127    128     while( nWrite>0 ){
   128    129       FileChunk *pChunk = p->endpoint.pChunk;
   129    130       int iChunkOffset = p->endpoint.iOffset%JOURNAL_CHUNKSIZE;
   130    131       int iSpace = MIN(nWrite, JOURNAL_CHUNKSIZE - iChunkOffset);
   131    132   
   132    133       if( iChunkOffset==0 ){
................................................................................
   158    159   /*
   159    160   ** Truncate the file.
   160    161   */
   161    162   static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
   162    163     MemJournal *p = (MemJournal *)pJfd;
   163    164     FileChunk *pChunk;
   164    165     assert(size==0);
          166  +  UNUSED_PARAMETER(size);
   165    167     pChunk = p->pFirst;
   166    168     while( pChunk ){
   167    169       FileChunk *pTmp = pChunk;
   168    170       pChunk = pChunk->pNext;
   169    171       sqlite3_free(pTmp);
   170    172     }
   171    173     sqlite3MemJournalOpen(pJfd);

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.215 2008/11/19 14:35:47 danielk1977 Exp $
           15  +** $Id: os_unix.c,v 1.216 2008/11/19 16:52:44 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:
................................................................................
  1197   1197     ** up the real code with the UNUSED_PARAMETER() macros.
  1198   1198     */
  1199   1199   #ifdef SQLITE_NO_SYNC
  1200   1200     UNUSED_PARAMETER(fd);
  1201   1201     UNUSED_PARAMETER(fullSync);
  1202   1202     UNUSED_PARAMETER(dataOnly);
  1203   1203   #elif HAVE_FULLFSYNC
  1204         -  UNUSED_PARAMETER(fullSync);
         1204  +  UNUSED_PARAMETER(dataOnly);
  1205   1205   #else
  1206         -  UNUSED_PARAMETER(dataOnly);
         1206  +  UNUSED_PARAMETER(fullSync);
  1207   1207   #endif
  1208   1208   
  1209   1209     /* Record the number of times that we do a normal fsync() and 
  1210   1210     ** FULLSYNC.  This is used during testing to verify that this procedure
  1211   1211     ** gets called with the correct arguments.
  1212   1212     */
  1213   1213   #ifdef SQLITE_TEST
................................................................................
  2758   2758     assert( pNew->pLock==NULL );
  2759   2759     assert( pNew->pOpen==NULL );
  2760   2760   
  2761   2761     /* Parameter isDelete is only used on vxworks. Parameter pVfs is only
  2762   2762     ** used if ENABLE_LOCKING_STYLE is defined. Express this explicitly 
  2763   2763     ** here to prevent compiler warnings about unused parameters.
  2764   2764     */
  2765         -  if( IS_VXWORKS ) UNUSED_PARAMETER(isDelete);
  2766         -  if( SQLITE_ENABLE_LOCKING_STYLE ) UNUSED_PARAMETER(pVfs);
         2765  +  if( !IS_VXWORKS ) UNUSED_PARAMETER(isDelete);
         2766  +  if( !SQLITE_ENABLE_LOCKING_STYLE ) UNUSED_PARAMETER(pVfs);
         2767  +  if( !IS_VXWORKS && !SQLITE_ENABLE_LOCKING_STYLE ) UNUSED_PARAMETER(zFilename);
  2767   2768   
  2768   2769     OSTRACE3("OPEN    %-3d %s\n", h, zFilename);    
  2769   2770     pNew->h = h;
  2770   2771     pNew->dirfd = dirfd;
  2771   2772     SET_THREADID(pNew);
  2772   2773   
  2773   2774   #if IS_VXWORKS
................................................................................
  3225   3226     ** using the io-error infrastructure to test that SQLite handles this
  3226   3227     ** function failing. This function could fail if, for example, the
  3227   3228     ** current working directly has been unlinked.
  3228   3229     */
  3229   3230     SimulateIOError( return SQLITE_ERROR );
  3230   3231   
  3231   3232     assert( pVfs->mxPathname==MAX_PATHNAME );
         3233  +  UNUSED_PARAMETER(pVfs);
  3232   3234   
  3233   3235   #if IS_VXWORKS
  3234   3236     {
  3235   3237       char *zRealname = vxrealpath(zPath, 0);
  3236   3238       zOut[0] = '\0';
  3237   3239       if( !zRealname ){
  3238   3240         return SQLITE_CANTOPEN;

Changes to src/pcache.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 implements that page cache.
    13     13   **
    14         -** @(#) $Id: pcache.c,v 1.37 2008/11/13 14:28:29 danielk1977 Exp $
           14  +** @(#) $Id: pcache.c,v 1.38 2008/11/19 16:52:44 danielk1977 Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** A complete page cache is an instance of this structure.
    20     20   */
    21     21   struct PCache {
................................................................................
   542    542     int nPage = 0;
   543    543     if( pCache->pCache ){
   544    544       nPage = sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache);
   545    545     }
   546    546     return nPage;
   547    547   }
   548    548   
          549  +#ifdef SQLITE_TEST
   549    550   /*
   550    551   ** Get the suggested cache-size value.
   551    552   */
   552    553   int sqlite3PcacheGetCachesize(PCache *pCache){
   553    554     return pCache->nMax;
   554    555   }
          556  +#endif
   555    557   
   556    558   /*
   557    559   ** Set the suggested cache-size value.
   558    560   */
   559    561   void sqlite3PcacheSetCachesize(PCache *pCache, int mxPage){
   560    562     pCache->nMax = mxPage;
   561    563     if( pCache->pCache ){

Changes to src/pcache.h.

     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 header file defines the interface that the sqlite page cache
    13     13   ** subsystem. 
    14     14   **
    15         -** @(#) $Id: pcache.h,v 1.15 2008/11/13 14:28:29 danielk1977 Exp $
           15  +** @(#) $Id: pcache.h,v 1.16 2008/11/19 16:52:44 danielk1977 Exp $
    16     16   */
    17     17   
    18     18   #ifndef _PCACHE_H_
    19     19   
    20     20   typedef struct PgHdr PgHdr;
    21     21   typedef struct PCache PCache;
    22     22   
................................................................................
    58     58   int sqlite3PcacheInitialize(void);
    59     59   void sqlite3PcacheShutdown(void);
    60     60   
    61     61   /* Page cache buffer management:
    62     62   ** These routines implement SQLITE_CONFIG_PAGECACHE.
    63     63   */
    64     64   void sqlite3PCacheBufferSetup(void *, int sz, int n);
    65         -void *sqlite3PCacheMalloc(int sz);
    66         -void sqlite3PCacheFree(void*);
    67     65   
    68     66   /* Create a new pager cache.
    69     67   ** Under memory stress, invoke xStress to try to make pages clean.
    70     68   ** Only clean and unpinned pages can be reclaimed.
    71     69   */
    72     70   void sqlite3PcacheOpen(
    73     71     int szPage,                    /* Size of every page */
................................................................................
   108    106   
   109    107   /* Reset and close the cache object */
   110    108   void sqlite3PcacheClose(PCache*);
   111    109   
   112    110   /* Clear flags from pages of the page cache */
   113    111   void sqlite3PcacheClearSyncFlags(PCache *);
   114    112   
   115         -/* Return true if the number of dirty pages is 0 or 1 */
   116         -int sqlite3PcacheZeroOrOneDirtyPages(PCache*);
   117         -
   118    113   /* Discard the contents of the cache */
   119    114   int sqlite3PcacheClear(PCache*);
   120    115   
   121    116   /* Return the total number of outstanding page references */
   122    117   int sqlite3PcacheRefCount(PCache*);
   123    118   
   124    119   /* Increment the reference count of an existing page */
................................................................................
   139    134   
   140    135   /* Set and get the suggested cache-size for the specified pager-cache.
   141    136   **
   142    137   ** If no global maximum is configured, then the system attempts to limit
   143    138   ** the total number of pages cached by purgeable pager-caches to the sum
   144    139   ** of the suggested cache-sizes.
   145    140   */
   146         -int sqlite3PcacheGetCachesize(PCache *);
   147    141   void sqlite3PcacheSetCachesize(PCache *, int);
          142  +#ifdef SQLITE_TEST
          143  +int sqlite3PcacheGetCachesize(PCache *);
          144  +#endif
   148    145   
   149    146   #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
   150    147   /* Try to return memory used by the pcache module to the main memory heap */
   151    148   int sqlite3PcacheReleaseMemory(int);
   152    149   #endif
   153    150   
   154    151   #ifdef SQLITE_TEST
   155    152   void sqlite3PcacheStats(int*,int*,int*,int*);
   156    153   #endif
   157    154   
   158    155   void sqlite3PCacheSetDefault(void);
   159    156   
   160    157   #endif /* _PCACHE_H_ */

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.100 2008/11/19 09:05:27 danielk1977 Exp $
           16  +** $Id: prepare.c,v 1.101 2008/11/19 16:52:44 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.
................................................................................
    53     53   **
    54     54   */
    55     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  +  assert( argc==3 );
           61  +  UNUSED_PARAMETER2(NotUsed, argc);
    61     62     assert( sqlite3_mutex_held(db->mutex) );
    62     63     DbClearProperty(db, iDb, DB_Empty);
    63     64     if( db->mallocFailed ){
    64     65       corruptSchema(pData, argv[0], 0);
    65     66       return SQLITE_NOMEM;
    66     67     }
    67     68   
    68         -  assert( argc==3 );
    69     69     assert( iDb>=0 && iDb<db->nDb );
    70     70     if( argv==0 ) return 0;   /* Might happen if EMPTY_RESULT_CALLBACKS are on */
    71     71     if( argv[1]==0 ){
    72     72       corruptSchema(pData, argv[0], 0);
    73     73     }else if( argv[2] && argv[2][0] ){
    74     74       /* Call the parser to process a CREATE TABLE, INDEX or VIEW.
    75     75       ** But because db->init.busy is set to 1, no VDBE code is generated

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.797 2008/11/19 09:05:27 danielk1977 Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.798 2008/11/19 16:52:44 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  +/*
          482  +** The following macros are used to suppress compiler warnings and to
          483  +** make it clear to human readers when a function parameter is deliberately 
          484  +** left unused within the body of a function. This usually happens when
          485  +** a function is called via a function pointer. For example the 
          486  +** implementation of an SQL aggregate step callback may not use the
          487  +** parameter indicating the number of arguments passed to the aggregate,
          488  +** if it knows that this is enforced elsewhere.
          489  +**
          490  +** When a function parameter is not used at all within the body of a function,
          491  +** it is generally named "NotUsed" or "NotUsed2" to make things even clearer.
          492  +** However, these macros may also be used to suppress warnings related to
          493  +** parameters that may or may not be used depending on compilation options.
          494  +** For example those parameters only used in assert() statements. In these
          495  +** cases the parameters are named as per the usual conventions.
          496  +*/
   481    497   #define UNUSED_PARAMETER(x) (void)(x)
   482         -#define UNUSED_PARAMETER2(x,y) (void)(x),(void)(y)
          498  +#define UNUSED_PARAMETER2(x,y) UNUSED_PARAMETER(x),UNUSED_PARAMETER(y)
   483    499   
   484    500   /*
   485    501   ** Forward references to structures
   486    502   */
   487    503   typedef struct AggInfo AggInfo;
   488    504   typedef struct AuthContext AuthContext;
   489    505   typedef struct Bitvec Bitvec;
................................................................................
  2059   2075   int sqlite3MallocSize(void*);
  2060   2076   int sqlite3DbMallocSize(sqlite3*, void*);
  2061   2077   void *sqlite3ScratchMalloc(int);
  2062   2078   void sqlite3ScratchFree(void*);
  2063   2079   void *sqlite3PageMalloc(int);
  2064   2080   void sqlite3PageFree(void*);
  2065   2081   void sqlite3MemSetDefault(void);
  2066         -const sqlite3_mem_methods *sqlite3MemGetMemsys3(void);
  2067         -const sqlite3_mem_methods *sqlite3MemGetMemsys5(void);
  2068   2082   void sqlite3BenignMallocHooks(void (*)(void), void (*)(void));
  2069   2083   int sqlite3MemoryAlarm(void (*)(void*, sqlite3_int64, int), void*, sqlite3_int64);
         2084  +
         2085  +#ifdef SQLITE_ENABLE_MEMSYS3
         2086  +const sqlite3_mem_methods *sqlite3MemGetMemsys3(void);
         2087  +#endif
         2088  +#ifdef SQLITE_ENABLE_MEMSYS5
         2089  +const sqlite3_mem_methods *sqlite3MemGetMemsys5(void);
         2090  +#endif
         2091  +
  2070   2092   
  2071   2093   #ifndef SQLITE_MUTEX_OMIT
  2072   2094     sqlite3_mutex_methods *sqlite3DefaultMutex(void);
  2073   2095     sqlite3_mutex *sqlite3MutexAlloc(int);
  2074   2096     int sqlite3MutexInit(void);
  2075   2097     int sqlite3MutexEnd(void);
  2076   2098   #endif
................................................................................
  2236   2258   IdList *sqlite3IdListDup(sqlite3*,IdList*);
  2237   2259   Select *sqlite3SelectDup(sqlite3*,Select*);
  2238   2260   void sqlite3FuncDefInsert(FuncDefHash*, FuncDef*);
  2239   2261   FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int);
  2240   2262   void sqlite3RegisterBuiltinFunctions(sqlite3*);
  2241   2263   void sqlite3RegisterDateTimeFunctions(void);
  2242   2264   void sqlite3RegisterGlobalFunctions(void);
  2243         -int sqlite3GetBuiltinFunction(const char *, int, FuncDef **);
  2244   2265   #ifdef SQLITE_DEBUG
  2245   2266     int sqlite3SafetyOn(sqlite3*);
  2246   2267     int sqlite3SafetyOff(sqlite3*);
  2247   2268   #else
  2248   2269   # define sqlite3SafetyOn(A) 0
  2249   2270   # define sqlite3SafetyOff(A) 0
  2250   2271   #endif