From 7ac36f22a5ee77e6516ba65ce6ef9dabb9825be1 Mon Sep 17 00:00:00 2001 From: NHOrus Date: Sat, 1 Mar 2025 13:27:14 +0400 Subject: [PATCH] sci-libs/cfitsio: port to C23 Rename nullptr to ptr_to_null, as it points to null in string, not is pointer that is null. Closes: https://bugs.gentoo.org/943959 Closes: https://bugs.gentoo.org/944747 Signed-off-by: NHOrus Closes: https://github.com/gentoo/gentoo/pull/40826 Signed-off-by: Sam James --- sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild | 73 +++++++++++++++++++ .../files/cfitsio-4.5.0-rename-nullptr.patch | 51 +++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild create mode 100644 sci-libs/cfitsio/files/cfitsio-4.5.0-rename-nullptr.patch diff --git a/sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild b/sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild new file mode 100644 index 0000000000000..c50383b466700 --- /dev/null +++ b/sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake-multilib fortran-2 + +DESCRIPTION="C and Fortran library for manipulating FITS files" +HOMEPAGE="https://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html" +SRC_URI="https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/${P}.tar.gz" + +LICENSE="ISC" +SLOT="0/10-r1" +KEYWORDS="~alpha ~amd64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="bzip2 curl test tools" +RESTRICT="!test? ( test )" + +BDEPEND=" + app-alternatives/yacc + app-alternatives/lex +" +RDEPEND=" + sys-libs/zlib[${MULTILIB_USEDEP}] + bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] ) + curl? ( net-misc/curl[${MULTILIB_USEDEP}] ) +" +# Bug #803350 +DEPEND=" + ${RDEPEND} + 0) + return(*status); +@@ -2081,24 +2081,24 @@ + { + stringptr = cols[jj].array; + dataptr = stringptr + 1; +- nullptr = *stringptr; ++ ptr_to_null = *stringptr; + nbytes = 2; + } + else + { + dataptr = (char *) cols[jj].array + col[jj].nullsize; +- nullptr = (char *) cols[jj].array; ++ ptr_to_null = (char *) cols[jj].array; + nbytes = col[jj].nullsize; + } + +- if (memcmp(nullptr, &zeros, nbytes) ) ++ if (memcmp(ptr_to_null, &zeros, nbytes) ) + { + /* null value flag not zero; must check for and write nulls */ + if (hdutype == IMAGE_HDU) + { + if (ffppn(cols[jj].fptr, cols[jj].datatype, + felement, cols[jj].repeat * ntodo, dataptr, +- nullptr, &tstatus) > 0) ++ ptr_to_null, &tstatus) > 0) + break; + } + else +@@ -2113,7 +2113,7 @@ + + if (ffpcn(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow, + felement, cols[jj].repeat * ntodo, dataptr, +- nullptr, &tstatus) > 0) ++ ptr_to_null, &tstatus) > 0) + break; + } + }