mark custom hash functions as noexcept
* spot/misc/bitvect.cc, spot/misc/bitvect.hh, spot/misc/hash.hh, spot/twa/acc.hh, spot/twaalgos/cobuchi.cc, spot/twaalgos/degen.cc, spot/twaalgos/determinize.cc, spot/twaalgos/parity.cc, spot/twaalgos/powerset.cc, spot/twaalgos/product.cc, spot/twaalgos/stutter.cc, spot/twaalgos/totgba.cc, spot/twaalgos/toweak.cc: Mark hash function as noexcept to please GCC snapshot.
This commit is contained in:
parent
7f5c1d3707
commit
31387e8f71
13 changed files with 32 additions and 31 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2013, 2014, 2017 Laboratoire de Recherche et Développement
|
// Copyright (C) 2013, 2014, 2017, 2018 Laboratoire de Recherche et
|
||||||
// de l'Epita (LRDE).
|
// Développement de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -115,7 +115,7 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t bitvect::hash() const
|
size_t bitvect::hash() const noexcept
|
||||||
{
|
{
|
||||||
|
|
||||||
block_t res = fnv<sizeof(block_t)>::init();
|
block_t res = fnv<sizeof(block_t)>::init();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2013-2017 Laboratoire de Recherche et Développement
|
// Copyright (C) 2013-2018 Laboratoire de Recherche et Développement
|
||||||
// de l'Epita (LRDE).
|
// de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -156,7 +156,7 @@ namespace spot
|
||||||
return 8 * block_count_ * sizeof(block_t);
|
return 8 * block_count_ * sizeof(block_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t hash() const;
|
size_t hash() const noexcept;
|
||||||
|
|
||||||
bool get(size_t pos) const
|
bool get(size_t pos) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2008, 2011, 2014, 2015 Laboratoire de Recherche et
|
// Copyright (C) 2008, 2011, 2014, 2015, 2018 Laboratoire de Recherche et
|
||||||
// Développement de l'Epita (LRDE).
|
// Développement de l'Epita (LRDE).
|
||||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
|
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
|
||||||
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
|
|
@ -46,7 +46,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t operator()(const T* p) const
|
size_t operator()(const T* p) const noexcept
|
||||||
{
|
{
|
||||||
return knuth32_hash(reinterpret_cast<const char*>(p)
|
return knuth32_hash(reinterpret_cast<const char*>(p)
|
||||||
- static_cast<const char*>(nullptr));
|
- static_cast<const char*>(nullptr));
|
||||||
|
|
@ -63,13 +63,13 @@ namespace spot
|
||||||
struct identity_hash:
|
struct identity_hash:
|
||||||
public std::unary_function<const T&, size_t>
|
public std::unary_function<const T&, size_t>
|
||||||
{
|
{
|
||||||
// A default constructor is needed if the string_hash object is
|
// A default constructor is needed if the identity_hash object is
|
||||||
// stored in a const member.
|
// stored in a const member.
|
||||||
identity_hash()
|
identity_hash()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t operator()(const T& s) const
|
size_t operator()(const T& s) const noexcept
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +79,7 @@ namespace spot
|
||||||
struct pair_hash
|
struct pair_hash
|
||||||
{
|
{
|
||||||
template<typename T, typename U>
|
template<typename T, typename U>
|
||||||
std::size_t operator()(const std::pair<T, U> &p) const
|
std::size_t operator()(const std::pair<T, U> &p) const noexcept
|
||||||
{
|
{
|
||||||
std::hash<T> th;
|
std::hash<T> th;
|
||||||
std::hash<U> uh;
|
std::hash<U> uh;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2014, 2015, 2016, 2017 Laboratoire de Recherche et
|
// Copyright (C) 2014-2018 Laboratoire de Recherche et Développement
|
||||||
// Développement de l'Epita.
|
// de l'Epita.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -1526,7 +1526,7 @@ namespace std
|
||||||
template<>
|
template<>
|
||||||
struct hash<spot::acc_cond::mark_t>
|
struct hash<spot::acc_cond::mark_t>
|
||||||
{
|
{
|
||||||
size_t operator()(spot::acc_cond::mark_t m) const
|
size_t operator()(spot::acc_cond::mark_t m) const noexcept
|
||||||
{
|
{
|
||||||
std::hash<decltype(m.id)> h;
|
std::hash<decltype(m.id)> h;
|
||||||
return h(m.id);
|
return h(m.id);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2017 Laboratoire de Recherche et Développement
|
// Copyright (C) 2017, 2018 Laboratoire de Recherche et Développement
|
||||||
// de l'Epita (LRDE).
|
// de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -292,7 +292,8 @@ namespace spot
|
||||||
{
|
{
|
||||||
struct mp_hash
|
struct mp_hash
|
||||||
{
|
{
|
||||||
size_t operator()(std::pair<unsigned, const bitvect_array*> bv) const
|
size_t
|
||||||
|
operator()(std::pair<unsigned, const bitvect_array*> bv) const noexcept
|
||||||
{
|
{
|
||||||
size_t res = 0;
|
size_t res = 0;
|
||||||
size_t size = bv.second->size();
|
size_t size = bv.second->size();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2012-2017 Laboratoire de Recherche
|
// Copyright (C) 2012-2018 Laboratoire de Recherche
|
||||||
// et Développement de l'Epita (LRDE).
|
// et Développement de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -44,7 +44,7 @@ namespace spot
|
||||||
struct degen_state_hash
|
struct degen_state_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(const degen_state& s) const
|
operator()(const degen_state& s) const noexcept
|
||||||
{
|
{
|
||||||
return wang32_hash(s.first ^ wang32_hash(s.second));
|
return wang32_hash(s.first ^ wang32_hash(s.second));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2015-2017 Laboratoire de Recherche et
|
// Copyright (C) 2015-2018 Laboratoire de Recherche et
|
||||||
// Développement de l'Epita.
|
// Développement de l'Epita.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -115,7 +115,7 @@ namespace spot
|
||||||
struct hash_safra
|
struct hash_safra
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(const safra_state& s) const
|
operator()(const safra_state& s) const noexcept
|
||||||
{
|
{
|
||||||
return s.hash();
|
return s.hash();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -427,7 +427,7 @@ namespace spot
|
||||||
struct state_history_hash
|
struct state_history_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(const state_history& mat) const
|
operator()(const state_history& mat) const noexcept
|
||||||
{
|
{
|
||||||
unsigned result = 0;
|
unsigned result = 0;
|
||||||
for (unsigned i = 0; i < mat.get_left_num_sets(); ++i)
|
for (unsigned i = 0; i < mat.get_left_num_sets(); ++i)
|
||||||
|
|
@ -493,7 +493,7 @@ namespace spot
|
||||||
struct sh_succ_hash
|
struct sh_succ_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(std::tuple<sh_label_t, value_t, value_t> x) const
|
operator()(std::tuple<sh_label_t, value_t, value_t> x) const noexcept
|
||||||
{
|
{
|
||||||
return wang32_hash(std::get<0>(x) ^ wang32_hash(std::get<1>(x)
|
return wang32_hash(std::get<0>(x) ^ wang32_hash(std::get<1>(x)
|
||||||
^ wang32_hash(std::get<2>(x))));
|
^ wang32_hash(std::get<2>(x))));
|
||||||
|
|
@ -510,7 +510,7 @@ namespace spot
|
||||||
struct product_state_hash
|
struct product_state_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(product_state_t s) const
|
operator()(product_state_t s) const noexcept
|
||||||
{
|
{
|
||||||
return wang32_hash(std::get<0>(s) ^ wang32_hash(std::get<1>(s)
|
return wang32_hash(std::get<0>(s) ^ wang32_hash(std::get<1>(s)
|
||||||
^ wang32_hash(std::get<2>(s))));
|
^ wang32_hash(std::get<2>(s))));
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2009-2011, 2013-2017 Laboratoire de Recherche et
|
// Copyright (C) 2009-2011, 2013-2018 Laboratoire de Recherche et
|
||||||
// Développement de l'Epita (LRDE).
|
// Développement de l'Epita (LRDE).
|
||||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
|
|
@ -56,7 +56,7 @@ namespace spot
|
||||||
|
|
||||||
struct bv_hash
|
struct bv_hash
|
||||||
{
|
{
|
||||||
size_t operator()(const bitvect* bv) const
|
size_t operator()(const bitvect* bv) const noexcept
|
||||||
{
|
{
|
||||||
return bv->hash();
|
return bv->hash();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2014-2017 Laboratoire de Recherche et Développement
|
// Copyright (C) 2014-2018 Laboratoire de Recherche et Développement
|
||||||
// de l'Epita (LRDE).
|
// de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -33,7 +33,7 @@ namespace spot
|
||||||
struct product_state_hash
|
struct product_state_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(product_state s) const
|
operator()(product_state s) const noexcept
|
||||||
{
|
{
|
||||||
return wang32_hash(s.first ^ wang32_hash(s.second));
|
return wang32_hash(s.first ^ wang32_hash(s.second));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- 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 (LRDE).
|
// l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -255,7 +255,7 @@ namespace spot
|
||||||
struct stutter_state_hash
|
struct stutter_state_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(const stutter_state& s) const
|
operator()(const stutter_state& s) const noexcept
|
||||||
{
|
{
|
||||||
return wang32_hash(s.first) ^ wang32_hash(s.second.id());
|
return wang32_hash(s.first) ^ wang32_hash(s.second.id());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ namespace spot
|
||||||
struct st2gba_state_hash
|
struct st2gba_state_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(const st2gba_state& s) const
|
operator()(const st2gba_state& s) const noexcept
|
||||||
{
|
{
|
||||||
std::hash<acc_cond::mark_t> h;
|
std::hash<acc_cond::mark_t> h;
|
||||||
return s.s ^ h(s.pend);
|
return s.s ^ h(s.pend);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2017 Laboratoire de Recherche et Développement
|
// Copyright (C) 2017, 2018 Laboratoire de Recherche et Développement
|
||||||
// de l'Epita (LRDE).
|
// de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -46,7 +46,7 @@ namespace spot
|
||||||
struct rc_state_hash
|
struct rc_state_hash
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
operator()(const rc_state& s) const
|
operator()(const rc_state& s) const noexcept
|
||||||
{
|
{
|
||||||
using std::hash;
|
using std::hash;
|
||||||
return ((hash<int>()(s.id)
|
return ((hash<int>()(s.id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue