In theory, this function returns the number of 'Span's in the newly
constructed 'Span' array, so it must be a non-negative integer number
that fits into 32 bits and the cast is safe.
In practice, 'x0' variable stays unchanged in this function, while
'x' variable's value can only increase: whenever it can be (conditionally)
decremented, it is always unconditionally incremented. So 'x - x0'
must be non-negative.
Fixes [-Wconversion] warning.
if (nf == 0 && nb == 0)
{
- return x - x0;
+ return static_cast<uint32_t> (x - x0);
}
}