mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 16:45:07 +03:00
libcamera: controls: Fix strict aliasing violation
gcc 8.3.0 for ARM complains about strict aliasing violations: ../../src/libcamera/controls.cpp: In member function ‘void libcamera::ControlValue::release()’: ../../src/libcamera/controls.cpp:111:13: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] delete[] *reinterpret_cast<char **>(&storage_); Fix it and simplify the code at the same time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
291d4878bb
commit
4de31ccc9e
2 changed files with 14 additions and 11 deletions
|
@ -160,7 +160,10 @@ private:
|
|||
ControlType type_ : 8;
|
||||
bool isArray_ : 1;
|
||||
std::size_t numElements_ : 16;
|
||||
uint64_t storage_;
|
||||
union {
|
||||
uint64_t value_;
|
||||
void *storage_;
|
||||
};
|
||||
|
||||
void release();
|
||||
void set(ControlType type, bool isArray, const void *data,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue