diff --git a/debian/copyright b/debian/copyright index 458bfc219..ee92f3601 100644 --- a/debian/copyright +++ b/debian/copyright @@ -183,19 +183,3 @@ License: MIT style LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Files: spot/priv/enumflags.hh -Copyright: 2006, 2014 Petr Ročkai - 2013-2015 Vladimír Štill -License: ICS License - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/spot/priv/Makefile.am b/spot/priv/Makefile.am index c065a98fa..09c35cb1c 100644 --- a/spot/priv/Makefile.am +++ b/spot/priv/Makefile.am @@ -1,6 +1,6 @@ ## -*- coding: utf-8 -*- -## Copyright (C) 2013, 2014, 2015, 2016 Laboratoire de Recherche et -## Développement de l'Epita (LRDE). +## Copyright (C) 2013, 2014, 2015, 2016, 2017 Laboratoire de Recherche +## et Développement de l'Epita (LRDE). ## ## This file is part of Spot, a model checking library. ## @@ -25,7 +25,6 @@ libpriv_la_SOURCES = \ accmap.hh \ bddalloc.cc \ bddalloc.hh \ - enumflags.hh \ freelist.cc \ freelist.hh \ satcommon.hh\ diff --git a/spot/priv/enumflags.hh b/spot/priv/enumflags.hh deleted file mode 100644 index 838e7cee5..000000000 --- a/spot/priv/enumflags.hh +++ /dev/null @@ -1,117 +0,0 @@ -// -*- coding: utf-8 -*- -// Copyright (C) 2006, 2014 Petr Ročkai -// Copyright (C) 2013-2015 Vladimír Štill -// Copyright (C) 2017 Henrich Lauko -// -// This file is a modification of brick-types file from brick library. -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -#pragma once - -#include - -namespace spot -{ - template - using is_enum_class = std::integral_constant::value && !std::is_convertible::value>; - - template - struct strong_enum_flags { - static_assert(is_enum_class::value, "Not an enum class."); - using type = strong_enum_flags; - using underlying_type = typename std::underlying_type::type; - - constexpr strong_enum_flags() noexcept : store(0) {} - constexpr strong_enum_flags(self flag) noexcept : - store(static_cast(flag)) - {} - - explicit constexpr strong_enum_flags(underlying_type st) noexcept - : store(st) {} - - constexpr explicit operator underlying_type() const noexcept - { - return store; - } - - type &operator|=(type o) noexcept - { - store |= o.store; - return *this; - } - - type &operator&=(type o) noexcept - { - store &= o.store; - return *this; - } - - type &operator^=(type o) noexcept - { - store ^= o.store; - return *this; - } - - friend constexpr type operator~(type a) - { - return type(~a.store); - } - - friend constexpr type operator|(type a, type b) noexcept - { - return type(a.store | b.store); - } - - friend constexpr type operator&(type a, type b) noexcept - { - return type(a.store & b.store); - } - - friend constexpr type operator^(type a, type b) noexcept - { - return type(a.store ^ b.store); - } - - friend constexpr bool operator==(type a, type b) noexcept - { - return a.store == b.store; - } - - friend constexpr bool operator!=(type a, type b) noexcept - { - return a.store != b.store; - } - - - constexpr bool has(self x) const noexcept - { - return ((*this) &x); - } - - type clear(self x) noexcept - { - store &= ~underlying_type(x); - return *this; - } - - explicit constexpr operator bool() const noexcept - { - return store; - } - - private: - underlying_type store; - }; -} diff --git a/spot/twaalgos/remfin.cc b/spot/twaalgos/remfin.cc index 9eb0aecfe..a803954ed 100644 --- a/spot/twaalgos/remfin.cc +++ b/spot/twaalgos/remfin.cc @@ -25,7 +25,6 @@ #include #include #include -#include "spot/priv/enumflags.hh" // #define TRACE #ifdef TRACE @@ -38,21 +37,20 @@ namespace spot { namespace { - enum class strategy_t : unsigned + enum strategy_t { - trivial = 1, - weak = 2, - alternation = 4, - rabin = 8, - streett = 16, + trivial = 1U, + weak = 2U, + alternation = 4U, + rabin = 8U, + streett = 16U, }; - using strategy_flags = strong_enum_flags; using strategy = std::function; twa_graph_ptr - remove_fin_impl(const const_twa_graph_ptr&, const strategy_flags); + remove_fin_impl(const const_twa_graph_ptr&, const strategy_t); using EdgeMask = std::vector; @@ -759,11 +757,11 @@ namespace spot } twa_graph_ptr remove_fin_impl(const const_twa_graph_ptr& aut, - const strategy_flags skip = {}) + const strategy_t skip = {}) { - auto handle = [&](strategy stra, strategy_t type) + auto handle = [&](strategy stra, strategy_t type) -> twa_graph_ptr { - return (type & ~skip) ? stra(aut) : nullptr; + return (type & skip) ? nullptr : stra(aut); }; if (auto maybe = handle(trivial_strategy, strategy_t::trivial))