mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Small fix
This commit is contained in:
parent
317417d541
commit
c0fdef7a12
@ -68,14 +68,16 @@ namespace vm
|
||||
return m_addr != 0;
|
||||
}
|
||||
|
||||
// test address alignment using alignof(T)
|
||||
bool aligned() const
|
||||
{
|
||||
return m_addr % alignof32(T) == 0;
|
||||
}
|
||||
|
||||
bool operator %(to_ne_t<AT> alignment)
|
||||
// test address for arbitrary alignment or something
|
||||
force_inline explicit_bool_t operator %(to_ne_t<AT> right) const
|
||||
{
|
||||
return m_addr % alignment != 0;
|
||||
return m_addr % right;
|
||||
}
|
||||
|
||||
_ptr_base& operator =(const _ptr_base&) = default;
|
||||
|
@ -61,6 +61,22 @@ template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>> in
|
||||
return static_cast<T>((value + (align - 1)) & ~(align - 1));
|
||||
}
|
||||
|
||||
// bool wrapper for restricting bool result conversions
|
||||
struct explicit_bool_t
|
||||
{
|
||||
const bool value;
|
||||
|
||||
explicit_bool_t(bool value)
|
||||
: value(value)
|
||||
{
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
// return 32 bit sizeof() to avoid widening/narrowing conversions with size_t
|
||||
#define sizeof32(type) sizeof32_t<sizeof(type)>::value
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user