/ Check-in [9b191bb4]
Login

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

Overview
Comment:Fix some harmless compiler warnings that were occurring with THREADSAFE=0.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9b191bb4c7c1e1b12b188c0b3eee1f8f587887c8
User & Date: drh 2011-06-24 11:29:51
Context
2011-06-24
13:50
Fix a Windows line ending issue in a test case that was causing an incrblob test to fail. check-in: afbe9023 user: shaneh tags: trunk
11:29
Fix some harmless compiler warnings that were occurring with THREADSAFE=0. check-in: 9b191bb4 user: drh tags: trunk
2011-06-23
19:49
Version 3.7.7. check-in: 4374b7e8 user: drh tags: trunk, release, version-3.7.7
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/date.c.

   423    423   ** routine will always fail.
   424    424   */
   425    425   static int osLocaltime(time_t *t, struct tm *pTm){
   426    426     int rc;
   427    427   #if (!defined(HAVE_LOCALTIME_R) || !HAVE_LOCALTIME_R) \
   428    428         && (!defined(HAVE_LOCALTIME_S) || !HAVE_LOCALTIME_S)
   429    429     struct tm *pX;
          430  +#if SQLITE_THREADSAFE>0
   430    431     sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
          432  +#endif
   431    433     sqlite3_mutex_enter(mutex);
   432    434     pX = localtime(t);
   433    435   #ifndef SQLITE_OMIT_BUILTIN_TEST
   434    436     if( sqlite3GlobalConfig.bLocaltimeFault ) pX = 0;
   435    437   #endif
   436    438     if( pX ) *pTm = *pX;
   437    439     sqlite3_mutex_leave(mutex);

Changes to src/os_unix.c.

  3668   3668   */
  3669   3669   static void unixShmPurge(unixFile *pFd){
  3670   3670     unixShmNode *p = pFd->pInode->pShmNode;
  3671   3671     assert( unixMutexHeld() );
  3672   3672     if( p && p->nRef==0 ){
  3673   3673       int i;
  3674   3674       assert( p->pInode==pFd->pInode );
  3675         -    if( p->mutex ) sqlite3_mutex_free(p->mutex);
         3675  +    sqlite3_mutex_free(p->mutex);
  3676   3676       for(i=0; i<p->nRegion; i++){
  3677   3677         if( p->h>=0 ){
  3678   3678           munmap(p->apRegion[i], p->szRegion);
  3679   3679         }else{
  3680   3680           sqlite3_free(p->apRegion[i]);
  3681   3681         }
  3682   3682       }

Changes to tool/warnings.sh.

     4      4   # compiler warnings in SQLite.
     5      5   #
     6      6   make sqlite3.c
     7      7   echo '********** No optimizations.  Includes FTS4 and RTREE *********'
     8      8   gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
     9      9         -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
    10     10         sqlite3.c
    11         -echo '********** Optimized -O3.  Includes FTS4 and RTREE *********'
           11  +echo '********** No optimizations. ENABLE_STAT2. THREADSAFE=0 *******'
           12  +gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
           13  +      -ansi -DSQLITE_ENABLE_STAT2 -DSQLITE_THREADSAFE=0 \
           14  +      sqlite3.c
           15  +echo '********** Optimized -O3.  Includes FTS4 and RTREE ************'
    12     16   gcc -O3 -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
    13     17         -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
    14     18         sqlite3.c