From 314d693c4bd4d45f36022e608fa073882f4c9fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 6 May 2024 19:56:44 +0200 Subject: [PATCH] Annotate mbstowcs_nonfatal() with restrict The arguments to our mbrtowc(3) wrapper should not alias, since they also must not for mbrtowc(3). Might help some compilers optimizing the code. --- RichString.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RichString.c b/RichString.c index 248b3ae04..390beb073 100644 --- a/RichString.c +++ b/RichString.c @@ -64,7 +64,7 @@ void RichString_rewind(RichString* this, int count) { #ifdef HAVE_LIBNCURSESW -static size_t mbstowcs_nonfatal(wchar_t* dest, const char* src, size_t n) { +static size_t mbstowcs_nonfatal(wchar_t* restrict dest, const char* restrict src, size_t n) { size_t written = 0; mbstate_t ps = { 0 }; bool broken = false;