From a8a23e4d8506e5f5a70b46fcca9c1025e0eb07db Mon Sep 17 00:00:00 2001 From: Juan Carrano <j.carrano@fu-berlin.de> Date: Thu, 18 Oct 2018 11:15:22 +0200 Subject: [PATCH] pkg/lua/contrib: Fix warning on discarded qualifier. There was a cast in a macro that calculated offsets. Since it was only doing a pointer difference, the cast was inocuous, but I fix it anyways. --- pkg/lua/contrib/binsearch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/lua/contrib/binsearch.h b/pkg/lua/contrib/binsearch.h index 9be7ca3db4..dad65da1e2 100644 --- a/pkg/lua/contrib/binsearch.h +++ b/pkg/lua/contrib/binsearch.h @@ -60,14 +60,14 @@ extern "C" { * UNSAFE MACRO: Difference in bytes between the addresses of two consecutive * array elements. */ -#define _ARRAY_STRIDE(arr) ((size_t)((uint8_t *)((arr) + 1) - (uint8_t *)(arr))) +#define _ARRAY_STRIDE(arr) ((size_t)((const uint8_t *)((arr) + 1) - (const uint8_t *)(arr))) /** * UNSAFE MACRO: Offset in bytes from the start of the array to member "member" * of the first element. */ #define _ARRAY_MEMBER_OFFS(arr, member) \ - ((size_t)((uint8_t *)(&((arr)->member)) - (uint8_t *)(arr))) + ((size_t)((const uint8_t *)(&((arr)->member)) - (const uint8_t *)(arr))) /** * Find the index of the array element that contains "str" in -- GitLab