Backport upstream patches to fix C type errors

This commit is contained in:
Florian Weimer 2024-01-09 17:24:07 +01:00
parent e5a9fd1755
commit f82090de9f
3 changed files with 112 additions and 1 deletions

69
Xaw3d-c99-1.patch Normal file
View File

@ -0,0 +1,69 @@
commit 34b1fb5d114b6c763c06dd9618c3d8ca11662e34
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Nov 12 09:19:23 2022 -0800
Issue #5: incompatible function pointer passed in _XawImRealize()
Import wrapper function with expected arguments from libXaw,
where it appears to have been originally fixed in XFree86 3.9Nb
by Paulo Cesar Pereira de Andrade.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(configure.ac update dropped to avoid autoconf difficulties)
diff --git a/src/Vendor.c b/src/Vendor.c
index 6b34b31f5b60b7dc..2b2b99f0732ff511 100644
--- a/src/Vendor.c
+++ b/src/Vendor.c
@@ -109,6 +109,8 @@ static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeom
static void XawVendorShellClassPartInit(WidgetClass);
void XawVendorShellExtResize(Widget);
#endif
+void XawVendorStructureNotifyHandler(Widget, XtPointer, XEvent*, Boolean*);
+
#if defined(__UNIXOS2__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
/* to fix the EditRes problem because of wrong linker semantics */
@@ -576,6 +578,14 @@ XawVendorShellExtResize(Widget w)
}
}
}
+
+/*ARGSUSED*/
+void
+XawVendorStructureNotifyHandler(Widget w, XtPointer closure _X_UNUSED, XEvent *event _X_UNUSED,
+ Boolean *continue_to_dispatch _X_UNUSED)
+{
+ XawVendorShellExtResize(w);
+}
#endif
/*ARGSUSED*/
diff --git a/src/XawIm.c b/src/XawIm.c
index 9f666d26505a9dae..67f941d76b3fc9ab 100644
--- a/src/XawIm.c
+++ b/src/XawIm.c
@@ -90,7 +90,12 @@ in this Software without prior written authorization from the X Consortium.
*
*****************************************************/
-extern void XawVendorShellExtResize(Widget);
+/*
+ * From Vendor.c
+ */
+void XawVendorShellExtResize(Widget);
+void XawVendorStructureNotifyHandler(Widget, XtPointer, XEvent*, Boolean*);
+
static XawIcTableList CurrentSharedIcTable(
XawVendorShellExtPart* /* ve */
@@ -1373,7 +1378,7 @@ _XawImRealize(
if ( !XtIsRealized( w ) || !XtIsVendorShell( w ) ) return;
if ((ve = GetExtPart( (VendorShellWidget) w ))) {
XtAddEventHandler( w, (EventMask)StructureNotifyMask, FALSE,
- XawVendorShellExtResize, (XtPointer)NULL );
+ XawVendorStructureNotifyHandler, (XtPointer)NULL );
AllCreateIC(ve);
}
}

35
Xaw3d-c99-2.patch Normal file
View File

@ -0,0 +1,35 @@
commit 7b4af57e8a1471747e17fff184032d8250e598b6
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Dec 7 18:01:47 2023 -0800
Multisink.c: Clear -Werror=incompatible-pointer-types error
MultiSink.c: In function SetValues:
MultiSink.c:582:18: error: passing argument 1 of SetTabs from
incompatible pointer type [-Werror=incompatible-pointer-types]
582 | SetTabs( w, w->text_sink.tab_count, w->text_sink.char_tabs );
| ^
| |
| MultiSinkObject {aka struct _MultiSinkRec *}
MultiSink.c:99:21: note: expected Widget {aka struct _WidgetRec *}
but argument is of type MultiSinkObject {aka struct _MultiSinkRec *}
99 | static void SetTabs(Widget, int, short *);
| ^~~~~~
Adopts change originally made to libXaw in XFree86 4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/src/MultiSink.c b/src/MultiSink.c
index acf6caaca871a77e..cbae854004802708 100644
--- a/src/MultiSink.c
+++ b/src/MultiSink.c
@@ -579,7 +579,7 @@ SetValues(Widget current, Widget request, Widget new, ArgList args, Cardinal *nu
if ( w->multi_sink.fontset != old_w->multi_sink.fontset ) {
((TextWidget)XtParent(new))->text.redisplay_needed = True;
#ifndef NO_TAB_FIX
- SetTabs( w, w->text_sink.tab_count, w->text_sink.char_tabs );
+ SetTabs((Widget)w, w->text_sink.tab_count, w->text_sink.char_tabs);
#endif
}

View File

@ -1,7 +1,7 @@
Summary: A version of the MIT Athena widget set for X
Name: Xaw3d
Version: 1.6.4
Release: 3%{?dist}
Release: 4%{?dist}
Source0: https://xorg.freedesktop.org/archive/individual/lib/libXaw3d-%{version}.tar.xz
Source1: https://xorg.freedesktop.org/archive/individual/lib/libXaw3d-%{version}.tar.xz.sig
Source2: alan.coopersmith.asc
@ -9,6 +9,8 @@ Patch5: Xaw3d-1.5-debian-fixes.patch
Patch7: Xaw3d-1.6.1-3Dlabel.patch
Patch10: Xaw3d-1.6.1-fontset.patch
Patch11: Xaw3d-1.6.1-hsbar.patch
Patch12: Xaw3d-c99-1.patch
Patch13: Xaw3d-c99-2.patch
License: MIT
URL: http://xorg.freedesktop.org/
@ -66,6 +68,8 @@ package.
%patch7 -p1 -b .3Dlabel
%patch10 -p1 -b .fontset
%patch11 -p1 -b .hsbar
%patch -P 12 -p1
%patch -P 13 -p1
%build
@ -97,6 +101,9 @@ rm -r $RPM_BUILD_ROOT%{_docdir}
%{_includedir}/X11/Xaw3d
%changelog
* Tue Jan 09 2024 Florian Weimer <fweimer@redhat.com> - 1.6.4-4
- Backport upstream patches to fix C type errors
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild