shared/helpers: fix ARRAY_COPY macro

In commit "backend-drm: simplify compile time array copy", the macro
ARRAY_COPY was introduced.

The macro STRING was accidentally introduced in the same commit, and as
it is completely unnecessary, remove it.

Also, memcpy was copying from src to dst, and it should do the opposite.
So fix it.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
dev
Leandro Ribeiro 3 years ago
parent 3193ab5807
commit 58393ca733
  1. 4
      shared/helpers.h

@ -41,8 +41,6 @@ extern "C" {
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
#endif
#define STRING(s) #s
/**
* Compile-time copy of hardcoded arrays.
*
@ -56,7 +54,7 @@ do { \
"src and dst sizes must match"); \
static_assert(sizeof(src) == sizeof(dst), \
"src and dst sizes must match"); \
memcpy((src), (dst), sizeof(src)); \
memcpy((dst), (src), sizeof(src)); \
} while (0)
#endif

Loading…
Cancel
Save