Backport upstream patch to fix C compatibility issue

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2024-01-03 11:14:39 +01:00
parent 39bf539164
commit a41e562922
2 changed files with 31 additions and 1 deletions

24
gutenprint-c99.patch Normal file
View File

@ -0,0 +1,24 @@
commit 75af7caf4d3369de2d0c5432220da15fae64f58b
Author: Solomon Peachy <pizza@shaftnet.org>
Date: Fri Dec 22 08:56:32 2023 -0500
gimpui: Fix two implicit-pointer-cast-to-int instances
(The GIMP API uses an opaque 32-bit "handle")
diff --git a/src/gimp2/print.c b/src/gimp2/print.c
index fc1344f6..2ebdb352 100644
--- a/src/gimp2/print.c
+++ b/src/gimp2/print.c
@@ -114,8 +114,8 @@ stpui_get_thumbnail_data_function(void *image_ID, gint *width, gint *height,
{
if (gimp_thumbnail_data)
g_free(gimp_thumbnail_data);
- gint x = gimp_image_width(image_ID);
- gint y = gimp_image_height(image_ID);
+ gint x = gimp_image_width(p2gint(image_ID));
+ gint y = gimp_image_height(p2gint(image_ID));
if (*width > x)
*width = x;
if (*height > y)

View File

@ -25,7 +25,7 @@
Name: gutenprint Name: gutenprint
Summary: Printer Drivers Package Summary: Printer Drivers Package
Version: 5.3.4 Version: 5.3.4
Release: 13%{?dist} Release: 14%{?dist}
URL: http://gimp-print.sourceforge.net/ URL: http://gimp-print.sourceforge.net/
Source0: http://downloads.sourceforge.net/gimp-print/%{name}-%{version}.tar.xz Source0: http://downloads.sourceforge.net/gimp-print/%{name}-%{version}.tar.xz
# Post-install script to update CUPS native PPDs. # Post-install script to update CUPS native PPDs.
@ -38,6 +38,7 @@ Patch3: gutenprint-manpage.patch
Patch4: gutenprint-python36syntax.patch Patch4: gutenprint-python36syntax.patch
Patch5: gutenprint-xmlfixes.patch Patch5: gutenprint-xmlfixes.patch
Patch6: gutenprint-libusb-crash.patch Patch6: gutenprint-libusb-crash.patch
Patch7: gutenprint-c99.patch
License: GPL-2.0-or-later AND LGPL-2.0-or-later AND MIT AND GPL-3.0-or-later WITH Bison-exception-2.2 License: GPL-2.0-or-later AND LGPL-2.0-or-later AND MIT AND GPL-3.0-or-later WITH Bison-exception-2.2
@ -189,6 +190,8 @@ sed -i -e 's,^#!/usr/bin/python3,#!%{__python3},' src/cups/cups-genppdupdate.in
# 2055504 - Set gutenprint53+usb backend to use the default USB context # 2055504 - Set gutenprint53+usb backend to use the default USB context
%patch -P 6 -p1 -b .crash %patch -P 6 -p1 -b .crash
%patch -P 7 -p1 -b .c99
%build %build
# Don't run the weave test as it takes a very long time. # Don't run the weave test as it takes a very long time.
sed -i -e 's,^\(TESTS *=.*\) run-weavetest,\1,' test/Makefile.in sed -i -e 's,^\(TESTS *=.*\) run-weavetest,\1,' test/Makefile.in
@ -316,6 +319,9 @@ exit 0
%{_mandir}/man8/cups-genppd*8*.gz %{_mandir}/man8/cups-genppd*8*.gz
%changelog %changelog
* Wed Jan 03 2024 Florian Weimer <fweimer@redhat.com> - 5.3.4-14
- Backport upstream patch to fix C compatibility issue
* Thu Nov 16 2023 Zdenek Dohnal <zdohnal@redhat.com> - 5.3.4-13 * Thu Nov 16 2023 Zdenek Dohnal <zdohnal@redhat.com> - 5.3.4-13
- make gutenprint and gutenprint-libs-ui dependant on cups-client - both checks for existence of lp - make gutenprint and gutenprint-libs-ui dependant on cups-client - both checks for existence of lp