Skip to content

Commit

Permalink
Add some 'const' markers to static data that is really constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Jun 2, 2010
1 parent dce8129 commit 2d36944
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/analyze.c
Expand Up @@ -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[] = {
Expand Down
6 changes: 3 additions & 3 deletions src/attach.c
Expand Up @@ -289,7 +289,7 @@ static void detachFunc(
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 */
Expand Down Expand Up @@ -370,7 +370,7 @@ static void codeAttach(
** DETACH pDbname
*/
void sqlite3Detach(Parse *pParse, Expr *pDbname){
static FuncDef detach_func = {
static const FuncDef detach_func = {
1, /* nArg */
SQLITE_UTF8, /* iPrefEnc */
0, /* flags */
Expand All @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/build.c
Expand Up @@ -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) ){
Expand Down
2 changes: 1 addition & 1 deletion src/memjournal.c
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/mutex.c
Expand Up @@ -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 ){
Expand Down
10 changes: 5 additions & 5 deletions src/mutex_noop.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions src/mutex_os2.c
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/mutex_unix.c
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/mutex_w32.c
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/pcache1.c
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions src/sqliteInt.h
Expand Up @@ -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);
Expand Down

0 comments on commit 2d36944

Please sign in to comment.