forked from pool/gobject-introspection
Add upstream bug fix patches OBS-URL: https://build.opensuse.org/request/show/661679 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gobject-introspection?expand=0&rev=196
354 lines
14 KiB
Diff
354 lines
14 KiB
Diff
From 92fb04afa680bbe5089003db6f62c5e0cef25255 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= <tomasz.miasko@gmail.com>
|
|
Date: Fri, 23 Nov 2018 00:00:00 +0000
|
|
Subject: [PATCH] Define grefcount and gatomicrefcount as aliases to gint
|
|
|
|
Backport from !76, as requested in #254
|
|
---
|
|
giscanner/ast.py | 2 +
|
|
....TestReferenceCounters-atomicrefcount.page | 14 ++++++
|
|
...egress.TestReferenceCounters-refcount.page | 14 ++++++
|
|
.../Regress.TestReferenceCounters.page | 35 +++++++++++++++
|
|
....TestReferenceCounters-atomicrefcount.page | 18 ++++++++
|
|
...egress.TestReferenceCounters-refcount.page | 18 ++++++++
|
|
.../Regress.TestReferenceCounters.page | 43 +++++++++++++++++++
|
|
....TestReferenceCounters-atomicrefcount.page | 14 ++++++
|
|
...egress.TestReferenceCounters-refcount.page | 14 ++++++
|
|
.../Regress.TestReferenceCounters.page | 40 +++++++++++++++++
|
|
tests/scanner/Regress-1.0-expected.gir | 8 ++++
|
|
tests/scanner/regress.h | 8 ++++
|
|
12 files changed, 228 insertions(+)
|
|
create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-refcount.page
|
|
create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters.page
|
|
create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-refcount.page
|
|
create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters.page
|
|
create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-refcount.page
|
|
create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters.page
|
|
|
|
diff --git a/giscanner/ast.py b/giscanner/ast.py
|
|
index a9a6e13b..75daa459 100644
|
|
--- a/giscanner/ast.py
|
|
+++ b/giscanner/ast.py
|
|
@@ -322,6 +322,8 @@ type_names['gssize'] = TYPE_SSIZE
|
|
type_names['gintptr'] = TYPE_INTPTR
|
|
type_names['guintptr'] = TYPE_UINTPTR
|
|
type_names['gconstpointer'] = TYPE_ANY
|
|
+type_names['grefcount'] = TYPE_INT
|
|
+type_names['gatomicrefcount'] = TYPE_INT
|
|
|
|
# We used to support these; continue to do so
|
|
type_names['any'] = TYPE_ANY
|
|
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-atomicrefcount.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
new file mode 100644
|
|
index 00000000..6c07402d
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
@@ -0,0 +1,14 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters-atomicrefcount"
|
|
+ type="topic"
|
|
+ style="field"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="Regress.TestReferenceCounters" group="field" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters->atomicrefcount</title>
|
|
+
|
|
+
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-refcount.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-refcount.page
|
|
new file mode 100644
|
|
index 00000000..ed4aab56
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters-refcount.page
|
|
@@ -0,0 +1,14 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters-refcount"
|
|
+ type="topic"
|
|
+ style="field"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="Regress.TestReferenceCounters" group="field" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters->refcount</title>
|
|
+
|
|
+
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters.page
|
|
new file mode 100644
|
|
index 00000000..8176ff9a
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestReferenceCounters.page
|
|
@@ -0,0 +1,35 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters"
|
|
+ type="guide"
|
|
+ style="class"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="index" group="class" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters</title>
|
|
+
|
|
+
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/x-csrc"
|
|
+ groups="constructor" style="linklist">
|
|
+ <title>Constructors</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/x-csrc"
|
|
+ groups="method" style="linklist">
|
|
+ <title>Methods</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/x-csrc"
|
|
+ groups="function" style="linklist">
|
|
+ <title>Static Functions</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true" groups="field" style="linklist">
|
|
+ <title>Fields</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true" groups="#first #default #last" style="linklist">
|
|
+ <title>Other</title>
|
|
+ </links>
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-atomicrefcount.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
new file mode 100644
|
|
index 00000000..afd078e2
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
@@ -0,0 +1,18 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters-atomicrefcount"
|
|
+ type="topic"
|
|
+ style="field"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="Regress.TestReferenceCounters" group="field" type="guide"/>
|
|
+ <title type="link" role="topic">atomicrefcount</title>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters.atomicrefcount</title>
|
|
+ <synopsis><code mime="text/x-gjs">
|
|
+TestReferenceCounters.atomicrefcount: Number(gint) (Read / Write)
|
|
+ </code></synopsis>
|
|
+
|
|
+
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-refcount.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-refcount.page
|
|
new file mode 100644
|
|
index 00000000..8784e28a
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters-refcount.page
|
|
@@ -0,0 +1,18 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters-refcount"
|
|
+ type="topic"
|
|
+ style="field"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="Regress.TestReferenceCounters" group="field" type="guide"/>
|
|
+ <title type="link" role="topic">refcount</title>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters.refcount</title>
|
|
+ <synopsis><code mime="text/x-gjs">
|
|
+TestReferenceCounters.refcount: Number(gint) (Read / Write)
|
|
+ </code></synopsis>
|
|
+
|
|
+
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters.page
|
|
new file mode 100644
|
|
index 00000000..8f5b2d2d
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestReferenceCounters.page
|
|
@@ -0,0 +1,43 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters"
|
|
+ type="guide"
|
|
+ style="class"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="index" group="class" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters</title>
|
|
+ <synopsis><code>
|
|
+const Regress = imports.gi.Regress;
|
|
+
|
|
+let testReferenceCounters = new Regress.TestReferenceCounters({
|
|
+ <link xref='Regress.TestReferenceCounters-refcount'>refcount</link>: value
|
|
+ <link xref='Regress.TestReferenceCounters-atomicrefcount'>atomicrefcount</link>: value
|
|
+});
|
|
+ </code></synopsis>
|
|
+
|
|
+
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/x-gjs"
|
|
+ groups="constructor" style="linklist">
|
|
+ <title>Constructors</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/x-gjs"
|
|
+ groups="method" style="linklist">
|
|
+ <title>Methods</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/x-gjs"
|
|
+ groups="function" style="linklist">
|
|
+ <title>Static Functions</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true" groups="field" style="linklist">
|
|
+ <title>Fields</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true" groups="#first #default #last" style="linklist">
|
|
+ <title>Other</title>
|
|
+ </links>
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-atomicrefcount.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
new file mode 100644
|
|
index 00000000..6c07402d
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-atomicrefcount.page
|
|
@@ -0,0 +1,14 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters-atomicrefcount"
|
|
+ type="topic"
|
|
+ style="field"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="Regress.TestReferenceCounters" group="field" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters->atomicrefcount</title>
|
|
+
|
|
+
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-refcount.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-refcount.page
|
|
new file mode 100644
|
|
index 00000000..ed4aab56
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters-refcount.page
|
|
@@ -0,0 +1,14 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters-refcount"
|
|
+ type="topic"
|
|
+ style="field"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="Regress.TestReferenceCounters" group="field" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters->refcount</title>
|
|
+
|
|
+
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters.page
|
|
new file mode 100644
|
|
index 00000000..bc8651ab
|
|
--- /dev/null
|
|
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestReferenceCounters.page
|
|
@@ -0,0 +1,40 @@
|
|
+<?xml version="1.0"?>
|
|
+<page id="Regress.TestReferenceCounters"
|
|
+ type="guide"
|
|
+ style="class"
|
|
+ xmlns="http://projectmallard.org/1.0/"
|
|
+ xmlns:api="http://projectmallard.org/experimental/api/"
|
|
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
|
|
+ <info>
|
|
+ <link xref="index" group="class" type="guide"/>
|
|
+ </info>
|
|
+ <title>Regress.TestReferenceCounters</title>
|
|
+ <synopsis><code>
|
|
+from gi.repository import Regress
|
|
+
|
|
+test_reference_counters = Regress.TestReferenceCounters()
|
|
+ </code></synopsis>
|
|
+
|
|
+
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/python"
|
|
+ groups="constructor" style="linklist">
|
|
+ <title>Constructors</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/python"
|
|
+ groups="method" style="linklist">
|
|
+ <title>Methods</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true"
|
|
+ api:type="function" api:mime="text/python"
|
|
+ groups="function" style="linklist">
|
|
+ <title>Static Functions</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true" groups="field" style="linklist">
|
|
+ <title>Fields</title>
|
|
+ </links>
|
|
+ <links type="topic" ui:expanded="true" groups="#first #default #last" style="linklist">
|
|
+ <title>Other</title>
|
|
+ </links>
|
|
+</page>
|
|
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
|
|
index f69b8514..1753233f 100644
|
|
--- a/tests/scanner/Regress-1.0-expected.gir
|
|
+++ b/tests/scanner/Regress-1.0-expected.gir
|
|
@@ -4022,6 +4022,14 @@ the introspection client langage.</doc>
|
|
<type name="gint" c:type="gint"/>
|
|
</field>
|
|
</record>
|
|
+ <record name="TestReferenceCounters" c:type="RegressTestReferenceCounters">
|
|
+ <field name="refcount" writable="1">
|
|
+ <type name="gint" c:type="grefcount"/>
|
|
+ </field>
|
|
+ <field name="atomicrefcount" writable="1">
|
|
+ <type name="gint" c:type="gatomicrefcount"/>
|
|
+ </field>
|
|
+ </record>
|
|
<enumeration name="TestReferenceEnum" c:type="RegressTestReferenceEnum">
|
|
<member name="0" value="4" c:identifier="REGRESS_TEST_REFERENCE_0">
|
|
</member>
|
|
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
|
|
index f0885f2b..df5a0c25 100644
|
|
--- a/tests/scanner/regress.h
|
|
+++ b/tests/scanner/regress.h
|
|
@@ -4,6 +4,7 @@
|
|
#ifndef _GI_DISABLE_CAIRO
|
|
#include <cairo-gobject.h>
|
|
#endif
|
|
+#include <glib.h>
|
|
#include <glib-object.h>
|
|
#include <gio/gio.h>
|
|
#include <time.h>
|
|
@@ -1491,4 +1492,11 @@ typedef struct {
|
|
GVariant *
|
|
regress_get_variant (void);
|
|
|
|
+typedef struct _RegressTestReferenceCounters RegressTestReferenceCounters;
|
|
+
|
|
+struct _RegressTestReferenceCounters {
|
|
+ grefcount refcount;
|
|
+ gatomicrefcount atomicrefcount;
|
|
+};
|
|
+
|
|
#endif /* __GITESTTYPES_H__ */
|
|
--
|
|
2.18.1
|
|
|