From 58393ca7331f34174254f767911f8b8062eab265 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Wed, 28 Apr 2021 10:43:27 -0300 Subject: [PATCH] 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 --- shared/helpers.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared/helpers.h b/shared/helpers.h index eb0a8f78..1688b8ea 100644 --- a/shared/helpers.h +++ b/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