Commit 81f146f6 authored by Jérôme Dubois's avatar Jérôme Dubois Committed by Alexandre Duret-Lutz
Browse files

build: fix multiple Clang13 warnings

* spot/kripke/kripkegraph.hh, spot/misc/hash.hh, spot/twa/taatgba.cc,
  spot/twa/twagraph.hh, tests/core/ngraph.cc: Replace subtraction of
  pointeur minus nullptr by an explicit cast to size_t.
* spot/twa/acc.hh: Add explicit default copy assignment operator for
  rs_pair.
parent 2a408bbe
Pipeline #31425 failed with stages
in 168 minutes and 55 seconds
......@@ -64,8 +64,7 @@ namespace spot
virtual size_t hash() const override
{
return
reinterpret_cast<const char*>(this) - static_cast<const char*>(nullptr);
return reinterpret_cast<size_t>(this);
}
virtual kripke_graph_state*
......
......@@ -48,8 +48,7 @@ namespace spot
size_t operator()(const T* p) const noexcept
{
return knuth32_hash(reinterpret_cast<const char*>(p)
- static_cast<const char*>(nullptr));
return knuth32_hash(reinterpret_cast<size_t>(p));
}
};
......
......@@ -1670,6 +1670,7 @@ namespace spot
#ifndef SWIG
rs_pair() = default;
rs_pair(const rs_pair&) = default;
rs_pair& operator=(const rs_pair&) = default;
#endif
rs_pair(acc_cond::mark_t fin, acc_cond::mark_t inf) noexcept:
......
......@@ -105,7 +105,7 @@ namespace spot
taa_tgba::state_set::const_iterator it = s_->begin();
while (it != s_->end())
{
res ^= reinterpret_cast<const char*>(*it++) - static_cast<char*>(nullptr);
res ^= reinterpret_cast<size_t>(*it++);
res = wang32_hash(res);
}
return res;
......
......@@ -70,8 +70,7 @@ namespace spot
virtual size_t hash() const override
{
return
reinterpret_cast<const char*>(this) - static_cast<const char*>(nullptr);
return reinterpret_cast<size_t>(this);
}
virtual twa_graph_state*
......
......@@ -372,8 +372,7 @@ public:
size_t hash() const override
{
return
reinterpret_cast<const char*>(this) - static_cast<const char*>(nullptr);
return reinterpret_cast<size_t>(this);
}
my_state* clone() const override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment