/ Check-in [c6325670]
Login

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

Overview
Comment:Fix harmless compiler warnings and improve the MSVC makefile.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c632567063d81c4be404ce58cbac0eff7412f565
User & Date: drh 2013-12-05 17:12:47
Context
2013-12-06
14:53
Version 3.8.2 check-in: 27392118 user: dan tags: trunk, release, version-3.8.2
2013-12-05
17:12
Fix harmless compiler warnings and improve the MSVC makefile. check-in: c6325670 user: drh tags: trunk
16:41
Fix two potential (and apparently harmless) shift overflows discovered by the -fcatch-undefined-behavior option of clang. check-in: e19eead8 user: drh tags: trunk
2013-12-03
23:33
Make use of the CC nmake macro even when cross-compiling (with MSVC). Closed-Leaf check-in: aae7b30e user: mistachkin tags: memTests
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

   158    158   #     nmake /f Makefile.msc sqlite3.dll
   159    159   #           "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
   160    160   #           USE_NATIVE_LIBPATHS=1
   161    161   #
   162    162   !IFDEF NCC
   163    163   NCC = $(NCC:\\=\)
   164    164   !ELSEIF $(XCOMPILE)!=0
   165         -NCC = "$(VCINSTALLDIR)\bin\cl.exe"
          165  +NCC = "$(VCINSTALLDIR)\bin\$(CC)"
   166    166   NCC = $(NCC:\\=\)
   167    167   !ELSE
   168    168   NCC = $(CC)
   169    169   !ENDIF
   170    170   
   171    171   # Check for the MSVC runtime library path macro.  Othertise, this
   172    172   # value will default to the 'lib' directory underneath the MSVC

Changes to src/ctime.c.

   343    343   #endif
   344    344   #ifdef SQLITE_SMALL_STACK
   345    345     "SMALL_STACK",
   346    346   #endif
   347    347   #ifdef SQLITE_SOUNDEX
   348    348     "SOUNDEX",
   349    349   #endif
          350  +#ifdef SQLITE_SYSTEM_MALLOC
          351  +  "SYSTEM_MALLOC",
          352  +#endif
   350    353   #ifdef SQLITE_TCL
   351    354     "TCL",
   352    355   #endif
   353    356   #if defined(SQLITE_TEMP_STORE) && !defined(SQLITE_TEMP_STORE_xc)
   354    357     "TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE),
   355    358   #endif
   356    359   #ifdef SQLITE_TEST
................................................................................
   357    360     "TEST",
   358    361   #endif
   359    362   #if defined(SQLITE_THREADSAFE)
   360    363     "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE),
   361    364   #endif
   362    365   #ifdef SQLITE_USE_ALLOCA
   363    366     "USE_ALLOCA",
          367  +#endif
          368  +#ifdef SQLITE_WIN32_MALLOC
          369  +  "WIN32_MALLOC",
   364    370   #endif
   365    371   #ifdef SQLITE_ZERO_MALLOC
   366    372     "ZERO_MALLOC"
   367    373   #endif
   368    374   };
   369    375   
   370    376   /*

Changes to src/mem5.c.

   198    198   ** Return the size of an outstanding allocation, in bytes.  The
   199    199   ** size returned omits the 8-byte header overhead.  This only
   200    200   ** works for chunks that are currently checked out.
   201    201   */
   202    202   static int memsys5Size(void *p){
   203    203     int iSize = 0;
   204    204     if( p ){
   205         -    int i = ((u8 *)p-mem5.zPool)/mem5.szAtom;
          205  +    int i = (int)(((u8 *)p-mem5.zPool)/mem5.szAtom);
   206    206       assert( i>=0 && i<mem5.nBlock );
   207    207       iSize = mem5.szAtom * (1 << (mem5.aCtrl[i]&CTRL_LOGSIZE));
   208    208     }
   209    209     return iSize;
   210    210   }
   211    211   
   212    212   /*
................................................................................
   285    285   static void memsys5FreeUnsafe(void *pOld){
   286    286     u32 size, iLogsize;
   287    287     int iBlock;
   288    288   
   289    289     /* Set iBlock to the index of the block pointed to by pOld in 
   290    290     ** the array of mem5.szAtom byte blocks pointed to by mem5.zPool.
   291    291     */
   292         -  iBlock = ((u8 *)pOld-mem5.zPool)/mem5.szAtom;
          292  +  iBlock = (int)(((u8 *)pOld-mem5.zPool)/mem5.szAtom);
   293    293   
   294    294     /* Check that the pointer pOld points to a valid, non-free block. */
   295    295     assert( iBlock>=0 && iBlock<mem5.nBlock );
   296    296     assert( ((u8 *)pOld-mem5.zPool)%mem5.szAtom==0 );
   297    297     assert( (mem5.aCtrl[iBlock] & CTRL_FREE)==0 );
   298    298   
   299    299     iLogsize = mem5.aCtrl[iBlock] & CTRL_LOGSIZE;