aco: Fix -Wstringop-overflow warnings in aco_span.
GCC does not understand how aco_span works. This patch fixes it by casting the aco_span's this pointer to uintptr_t rather than to a char pointer, effectively telling GCC not to try to figure it out. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3483>
This commit is contained in:
@@ -65,14 +65,14 @@ public:
|
||||
* \return data
|
||||
*/
|
||||
constexpr iterator begin() noexcept {
|
||||
return (pointer)((char*)this + offset);
|
||||
return (pointer)((uintptr_t)this + offset);
|
||||
}
|
||||
|
||||
/*! \brief Returns a const_iterator to the begin of the span
|
||||
* \return data
|
||||
*/
|
||||
constexpr const_iterator begin() const noexcept {
|
||||
return (const_pointer)((const char *)this + offset);
|
||||
return (const_pointer)((uintptr_t)this + offset);
|
||||
}
|
||||
|
||||
/*! \brief Returns an iterator to the end of the span
|
||||
|
Reference in New Issue
Block a user