From a578088705b36a291a8928c6604de3be0c4ab6b5 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 20 Jun 2023 00:29:11 +0000 Subject: [PATCH] heim_data_ref_create: Use rk_UNCONST. This API is used for both const and non-const strings, depending on whether there is a deallocator passed or not, so the C type system can't distinguish this for us. XXX Perhaps this should be two separate APIs, one which takes const-qualified pointers and one which takes non-const-qualified pointers. --- lib/base/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/data.c b/lib/base/data.c index cefdde0c1..222cfa3a6 100644 --- a/lib/base/data.c +++ b/lib/base/data.c @@ -116,7 +116,7 @@ heim_data_ref_create(const void *data, size_t length, os = _heim_alloc_object(&_heim_data_object, sizeof(*os) + length); if (os) { - os->data = (void *)data; + os->data = rk_UNCONST(data); os->length = length; deallocp = _heim_get_isaextra(os, 0); *deallocp = dealloc;