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>
This commit is contained in:
parent
3193ab5807
commit
58393ca733
@ -41,8 +41,6 @@ extern "C" {
|
|||||||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STRING(s) #s
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compile-time copy of hardcoded arrays.
|
* Compile-time copy of hardcoded arrays.
|
||||||
*
|
*
|
||||||
@ -56,7 +54,7 @@ do { \
|
|||||||
"src and dst sizes must match"); \
|
"src and dst sizes must match"); \
|
||||||
static_assert(sizeof(src) == sizeof(dst), \
|
static_assert(sizeof(src) == sizeof(dst), \
|
||||||
"src and dst sizes must match"); \
|
"src and dst sizes must match"); \
|
||||||
memcpy((src), (dst), sizeof(src)); \
|
memcpy((dst), (src), sizeof(src)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user