- Refine dynamic casts to avoid -Wnonnull warning with gcc-11

This commit is contained in:
Jeff Law 2020-09-03 15:31:31 -06:00
parent ff1a37c35b
commit 811edcabc4
2 changed files with 28 additions and 1 deletions

22
inkscape-gcc11.patch Normal file
View File

@ -0,0 +1,22 @@
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 08de0b4..9ba73a1 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -174,7 +174,7 @@ open_internal(Extension *in_plug, gpointer in_data)
// skip all the rest if we already found a function to open it
// since they're ordered by preference now.
if (!*pimod) {
- gchar const *ext = dynamic_cast<Input *>(in_plug)->get_extension();
+ gchar const *ext = dynamic_cast<Input &>(*in_plug).get_extension();
gchar *filenamelower = g_utf8_strdown(filename, -1);
gchar *extensionlower = g_utf8_strdown(ext, -1);
@@ -384,7 +384,7 @@ save_internal(Extension *in_plug, gpointer in_data)
// skip all the rest if we already found someone to save it
// since they're ordered by preference now.
if (!*pomod) {
- gchar const *ext = dynamic_cast<Output *>(in_plug)->get_extension();
+ gchar const *ext = dynamic_cast<Output &>(*in_plug).get_extension();
gchar *filenamelower = g_utf8_strdown(filename, -1);
gchar *extensionlower = g_utf8_strdown(ext, -1);

View File

@ -2,7 +2,7 @@
Name: inkscape
Version: 1.0
Release: 7%{?dist}
Release: 8%{?dist}
Summary: Vector-based drawing program using SVG
# Inkscape tags their releases with underscores and in ALLCAPS
@ -15,6 +15,8 @@ Source0: https://inkscape.org/gallery/item/18460/inkscape-1.0_2020-05-01_
# Fedora Color Palette, GIMP format, CC-BY 3.0
Source2: Fedora-Color-Palette.gpl
Patch1: inkscape-gcc11.patch
Provides: bundled(libcroco)
Provides: bundled(libgdl)
@ -220,6 +222,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.inkscape.Inksc
%changelog
* Thu Sep 03 2020 Jeff Law <law@redhat.com> - 1.0-8
- Refine dynamic casts to avoid -Wnonnull warning with gcc-11
* Mon Aug 17 2020 Kalev Lember <klember@redhat.com> - 1.0-7
- Drop two unneeded dependencies
- Validate appdata file in check rather than install section