Define the sqliteMalloc() macro differently to avoid a compiler warning. (CVS 2809)
FossilOrigin-Name: 3d177bde71811391f79f4ab3bae054ef1bceb6a0
This commit is contained in:
+13
-6
@@ -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.
|
||||
*/
|
||||
|
||||
+3
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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 <stdarg.h>
|
||||
@@ -1214,7 +1214,7 @@ static SqliteTsd tsd = {
|
||||
#ifndef NDEBUG
|
||||
, 1 /* mallocAllowed flag */
|
||||
#endif
|
||||
#ifndef SQLITE_MEMDEBUG
|
||||
#ifdef SQLITE_MEMDEBUG
|
||||
, 0
|
||||
, 0
|
||||
, 0
|
||||
|
||||
Reference in New Issue
Block a user