/ Check-in [59708674]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a couple more harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59708674f66e06c9c31c1a24f2f1c51f0bf4fa3e
User & Date: mistachkin 2013-09-12 01:47:57
Context
2013-09-12
02:09
For error log messages generated by the Win32 native allocator, make sure the correct format specifier is used for the value returned by GetLastError(). check-in: 75a8a8c1 user: mistachkin tags: trunk
01:47
Fix a couple more harmless compiler warnings. check-in: 59708674 user: mistachkin tags: trunk
01:33
Remove two obsolete fields from the sqlite3 object. check-in: 117fa5fb user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

   104    104   ** Returns non-zero if the character should be treated as a directory
   105    105   ** separator.
   106    106   */
   107    107   #ifndef winIsDirSep
   108    108   #  define winIsDirSep(a)                (((a) == '/') || ((a) == '\\'))
   109    109   #endif
   110    110   
          111  +/*
          112  +** This macro is used when a local variable is set to a value that is
          113  +** [sometimes] not used by the code (e.g. via conditional compilation).
          114  +*/
          115  +#ifndef UNUSED_VARIABLE_VALUE
          116  +#  define UNUSED_VARIABLE_VALUE(x) (void)(x)
          117  +#endif
          118  +
   111    119   /*
   112    120   ** Returns the string that should be used as the directory separator.
   113    121   */
   114    122   #ifndef winGetDirDep
   115    123   #  ifdef __CYGWIN__
   116    124   #    define winGetDirDep()              "/"
   117    125   #  else
................................................................................
   354    362   ** 2:   Operating system is WinNT.
   355    363   **
   356    364   ** In order to facilitate testing on a WinNT system, the test fixture
   357    365   ** can manually set this value to 1 to emulate Win98 behavior.
   358    366   */
   359    367   #ifdef SQLITE_TEST
   360    368   int sqlite3_os_type = 0;
   361         -#else
          369  +#elif !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && \
          370  +      defined(SQLITE_WIN32_HAS_ANSI) && defined(SQLITE_WIN32_HAS_WIDE)
   362    371   static int sqlite3_os_type = 0;
   363    372   #endif
   364    373   
   365    374   #ifndef SYSCALL
   366    375   #  define SYSCALL sqlite3_syscall_ptr
   367    376   #endif
   368    377   
................................................................................
  3181   3190   **
  3182   3191   ** This is not a VFS shared-memory method; it is a utility function called
  3183   3192   ** by VFS shared-memory methods.
  3184   3193   */
  3185   3194   static void winShmPurge(sqlite3_vfs *pVfs, int deleteFlag){
  3186   3195     winShmNode **pp;
  3187   3196     winShmNode *p;
  3188         -  BOOL bRc;
  3189   3197     assert( winShmMutexHeld() );
  3190   3198     OSTRACE(("SHM-PURGE pid=%lu, deleteFlag=%d\n",
  3191   3199              osGetCurrentProcessId(), deleteFlag));
  3192   3200     pp = &winShmNodeList;
  3193   3201     while( (p = *pp)!=0 ){
  3194   3202       if( p->nRef==0 ){
  3195   3203         int i;
  3196   3204         if( p->mutex ) sqlite3_mutex_free(p->mutex);
  3197   3205         for(i=0; i<p->nRegion; i++){
  3198         -        bRc = osUnmapViewOfFile(p->aRegion[i].pMap);
         3206  +        BOOL bRc = osUnmapViewOfFile(p->aRegion[i].pMap);
  3199   3207           OSTRACE(("SHM-PURGE-UNMAP pid=%lu, region=%d, rc=%s\n",
  3200   3208                    osGetCurrentProcessId(), i, bRc ? "ok" : "failed"));
         3209  +        UNUSED_VARIABLE_VALUE(bRc);
  3201   3210           bRc = osCloseHandle(p->aRegion[i].hMap);
  3202   3211           OSTRACE(("SHM-PURGE-CLOSE pid=%lu, region=%d, rc=%s\n",
  3203   3212                    osGetCurrentProcessId(), i, bRc ? "ok" : "failed"));
         3213  +        UNUSED_VARIABLE_VALUE(bRc);
  3204   3214         }
  3205   3215         if( p->hFile.h!=NULL && p->hFile.h!=INVALID_HANDLE_VALUE ){
  3206   3216           SimulateIOErrorBenign(1);
  3207   3217           winClose((sqlite3_file *)&p->hFile);
  3208   3218           SimulateIOErrorBenign(0);
  3209   3219         }
  3210   3220         if( deleteFlag ){