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>
This commit is contained in:
Giel van Schijndel
2011-06-24 19:56:23 +02:00
parent df40181417
commit ecf1c79aad
4 changed files with 6 additions and 6 deletions

View File

@@ -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;
}