diff mbox series

[meta-oe,PATCHv2] libgee: backport patches to fix incompatible pointer types

Message ID 20240710223625.2670-1-f_l_k@t-online.de
State Under Review
Headers show
Series [meta-oe,PATCHv2] libgee: backport patches to fix incompatible pointer types | expand

Commit Message

Markus Volk July 10, 2024, 10:36 p.m. UTC
This imports two upstream patches that fix vala so that it
generates correct c code

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 ...be8987e5eb1390b23ac531c971b202c2ef77.patch | 69 +++++++++++++++++++
 ...6627f4fc96938b6015e05849867c472160a8.patch | 54 +++++++++++++++
 .../recipes-devtools/libgee/libgee_0.20.6.bb  | 40 ++---------
 3 files changed, 127 insertions(+), 36 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/libgee/libgee/2f0bbe8987e5eb1390b23ac531c971b202c2ef77.patch
 create mode 100644 meta-oe/recipes-devtools/libgee/libgee/b33a6627f4fc96938b6015e05849867c472160a8.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/libgee/libgee/2f0bbe8987e5eb1390b23ac531c971b202c2ef77.patch b/meta-oe/recipes-devtools/libgee/libgee/2f0bbe8987e5eb1390b23ac531c971b202c2ef77.patch
new file mode 100644
index 000000000..a506391d1
--- /dev/null
+++ b/meta-oe/recipes-devtools/libgee/libgee/2f0bbe8987e5eb1390b23ac531c971b202c2ef77.patch
@@ -0,0 +1,69 @@ 
+From 2f0bbe8987e5eb1390b23ac531c971b202c2ef77 Mon Sep 17 00:00:00 2001
+From: Rico Tzschichholz <ricotz@ubuntu.com>
+Date: Thu, 13 Apr 2023 23:43:03 +0200
+Subject: [PATCH] Implementations of "G List.get()" should use non-nullable
+ return as defined
+
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libgee/-/commit/2f0bbe8987e5eb1390b23ac531c971b202c2ef77]
+---
+ gee/abstractlist.vala       | 2 +-
+ gee/concurrentlist.vala     | 2 +-
+ gee/readonlylist.vala       | 2 +-
+ gee/unrolledlinkedlist.vala | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gee/abstractlist.vala b/gee/abstractlist.vala
+index eeff984..1e55114 100644
+--- a/gee/abstractlist.vala
++++ b/gee/abstractlist.vala
+@@ -39,7 +39,7 @@ public abstract class Gee.AbstractList<G> : Gee.AbstractCollection<G>, List<G> {
+ 	/**
+ 	 * {@inheritDoc}
+ 	 */
+-	public abstract new G? get (int index);
++	public abstract new G get (int index);
+ 
+ 	/**
+ 	 * {@inheritDoc}
+diff --git a/gee/concurrentlist.vala b/gee/concurrentlist.vala
+index 6e511f1..583f827 100644
+--- a/gee/concurrentlist.vala
++++ b/gee/concurrentlist.vala
+@@ -170,7 +170,7 @@ public class Gee.ConcurrentList<G> : AbstractList<G> {
+ 	/**
+ 	 * {@inheritDoc}
+ 	 */
+-	public override G? get (int index) {
++	public override G get (int index) {
+ 		HazardPointer.Context ctx = new HazardPointer.Context ();
+ 		Utils.Misc.unused (ctx);
+ 		assert (index >= 0);
+diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala
+index 8be3f27..c243d14 100644
+--- a/gee/readonlylist.vala
++++ b/gee/readonlylist.vala
+@@ -74,7 +74,7 @@ internal class Gee.ReadOnlyList<G> : Gee.ReadOnlyCollection<G>, List<G> {
+ 	/**
+ 	 * {@inheritDoc}
+ 	 */
+-	public new G? get (int index) {
++	public new G get (int index) {
+ 		return ((Gee.List<G>) _collection).get (index);
+ 	}
+ 
+diff --git a/gee/unrolledlinkedlist.vala b/gee/unrolledlinkedlist.vala
+index e36f88f..234d24d 100644
+--- a/gee/unrolledlinkedlist.vala
++++ b/gee/unrolledlinkedlist.vala
+@@ -158,7 +158,7 @@ public class Gee.UnrolledLinkedList<G> : AbstractBidirList<G>, Queue<G>, Deque<G
+ 		return new Iterator<G> (this);
+ 	}
+ 
+-	public override G? get (int index) {
++	public override G get (int index) {
+ 		assert (index >= 0);
+ 		assert (index < this._size);
+ 
+-- 
+GitLab
+
diff --git a/meta-oe/recipes-devtools/libgee/libgee/b33a6627f4fc96938b6015e05849867c472160a8.patch b/meta-oe/recipes-devtools/libgee/libgee/b33a6627f4fc96938b6015e05849867c472160a8.patch
new file mode 100644
index 000000000..6b65ebd1c
--- /dev/null
+++ b/meta-oe/recipes-devtools/libgee/libgee/b33a6627f4fc96938b6015e05849867c472160a8.patch
@@ -0,0 +1,54 @@ 
+From b33a6627f4fc96938b6015e05849867c472160a8 Mon Sep 17 00:00:00 2001
+From: Rico Tzschichholz <ricotz@ubuntu.com>
+Date: Sat, 8 Apr 2023 22:39:35 +0200
+Subject: [PATCH] Add more missing generic type arguments
+
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libgee/-/commit/b33a6627f4fc96938b6015e05849867c472160a8]
+---
+ gee/hashmap.vala    | 2 +-
+ gee/hashset.vala    | 2 +-
+ gee/linkedlist.vala | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gee/hashmap.vala b/gee/hashmap.vala
+index a7bae9f..19e3980 100644
+--- a/gee/hashmap.vala
++++ b/gee/hashmap.vala
+@@ -253,7 +253,7 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
+ 		for (int i = 0; i < _array_size; i++) {
+ 			Node<K,V> node = (owned) _nodes[i];
+ 			while (node != null) {
+-				Node next = (owned) node.next;
++				Node<K,V> next = (owned) node.next;
+ 				node.key = null;
+ 				node.value = null;
+ 				node = (owned) next;
+diff --git a/gee/hashset.vala b/gee/hashset.vala
+index ef6d5a2..bf05519 100644
+--- a/gee/hashset.vala
++++ b/gee/hashset.vala
+@@ -210,7 +210,7 @@ public class Gee.HashSet<G> : AbstractSet<G> {
+ 		for (int i = 0; i < _array_size; i++) {
+ 			Node<G> node = (owned) _nodes[i];
+ 			while (node != null) {
+-				Node next = (owned) node.next;
++				Node<G> next = (owned) node.next;
+ 				node.key = null;
+ 				node = (owned) next;
+ 			}
+diff --git a/gee/linkedlist.vala b/gee/linkedlist.vala
+index aff36b9..976977f 100644
+--- a/gee/linkedlist.vala
++++ b/gee/linkedlist.vala
+@@ -233,7 +233,7 @@ public class Gee.LinkedList<G> : AbstractBidirList<G>, Queue<G>, Deque<G> {
+ 				n.next.prev = n;
+ 				this._head = (owned)n;
+ 			} else {
+-				weak Node prev = this._head;
++				weak Node<G> prev = this._head;
+ 				for (int i = 0; i < index - 1; i++) {
+ 					prev = prev.next;
+ 				}
+-- 
+GitLab
+
diff --git a/meta-oe/recipes-devtools/libgee/libgee_0.20.6.bb b/meta-oe/recipes-devtools/libgee/libgee_0.20.6.bb
index 7e2781bcb..14e8e9908 100644
--- a/meta-oe/recipes-devtools/libgee/libgee_0.20.6.bb
+++ b/meta-oe/recipes-devtools/libgee/libgee_0.20.6.bb
@@ -11,8 +11,6 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
 GNOMEBASEBUILDCLASS = "autotools"
 inherit gnomebase vala gobject-introspection
 
-CFLAGS += "-Wno-incompatible-pointer-types"
-
 do_configure:prepend() {
     MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
     for i in ${MACROS}; do
@@ -20,39 +18,9 @@  do_configure:prepend() {
     done
 }
 
+SRC_URI += " \
+	file://2f0bbe8987e5eb1390b23ac531c971b202c2ef77.patch \
+	file://b33a6627f4fc96938b6015e05849867c472160a8.patch \
+"
 SRC_URI[archive.sha256sum] = "1bf834f5e10d60cc6124d74ed3c1dd38da646787fbf7872220b8b4068e476d4d"
 
-# http://errors.yoctoproject.org/Errors/Details/766884/
-# libgee-0.20.6/gee/concurrentlist.c:1169:177: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:1175:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2385:194: error: passing argument 4 of 'gee_hazard_pointer_compare_and_exchange_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2438:177: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2460:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2469:177: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2481:185: error: passing argument 4 of 'gee_hazard_pointer_compare_and_exchange_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2640:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2641:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:2750:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:469:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:514:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentlist.c:713:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:3635:185: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:4950:201: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5378:201: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5428:226: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5480:218: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5530:238: error: passing argument 4 of 'gee_hazard_pointer_compare_and_exchange_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5532:234: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5623:246: error: passing argument 4 of 'gee_hazard_pointer_compare_and_exchange_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:5625:242: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:7088:194: error: passing argument 4 of 'gee_hazard_pointer_compare_and_exchange_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:7157:177: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:7184:168: error: passing argument 4 of 'gee_hazard_pointer_set_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:7198:177: error: passing argument 4 of 'gee_hazard_pointer_get_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/concurrentset.c:7215:185: error: passing argument 4 of 'gee_hazard_pointer_compare_and_exchange_pointer' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/hashmap.c:4089:30: error: assignment to 'gboolean (*)(GeeMapIterator *)' {aka 'int (*)(struct _GeeMapIterator *)'} from incompatible pointer type 'gboolean (*)(GeeHashMapNodeIterator *)' {aka 'int (*)(struct _GeeHashMapNodeIterator *)'} [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/hazardpointer.c:430:134: error: passing argument 4 of 'gee_hazard_pointer_release_policy_swap' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/hazardpointer.c:430:171: error: passing argument 5 of 'gee_hazard_pointer_release_policy_swap' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/hazardpointer.c:434:134: error: passing argument 4 of 'gee_hazard_pointer_release_policy_swap' from incompatible pointer type [-Wincompatible-pointer-types]
-# libgee-0.20.6/gee/hazardpointer.c:434:171: error: passing argument 5 of 'gee_hazard_pointer_release_policy_swap' from incompatible pointer type [-Wincompatible-pointer-types]
-CFLAGS += "-Wno-error=incompatible-pointer-types"