/ Check-in [7ee570e7]
Login

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

Overview
Comment:Since the return value of sqlite3OsClose() is always ignored, we might as well make it "void" instead of "int", and thereby save 50 bytes in the compiled binary.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7ee570e7a9a2159a8c0d41805c00f91ca0de00e3
User & Date: drh 2016-04-14 13:16:58
Context
2016-04-14
13:35
Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what it represents. check-in: 53179614 user: drh tags: trunk
13:16
Since the return value of sqlite3OsClose() is always ignored, we might as well make it "void" instead of "int", and thereby save 50 bytes in the compiled binary. check-in: 7ee570e7 user: drh tags: trunk
13:06
Additional ".selecttrace" debugging output when the query is transformed from a DISTINCT into a GROUP BY. check-in: 5a469145 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os.c.

    77     77   
    78     78   /*
    79     79   ** The following routines are convenience wrappers around methods
    80     80   ** of the sqlite3_file object.  This is mostly just syntactic sugar. All
    81     81   ** of this would be completely automatic if SQLite were coded using
    82     82   ** C++ instead of plain old C.
    83     83   */
    84         -int sqlite3OsClose(sqlite3_file *pId){
    85         -  int rc = SQLITE_OK;
           84  +void sqlite3OsClose(sqlite3_file *pId){
    86     85     if( pId->pMethods ){
    87         -    rc = pId->pMethods->xClose(pId);
           86  +    pId->pMethods->xClose(pId);
    88     87       pId->pMethods = 0;
    89     88     }
    90         -  return rc;
    91     89   }
    92     90   int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
    93     91     DO_OS_MALLOC_TEST(id);
    94     92     return id->pMethods->xRead(id, pBuf, amt, offset);
    95     93   }
    96     94   int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
    97     95     DO_OS_MALLOC_TEST(id);
................................................................................
   301    299         *ppFile = pFile;
   302    300       }
   303    301     }else{
   304    302       rc = SQLITE_NOMEM_BKPT;
   305    303     }
   306    304     return rc;
   307    305   }
   308         -int sqlite3OsCloseFree(sqlite3_file *pFile){
   309         -  int rc = SQLITE_OK;
          306  +void sqlite3OsCloseFree(sqlite3_file *pFile){
   310    307     assert( pFile );
   311         -  rc = sqlite3OsClose(pFile);
          308  +  sqlite3OsClose(pFile);
   312    309     sqlite3_free(pFile);
   313         -  return rc;
   314    310   }
   315    311   
   316    312   /*
   317    313   ** This function is a wrapper around the OS specific implementation of
   318    314   ** sqlite3_os_init(). The purpose of the wrapper is to provide the
   319    315   ** ability to simulate a malloc failure, so that the handling of an
   320    316   ** error in sqlite3_os_init() by the upper layers can be tested.

Changes to src/os.h.

   156    156   ** Wrapper around OS specific sqlite3_os_init() function.
   157    157   */
   158    158   int sqlite3OsInit(void);
   159    159   
   160    160   /* 
   161    161   ** Functions for accessing sqlite3_file methods 
   162    162   */
   163         -int sqlite3OsClose(sqlite3_file*);
          163  +void sqlite3OsClose(sqlite3_file*);
   164    164   int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
   165    165   int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
   166    166   int sqlite3OsTruncate(sqlite3_file*, i64 size);
   167    167   int sqlite3OsSync(sqlite3_file*, int);
   168    168   int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
   169    169   int sqlite3OsLock(sqlite3_file*, int);
   170    170   int sqlite3OsUnlock(sqlite3_file*, int);
................................................................................
   201    201   int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64*);
   202    202   
   203    203   /*
   204    204   ** Convenience functions for opening and closing files using 
   205    205   ** sqlite3_malloc() to obtain space for the file-handle structure.
   206    206   */
   207    207   int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
   208         -int sqlite3OsCloseFree(sqlite3_file *);
          208  +void sqlite3OsCloseFree(sqlite3_file *);
   209    209   
   210    210   #endif /* _SQLITE_OS_H_ */

Changes to src/test_devsym.c.

   129    129   struct DevsymGlobal g = {0, 0, 512};
   130    130   
   131    131   /*
   132    132   ** Close an devsym-file.
   133    133   */
   134    134   static int devsymClose(sqlite3_file *pFile){
   135    135     devsym_file *p = (devsym_file *)pFile;
   136         -  return sqlite3OsClose(p->pReal);
          136  +  sqlite3OsClose(p->pReal);
          137  +  return SQLITE_OK;
   137    138   }
   138    139   
   139    140   /*
   140    141   ** Read data from an devsym-file.
   141    142   */
   142    143   static int devsymRead(
   143    144     sqlite3_file *pFile, 

Changes to src/test_journal.c.

   252    252     closeTransaction(p);
   253    253     enterJtMutex();
   254    254     if( p->zName ){
   255    255       for(pp=&g.pList; *pp!=p; pp=&(*pp)->pNext);
   256    256       *pp = p->pNext;
   257    257     }
   258    258     leaveJtMutex();
   259         -  return sqlite3OsClose(p->pReal);
          259  +  sqlite3OsClose(p->pReal);
          260  +  return SQLITE_OK;
   260    261   }
   261    262   
   262    263   /*
   263    264   ** Read data from an jt-file.
   264    265   */
   265    266   static int jtRead(
   266    267     sqlite3_file *pFile, 

Changes to src/test_vfs.c.

   302    302   }
   303    303   
   304    304   
   305    305   /*
   306    306   ** Close an tvfs-file.
   307    307   */
   308    308   static int tvfsClose(sqlite3_file *pFile){
   309         -  int rc;
   310    309     TestvfsFile *pTestfile = (TestvfsFile *)pFile;
   311    310     TestvfsFd *pFd = pTestfile->pFd;
   312    311     Testvfs *p = (Testvfs *)pFd->pVfs->pAppData;
   313    312   
   314    313     if( p->pScript && p->mask&TESTVFS_CLOSE_MASK ){
   315    314       tvfsExecTcl(p, "xClose", 
   316    315           Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, 0, 0
................................................................................
   320    319     if( pFd->pShmId ){
   321    320       Tcl_DecrRefCount(pFd->pShmId);
   322    321       pFd->pShmId = 0;
   323    322     }
   324    323     if( pFile->pMethods ){
   325    324       ckfree((char *)pFile->pMethods);
   326    325     }
   327         -  rc = sqlite3OsClose(pFd->pReal);
          326  +  sqlite3OsClose(pFd->pReal);
   328    327     ckfree((char *)pFd);
   329    328     pTestfile->pFd = 0;
   330         -  return rc;
          329  +  return SQLITE_OK;
   331    330   }
   332    331   
   333    332   /*
   334    333   ** Read data from an tvfs-file.
   335    334   */
   336    335   static int tvfsRead(
   337    336     sqlite3_file *pFile,