diff options
| author | Giel van Schijndel <[email protected]> | 2011-06-24 19:56:23 +0200 |
|---|---|---|
| committer | Giel van Schijndel <[email protected]> | 2011-07-13 05:07:44 +0200 |
| commit | ecf1c79aada222ccbf93b0f15d98339431d1a881 (patch) | |
| tree | 7a338d5d98e085b5fe521c11bf3e0a438e5e6add /src/script.h | |
| parent | fix warning on 64bit systems: cast to pointer from integer of different size ... (diff) | |
| download | discoin-ecf1c79aada222ccbf93b0f15d98339431d1a881.tar.xz discoin-ecf1c79aada222ccbf93b0f15d98339431d1a881.zip | |
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 <[email protected]>
Diffstat (limited to 'src/script.h')
| -rw-r--r-- | src/script.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script.h b/src/script.h index ae9fdfffa..2a36db2fa 100644 --- a/src/script.h +++ b/src/script.h @@ -486,7 +486,7 @@ public: { // I'm not sure if this should push the script or concatenate scripts. // If there's ever a use for pushing a script onto a script, delete this member fn - assert(("warning: pushing a CScript onto a CScript with << is probably not intended, use + to concatenate", false)); + assert(!"warning: pushing a CScript onto a CScript with << is probably not intended, use + to concatenate"); return *this; } |