diff options
author | Giel van Schijndel <me@mortis.eu> | 2011-06-24 19:56:23 +0200 |
---|---|---|
committer | Giel van Schijndel <me@mortis.eu> | 2011-07-13 05:07:44 +0200 |
commit | ecf1c79aada222ccbf93b0f15d98339431d1a881 (patch) | |
tree | 7a338d5d98e085b5fe521c11bf3e0a438e5e6add /src/db.h | |
parent | df4018141752de57cd7ce59ef556f541016facc1 (diff) |
fix warnings: expression result unused [-Wunused-value]
In the assert()s take advantage of the fact that string constants
("string") are effectively of type 'const char []', which when used in
an expression yield a non-NULL pointer.
An assertion that should always fail can thus be formulated as:
assert(!"fail);
An assertion where a text message should be added to the expression can
be written as such:
assert("message" && expression);
Signed-off-by: Giel van Schijndel <me@mortis.eu>
Diffstat (limited to 'src/db.h')
-rw-r--r-- | src/db.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -88,7 +88,7 @@ protected: if (!pdb) return false; if (fReadOnly) - assert(("Write called on database in read-only mode", false)); + assert(!"Write called on database in read-only mode"); // Key CDataStream ssKey(SER_DISK); @@ -117,7 +117,7 @@ protected: if (!pdb) return false; if (fReadOnly) - assert(("Erase called on database in read-only mode", false)); + assert(!"Erase called on database in read-only mode"); // Key CDataStream ssKey(SER_DISK); |