Remove the sqlite3Assert() function. The ALWAYS() and NEVER() macros call

assert() directly when compiled with SQLITE_DEBUG. (CVS 6809)

FossilOrigin-Name: d8fc373fef22311e1c6b5bce6d3e601217a69940
This commit is contained in:
drh
2009-06-24 10:26:32 +00:00
parent 13bd99fa43
commit 2de80f4c50
4 changed files with 13 additions and 34 deletions
+8 -8
View File
@@ -1,5 +1,5 @@
C Simplify\sthings\sby\srolling\sthe\sfunctionality\sof\sbalance_shallower()\sinto\sbalance_nonroot().\s(CVS\s6808)
D 2009-06-24T05:40:34
C Remove\sthe\ssqlite3Assert()\sfunction.\s\sThe\sALWAYS()\sand\sNEVER()\smacros\scall\nassert()\sdirectly\swhen\scompiled\swith\sSQLITE_DEBUG.\s(CVS\s6809)
D 2009-06-24T10:26:33
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 8b8fb7823264331210cddf103831816c286ba446
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -162,7 +162,7 @@ F src/select.c 71748b8e244112cf73df9446c4246c192276c30d
F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb
F src/sqlite.h.in ccc67f14d5661240d05eadb8ab308aa637b0630c
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h 2dc684cd94560b0de876098e49d8a91996291a76
F src/sqliteInt.h 85f4119ceb7aee69496412d1e03198bafb0beaaa
F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
@@ -201,7 +201,7 @@ F src/tokenize.c eadd396fa81e8031d4b4a65eefd661e9c675167f
F src/trigger.c c07c5157c58fcdb704f65d5f5e4775276e45bb8b
F src/update.c b58db45e40f11082281d6f94137cd3b5657771d9
F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff
F src/util.c a7e981e032c3c9c0887d50d7e658a33cb355b43d
F src/util.c 861d5b5c58be4921f0a254489ea94cb15f550ef8
F src/vacuum.c 0e14f371ea3326c6b8cfba257286d798cd20db59
F src/vdbe.c 5337789f2b481281ec74e6fc0385cf544e074e2b
F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a
@@ -737,7 +737,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
P 1330993de8eae7baeec24100216158063c9bdc19
R a93d21d5217aa847ca2406219efba4db
U danielk1977
Z ce9bb99781cb9e1be1b1a4518af4f1e5
P 11750c6aee6aa05b2627ad9dfb2fbcdfe8944168
R 1548a15900ea46850e3366c7b5ff922c
U drh
Z 58ce472ff48a66bea92a072960001021
+1 -1
View File
@@ -1 +1 @@
11750c6aee6aa05b2627ad9dfb2fbcdfe8944168
d8fc373fef22311e1c6b5bce6d3e601217a69940
+3 -3
View File
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.887 2009/06/23 20:28:54 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.888 2009/06/24 10:26:33 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -268,8 +268,8 @@
# define NEVER(X) (0)
#elif !defined(NDEBUG)
int sqlite3Assert(void);
# define ALWAYS(X) ((X)?1:sqlite3Assert())
# define NEVER(X) ((X)?sqlite3Assert():0)
# define ALWAYS(X) ((X)?1:(assert(0),0))
# define NEVER(X) ((X)?(assert(0),1):0)
#else
# define ALWAYS(X) (X)
# define NEVER(X) (X)
+1 -22
View File
@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.260 2009/06/17 16:20:04 drh Exp $
** $Id: util.c,v 1.261 2009/06/24 10:26:33 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -32,27 +32,6 @@ void sqlite3Coverage(int x){
}
#endif
/*
** Routine needed to support the ALWAYS() and NEVER() macros.
**
** The argument to ALWAYS() should always be true and the argument
** to NEVER() should always be false. If either is not the case
** then this routine is called in order to throw an error.
**
** This routine only exists if assert() is operational. It always
** throws an assert on its first invocation. The variable has a long
** name to help the assert() message be more readable. The variable
** is used to prevent a too-clever optimizer from optimizing out the
** entire call.
*/
#ifndef NDEBUG
int sqlite3Assert(void){
static volatile int ALWAYS_was_false_or_NEVER_was_true = 0;
assert( ALWAYS_was_false_or_NEVER_was_true ); /* Always fails */
return ALWAYS_was_false_or_NEVER_was_true++; /* Not Reached */
}
#endif
/*
** Return true if the floating point value is Not a Number (NaN).
**