qendian_p.h: fix -Wshadow warning
Rename the private member to m_storage. That is more churn than the
alternative of just renaming the ctor argument name, but is more
idiomatic.
This is in preparation of applying headercheck to private headers,
too.
Amends 38002df206.
Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-126219
Change-Id: Id638a4c286f7a0ef6649017904ed190aab2631b2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 7515c21f4badd80c09982901de8dfadf62401a3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
bb10
parent
2143044682
commit
9fc8edb826
|
|
@ -51,16 +51,16 @@ public:
|
|||
operator Type() const noexcept
|
||||
{
|
||||
if constexpr (std::is_signed_v<Type>) {
|
||||
UnsignedType i = S::fromSpecial(storage->val);
|
||||
UnsignedType i = S::fromSpecial(m_storage->val);
|
||||
i <<= (sizeof(Type) * 8) - width - pos;
|
||||
Type t = Type(i);
|
||||
t >>= (sizeof(Type) * 8) - width;
|
||||
return t;
|
||||
}
|
||||
return (S::fromSpecial(storage->val) & mask()) >> pos;
|
||||
return (S::fromSpecial(m_storage->val) & mask()) >> pos;
|
||||
}
|
||||
|
||||
bool operator!() const noexcept { return !(storage->val & S::toSpecial(mask())); }
|
||||
bool operator!() const noexcept { return !(m_storage->val & S::toSpecial(mask())); }
|
||||
|
||||
static constexpr UnsignedType mask() noexcept
|
||||
{
|
||||
|
|
@ -77,21 +77,21 @@ private:
|
|||
friend class QSpecialIntegerBitfieldUnion;
|
||||
friend class QSpecialIntegerAccessor<S, pos, width, T>;
|
||||
|
||||
explicit QSpecialIntegerConstAccessor(Storage *storage) : storage(storage) {}
|
||||
explicit QSpecialIntegerConstAccessor(Storage *storage) : m_storage(storage) {}
|
||||
|
||||
friend bool operator==(const QSpecialIntegerConstAccessor<S, pos, width, T> &i,
|
||||
const QSpecialIntegerConstAccessor<S, pos, width, T> &j) noexcept
|
||||
{
|
||||
return ((i.storage->val ^ j.storage->val) & S::toSpecial(mask())) == 0;
|
||||
return ((i.m_storage->val ^ j.m_storage->val) & S::toSpecial(mask())) == 0;
|
||||
}
|
||||
|
||||
friend bool operator!=(const QSpecialIntegerConstAccessor<S, pos, width, T> &i,
|
||||
const QSpecialIntegerConstAccessor<S, pos, width, T> &j) noexcept
|
||||
{
|
||||
return ((i.storage->val ^ j.storage->val) & S::toSpecial(mask())) != 0;
|
||||
return ((i.m_storage->val ^ j.m_storage->val) & S::toSpecial(mask())) != 0;
|
||||
}
|
||||
|
||||
Storage *storage;
|
||||
Storage *m_storage;
|
||||
};
|
||||
|
||||
template<class S, int pos, int width, class T>
|
||||
|
|
@ -106,22 +106,22 @@ public:
|
|||
|
||||
QSpecialIntegerAccessor &operator=(Type t)
|
||||
{
|
||||
UnsignedType i = S::fromSpecial(storage->val);
|
||||
UnsignedType i = S::fromSpecial(m_storage->val);
|
||||
i &= ~Const::mask();
|
||||
i |= (UnsignedType(t) << pos) & Const::mask();
|
||||
storage->val = S::toSpecial(i);
|
||||
m_storage->val = S::toSpecial(i);
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator Const() { return Const(storage); }
|
||||
operator Const() { return Const(m_storage); }
|
||||
|
||||
private:
|
||||
template<class Storage, typename... Accessors>
|
||||
friend class QSpecialIntegerBitfieldUnion;
|
||||
|
||||
explicit QSpecialIntegerAccessor(Storage *storage) : storage(storage) {}
|
||||
explicit QSpecialIntegerAccessor(Storage *storage) : m_storage(storage) {}
|
||||
|
||||
Storage *storage;
|
||||
Storage *m_storage;
|
||||
};
|
||||
|
||||
template<class S, typename... Accessors>
|
||||
|
|
|
|||
Loading…
Reference in New Issue