diff options
author | dan <dan@noemail.net> | 2010-06-02 05:53:53 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-06-02 05:53:53 +0000 |
commit | 558814f8c6084d5a4e2abecf94af84d4eb7e99d3 (patch) | |
tree | a6e122060822d6b983b42c357e96453ad7f91f75 /src | |
parent | 8b3cf82ddfb6e7897a970b14cd4e76ae2ee71268 (diff) | |
download | sqlite-558814f8c6084d5a4e2abecf94af84d4eb7e99d3.tar.gz sqlite-558814f8c6084d5a4e2abecf94af84d4eb7e99d3.zip |
Add some 'const' markers to static data that is really constant.
FossilOrigin-Name: e7073e23b80e7cae0c76d42f014ee9b2d40a8f2f
Diffstat (limited to 'src')
-rw-r--r-- | src/analyze.c | 2 | ||||
-rw-r--r-- | src/attach.c | 6 | ||||
-rw-r--r-- | src/build.c | 2 | ||||
-rw-r--r-- | src/memjournal.c | 2 | ||||
-rw-r--r-- | src/mutex.c | 2 | ||||
-rw-r--r-- | src/mutex_noop.c | 10 | ||||
-rw-r--r-- | src/mutex_os2.c | 4 | ||||
-rw-r--r-- | src/mutex_unix.c | 4 | ||||
-rw-r--r-- | src/mutex_w32.c | 4 | ||||
-rw-r--r-- | src/pcache1.c | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 4 |
11 files changed, 21 insertions, 21 deletions
diff --git a/src/analyze.c b/src/analyze.c index 72983412d..94cf3a39d 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -36,7 +36,7 @@ static void openStatTable( int iStatCur, /* Open the sqlite_stat1 table on this cursor */ const char *zWhere /* Delete entries associated with this table */ ){ - static struct { + static const struct { const char *zName; const char *zCols; } aTable[] = { diff --git a/src/attach.c b/src/attach.c index 0299cbfb3..ccbb2e925 100644 --- a/src/attach.c +++ b/src/attach.c @@ -289,7 +289,7 @@ detach_error: static void codeAttach( Parse *pParse, /* The parser context */ int type, /* Either SQLITE_ATTACH or SQLITE_DETACH */ - FuncDef *pFunc, /* FuncDef wrapper for detachFunc() or attachFunc() */ + FuncDef const *pFunc,/* FuncDef wrapper for detachFunc() or attachFunc() */ Expr *pAuthArg, /* Expression to pass to authorization callback */ Expr *pFilename, /* Name of database file */ Expr *pDbname, /* Name of the database to use internally */ @@ -370,7 +370,7 @@ attach_end: ** DETACH pDbname */ void sqlite3Detach(Parse *pParse, Expr *pDbname){ - static FuncDef detach_func = { + static const FuncDef detach_func = { 1, /* nArg */ SQLITE_UTF8, /* iPrefEnc */ 0, /* flags */ @@ -391,7 +391,7 @@ void sqlite3Detach(Parse *pParse, Expr *pDbname){ ** ATTACH p AS pDbname KEY pKey */ void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *pKey){ - static FuncDef attach_func = { + static const FuncDef attach_func = { 3, /* nArg */ SQLITE_UTF8, /* iPrefEnc */ 0, /* flags */ diff --git a/src/build.c b/src/build.c index 8e343864f..38166ce7f 100644 --- a/src/build.c +++ b/src/build.c @@ -3382,7 +3382,7 @@ void sqlite3Savepoint(Parse *pParse, int op, Token *pName){ if( zName ){ Vdbe *v = sqlite3GetVdbe(pParse); #ifndef SQLITE_OMIT_AUTHORIZATION - static const char *az[] = { "BEGIN", "RELEASE", "ROLLBACK" }; + static const char * const az[] = { "BEGIN", "RELEASE", "ROLLBACK" }; assert( !SAVEPOINT_BEGIN && SAVEPOINT_RELEASE==1 && SAVEPOINT_ROLLBACK==2 ); #endif if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ diff --git a/src/memjournal.c b/src/memjournal.c index f042475dc..d1454aed4 100644 --- a/src/memjournal.c +++ b/src/memjournal.c @@ -213,7 +213,7 @@ static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){ /* ** Table of methods for MemJournal sqlite3_file object. */ -static struct sqlite3_io_methods MemJournalMethods = { +static const struct sqlite3_io_methods MemJournalMethods = { 1, /* iVersion */ memjrnlClose, /* xClose */ memjrnlRead, /* xRead */ diff --git a/src/mutex.c b/src/mutex.c index c1cd01e91..869a4aeb0 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -37,7 +37,7 @@ int sqlite3MutexInit(void){ ** sqlite3_initialize() being called. This block copies pointers to ** the default implementation into the sqlite3GlobalConfig structure. */ - sqlite3_mutex_methods *pFrom; + sqlite3_mutex_methods const *pFrom; sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex; if( sqlite3GlobalConfig.bCoreMutex ){ diff --git a/src/mutex_noop.c b/src/mutex_noop.c index 057435694..ae42c3430 100644 --- a/src/mutex_noop.c +++ b/src/mutex_noop.c @@ -43,8 +43,8 @@ static void noopMutexEnter(sqlite3_mutex *p){ return; } static int noopMutexTry(sqlite3_mutex *p){ return SQLITE_OK; } static void noopMutexLeave(sqlite3_mutex *p){ return; } -sqlite3_mutex_methods *sqlite3NoopMutex(void){ - static sqlite3_mutex_methods sMutex = { +sqlite3_mutex_methods const *sqlite3NoopMutex(void){ + static const sqlite3_mutex_methods sMutex = { noopMutexInit, noopMutexEnd, noopMutexAlloc, @@ -170,8 +170,8 @@ static void debugMutexLeave(sqlite3_mutex *pX){ assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(pX) ); } -sqlite3_mutex_methods *sqlite3NoopMutex(void){ - static sqlite3_mutex_methods sMutex = { +sqlite3_mutex_methods const *sqlite3NoopMutex(void){ + static const sqlite3_mutex_methods sMutex = { debugMutexInit, debugMutexEnd, debugMutexAlloc, @@ -193,7 +193,7 @@ sqlite3_mutex_methods *sqlite3NoopMutex(void){ ** is used regardless of the run-time threadsafety setting. */ #ifdef SQLITE_MUTEX_NOOP -sqlite3_mutex_methods *sqlite3DefaultMutex(void){ +sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ return sqliteNoopMutex(); } #endif /* SQLITE_MUTEX_NOOP */ diff --git a/src/mutex_os2.c b/src/mutex_os2.c index f16dc218d..4438c097c 100644 --- a/src/mutex_os2.c +++ b/src/mutex_os2.c @@ -251,8 +251,8 @@ static void os2MutexLeave(sqlite3_mutex *p){ DosReleaseMutexSem(p->mutex); } -sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + static const sqlite3_mutex_methods sMutex = { os2MutexInit, os2MutexEnd, os2MutexAlloc, diff --git a/src/mutex_unix.c b/src/mutex_unix.c index b1037c4bf..a1ebc3b75 100644 --- a/src/mutex_unix.c +++ b/src/mutex_unix.c @@ -325,8 +325,8 @@ static void pthreadMutexLeave(sqlite3_mutex *p){ #endif } -sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + static const sqlite3_mutex_methods sMutex = { pthreadMutexInit, pthreadMutexEnd, pthreadMutexAlloc, diff --git a/src/mutex_w32.c b/src/mutex_w32.c index 7f0fd04e6..442a6b786 100644 --- a/src/mutex_w32.c +++ b/src/mutex_w32.c @@ -307,8 +307,8 @@ static void winMutexLeave(sqlite3_mutex *p){ #endif } -sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + static const sqlite3_mutex_methods sMutex = { winMutexInit, winMutexEnd, winMutexAlloc, diff --git a/src/pcache1.c b/src/pcache1.c index 92cf5adb9..9f2b29986 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -716,7 +716,7 @@ static void pcache1Destroy(sqlite3_pcache *p){ ** already provided an alternative. */ void sqlite3PCacheSetDefault(void){ - static sqlite3_pcache_methods defaultMethods = { + static const sqlite3_pcache_methods defaultMethods = { 0, /* pArg */ pcache1Init, /* xInit */ pcache1Shutdown, /* xShutdown */ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 2fa474c60..eed2b10ed 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2536,8 +2536,8 @@ const sqlite3_mem_methods *sqlite3MemGetMemsys5(void); #ifndef SQLITE_MUTEX_OMIT - sqlite3_mutex_methods *sqlite3DefaultMutex(void); - sqlite3_mutex_methods *sqlite3NoopMutex(void); + sqlite3_mutex_methods const *sqlite3DefaultMutex(void); + sqlite3_mutex_methods const *sqlite3NoopMutex(void); sqlite3_mutex *sqlite3MutexAlloc(int); int sqlite3MutexInit(void); int sqlite3MutexEnd(void); |