net-dns/idnkit: Fix incompatible pointers

Part of modern C conversion

Bug: https://bugs.gentoo.org/919224
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40248
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
NHOrus
2025-01-21 20:34:46 +04:00
committed by Sam James
parent 3aac1a1e88
commit a5e6a6d51e
2 changed files with 32 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
Fix incompatible pointers for modern C, hope that restrict qualifier
holds in this scenario
https://bugs.gentoo.org/919224
--- a/lib/localconverter.c
+++ b/lib/localconverter.c
@@ -599,12 +599,12 @@
inleft = 0;
outbuf = NULL;
outleft = 0;
- iconv(ictx, (const char **)NULL, &inleft, &outbuf, &outleft);
+ iconv(ictx, NULL, &inleft, &outbuf, &outleft);
inleft = strlen(from);
inbuf = from;
outleft = tolen - 1; /* reserve space for terminating NUL */
- sz = iconv(ictx, (const char **)&inbuf, &inleft, &to, &outleft);
+ sz = iconv(ictx, (char ** restrict)&inbuf, &inleft, &to, &outleft);
if (sz == (size_t)(-1) || inleft > 0) {
switch (errno) {
@@ -630,7 +630,7 @@
* Append a sequence of state reset.
*/
inleft = 0;
- sz = iconv(ictx, (const char **)NULL, &inleft, &to, &outleft);
+ sz = iconv(ictx, NULL, &inleft, &to, &outleft);
if (sz == (size_t)(-1)) {
switch (errno) {
case EILSEQ:

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -19,6 +19,8 @@ DEPEND="
dev-lang/perl
"
PATCHES=( "${FILESDIR}"/"${P}"-incompatible-pointers.patch )
src_configure() {
econf $(use_enable liteonly)
}