misc: fix some down_cast issues

We had new failure on MinGW with GCC believing that some pointer
returned by down_cast could be NULL; and the down_cast function was in
the global namespace.

* spot/misc/casts.hh: Rewrite.
* NEWS: Mention the small issues.
* tests/core/ikwiad.cc, tests/core/ngraph.cc: Adjust to use
spot::down_cast instead of down_cast.
This commit is contained in:
Alexandre Duret-Lutz 2018-01-10 17:30:25 +01:00
parent 91fdc5ecb2
commit 8a74ae6c9d
4 changed files with 30 additions and 102 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014-2017 Laboratoire de Recherche et Développement de
// Copyright (C) 2014-2018 Laboratoire de Recherche et Développement de
// l'Epita.
//
// This file is part of Spot, a model checking library.
@ -347,7 +347,7 @@ public:
int compare(const spot::state* other) const override
{
auto o = down_cast<const my_state*>(other);
auto o = spot::down_cast<const my_state*>(other);
// Do not simply return "other - this", it might not fit in an int.
if (o < this)