mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Avoid using memcpy() to copy structs
We can just use a regular assignment instead. This is more type-safe since there is no need to provide the struct size. The remaining memcpy() calls perform array copies or copies from void pointers (which may be unaligned).
This commit is contained in:
parent
77dc1c28aa
commit
c74f89d4f8
6 changed files with 7 additions and 7 deletions
|
|
@ -15,7 +15,7 @@ void wlr_dmabuf_attributes_finish(struct wlr_dmabuf_attributes *attribs) {
|
|||
|
||||
bool wlr_dmabuf_attributes_copy(struct wlr_dmabuf_attributes *dst,
|
||||
const struct wlr_dmabuf_attributes *src) {
|
||||
memcpy(dst, src, sizeof(struct wlr_dmabuf_attributes));
|
||||
*dst = *src;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < src->n_planes; ++i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue