From: danielk1977 Date: Fri, 9 Dec 2005 14:39:04 +0000 (+0000) Subject: Define the sqliteMalloc() macro differently to avoid a compiler warning. (CVS 2809) X-Git-Tag: version-3.6.10~3351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97cb2e969bf35f083517cbbae8aa3e8a9204454f;p=thirdparty%2Fsqlite.git Define the sqliteMalloc() macro differently to avoid a compiler warning. (CVS 2809) FossilOrigin-Name: 3d177bde71811391f79f4ab3bae054ef1bceb6a0 --- diff --git a/manifest b/manifest index 292d56defc..c28bd1dc8d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Many\ssmall\schanges\sto\sensure\smemory\sis\snot\sleaked\safter\smalloc()\sfails.\s(CVS\s2808) -D 2005-12-09T14:25:08 +C Define\sthe\ssqliteMalloc()\smacro\sdifferently\sto\savoid\sa\scompiler\swarning.\s(CVS\s2809) +D 2005-12-09T14:39:04 F Makefile.in e3c6b3a38d734d41574c04f2fc90d18de2b87102 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -69,10 +69,10 @@ F src/random.c ff5e9a8cad790e2a51cd4d2e7737dc8540e09d1d F src/select.c 0e4d3627fec4a445b45f6cb471f68aab9c97a8b3 F src/shell.c 4872acee1d2a826c73c914961e469e563204b7f9 F src/sqlite.h.in 8e648e1f386e4509f2f96c09ded7c07b0df0c9a2 -F src/sqliteInt.h 4247cf9ae4280ae33e5bbc7b45358940ff34b9ce +F src/sqliteInt.h f74a403b6110aa973fd6892d894c9ca5b94ab23a F src/table.c 486dcfce532685b53b5a2b5da8bba0ded6fb2316 F src/tclsqlite.c 328060916c24d328cfab1622c9a0e7ad57c2da8c -F src/test1.c 350129da26943dd62067e75ad71ba85a1a648230 +F src/test1.c 96d78c83c011df65f1c3538e2118647b09239acd F src/test2.c 36390cdfc70c08e5ee0b466d0654a117f398bbff F src/test3.c f4e6a16a602091696619a1171bda25c0e3df49f7 F src/test4.c a8fd681e139e1c61f22a77d07fc3a99cb28fff3f @@ -82,7 +82,7 @@ F src/tokenize.c a189d7466524076220f41a21baed05e1639a82f4 F src/trigger.c dfc1f8ee8e71c6482fb269695778c8b51f821c98 F src/update.c ec8e540617b116725b5a55c8d6b4db8bc67fdd7d F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c -F src/util.c c77727365ce60b0e0087550ba88653ad0fcf24ea +F src/util.c 94c0b99e66243b3452c81cd321eb6e61e4c5fba0 F src/vacuum.c 3cd457f91b05338269f2ea21c4c58dce93f2eef2 F src/vdbe.c 4f78f1fe3b5e7675ee54a2cc18f14dea4ff5fd94 F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13 @@ -223,7 +223,7 @@ F test/table.test ec0e6c2186bb8f6824f470caa118524dfd8fe057 F test/tableapi.test 6a66d58b37d46dc0f2b3c7d4bd2617d209399bd1 F test/tclsqlite.test 2da3e4b3a79b13c1511c9d0cd995e08f8362e782 F test/temptable.test 7927261befdbc7b0a7ffebb85ecc70a74fa7b15b -F test/tester.tcl 6effe753bed26313eaab11a382436a99e602fa54 +F test/tester.tcl a06c798a653daefb5bce2c85fc3a7d06450a1875 F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35 F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c 97a830d53c24c42290501fdfba4a6e5bdd34748b @@ -327,7 +327,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P d8a8933ff30b83c0483be214403d92c4dfa9a4af -R 208b8157372f7c8db3da02b392e698f6 +P 601c335463aaabc2e9918e4b9298cff6161be5c4 +R 6a5215138c99b7ed11b03e5b976ead6d U danielk1977 -Z 1ece2b1e923caae0853519e926a399e9 +Z 67f8e397461027dcb38f9fe0ac81e736 diff --git a/manifest.uuid b/manifest.uuid index 8b1e95e028..053b700cb8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -601c335463aaabc2e9918e4b9298cff6161be5c4 \ No newline at end of file +3d177bde71811391f79f4ab3bae054ef1bceb6a0 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index f9c853a034..60cfbd482c 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.431 2005/12/09 14:25:08 danielk1977 Exp $ +** @(#) $Id: sqliteInt.h,v 1.432 2005/12/09 14:39:04 danielk1977 Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -245,17 +245,24 @@ extern int sqlite3_iMallocReset; /* Set iMallocFail to this when it reaches 0 */ #define ENTER_MALLOC (\ sqlite3Tsd()->zFile = __FILE__, sqlite3Tsd()->iLine = __LINE__ \ ) -#else -#define ENTER_MALLOC 0 -#endif - -#define sqliteFree(x) sqlite3FreeX(x) #define sqliteMalloc(x) (ENTER_MALLOC, sqlite3Malloc(x)) #define sqliteMallocRaw(x) (ENTER_MALLOC, sqlite3MallocRaw(x)) #define sqliteRealloc(x,y) (ENTER_MALLOC, sqlite3Realloc(x,y)) #define sqliteStrDup(x) (ENTER_MALLOC, sqlite3StrDup(x)) #define sqliteStrNDup(x,y) (ENTER_MALLOC, sqlite3StrNDup(x,y)) +#else + +#define sqliteMalloc(x) sqlite3Malloc(x) +#define sqliteMallocRaw(x) sqlite3MallocRaw(x) +#define sqliteRealloc(x,y) sqlite3Realloc(x,y) +#define sqliteStrDup(x) sqlite3StrDup(x) +#define sqliteStrNDup(x,y) sqlite3StrNDup(x,y) + +#endif + +#define sqliteFree(x) sqlite3FreeX(x) + /* ** An instance of this structure is allocated for each thread that uses SQLite. */ diff --git a/src/test1.c b/src/test1.c index d4e15ac2b6..2e733393fc 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.172 2005/12/09 14:25:08 danielk1977 Exp $ +** $Id: test1.c,v 1.173 2005/12/09 14:39:04 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -3221,8 +3221,10 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ (char*)&sqlite3_current_time, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_os_trace", (char*)&sqlite3_os_trace, TCL_LINK_INT); +#ifdef SQLITE_MEMDEBUG Tcl_LinkVar(interp, "sqlite_malloc_id", (char*)&sqlite3_malloc_id, TCL_LINK_STRING); +#endif #if OS_WIN Tcl_LinkVar(interp, "sqlite_os_type", (char*)&sqlite3_os_type, TCL_LINK_INT); diff --git a/src/util.c b/src/util.c index ac8677a79b..3edc20f4a3 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.150 2005/12/09 14:25:09 danielk1977 Exp $ +** $Id: util.c,v 1.151 2005/12/09 14:39:04 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -1214,7 +1214,7 @@ static SqliteTsd tsd = { #ifndef NDEBUG , 1 /* mallocAllowed flag */ #endif -#ifndef SQLITE_MEMDEBUG +#ifdef SQLITE_MEMDEBUG , 0 , 0 , 0 diff --git a/test/tester.tcl b/test/tester.tcl index 8cc925cd19..e13c8f46e3 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -11,7 +11,7 @@ # This file implements some common TCL routines used for regression # testing the SQLite library # -# $Id: tester.tcl,v 1.53 2005/12/09 14:25:12 danielk1977 Exp $ +# $Id: tester.tcl,v 1.54 2005/12/09 14:39:05 danielk1977 Exp $ # Make sure tclsqlite3 was compiled correctly. Abort now with an # error message if not. @@ -145,7 +145,9 @@ proc finalize_testing {} { catch {db2 close} catch {db3 close} -pp_check_for_leaks + catch { + pp_check_for_leaks + } puts "$nErr errors out of $nTest tests" puts "Failures on these tests: $::failList"