Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package gobject-introspection for
openSUSE:Factory checked in at 2023-03-26 20:19:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gobject-introspection (Old)
and /work/SRC/openSUSE:Factory/.gobject-introspection.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gobject-introspection"
Sun Mar 26 20:19:18 2023 rev:105 rq:1074238 version:1.76.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/gobject-introspection/gobject-introspection.changes
2023-03-24 15:17:57.942119777 +0100
+++
/work/SRC/openSUSE:Factory/.gobject-introspection.new.31432/gobject-introspection.changes
2023-03-26 20:19:19.542998358 +0200
@@ -1,0 +2,7 @@
+Wed Mar 22 23:00:25 UTC 2023 - Bjørn Lie <[email protected]>
+
+- Update to version 1.76.1:
+ + Handle null default values.
+ + Documentation fixes.
+
+-------------------------------------------------------------------
Old:
----
gobject-introspection-1.76.0.tar.xz
New:
----
gobject-introspection-1.76.1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gobject-introspection.spec ++++++
--- /var/tmp/diff_new_pack.VvTv8P/_old 2023-03-26 20:19:20.111001325 +0200
+++ /var/tmp/diff_new_pack.VvTv8P/_new 2023-03-26 20:19:20.119001367 +0200
@@ -17,7 +17,7 @@
Name: gobject-introspection
-Version: 1.76.0
+Version: 1.76.1
Release: 0
# FIXME: Find a way to identify if we need python3-gobject or python-gobject
from gi-find-deps.sh.
Summary: GObject Introspection Tools
++++++ gobject-introspection-1.76.0.tar.xz ->
gobject-introspection-1.76.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gobject-introspection-1.76.0/NEWS
new/gobject-introspection-1.76.1/NEWS
--- old/gobject-introspection-1.76.0/NEWS 2023-03-14 00:47:03.000000000
+0100
+++ new/gobject-introspection-1.76.1/NEWS 2023-03-22 23:43:34.000000000
+0100
@@ -1,3 +1,9 @@
+1.76.1 - 2023-03-22
+-------------------
+
+* Handle null default values [#457]
+* Documentation fixes
+
1.76.0 - 2023-03-13
-------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/gobject-introspection-1.76.0/docs/website/writingbindableapis.rst
new/gobject-introspection-1.76.1/docs/website/writingbindableapis.rst
--- old/gobject-introspection-1.76.0/docs/website/writingbindableapis.rst
2023-03-14 00:47:03.000000000 +0100
+++ new/gobject-introspection-1.76.1/docs/website/writingbindableapis.rst
2023-03-22 23:43:34.000000000 +0100
@@ -29,8 +29,8 @@
guint flags;
-Functionality only accessible through a C macro
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Functionality only accessible through a C macro or inline function
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The scanner does not support C macros as API. Solution - add a function
accessor rather than a macro. This also has the side effect of making
@@ -44,6 +44,9 @@
GtkWidgetFlags gtk_widget_get_flags (GtkWidget *widget); /* Actually, see
http://bugzilla.gnome.org/show_bug.cgi?id=69872 */
+Likewise, inline functions cannot be loaded from a dynamic library. Make sure
to
+provide a non-inline equivalent.
+
Direct C structure access for objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -89,6 +92,9 @@
using the ``rename-to`` annotation:
``gtk_list_store_newv: (rename-to gtk_list_store_new)``
+Also consider using C99's compound literals and designated initializers to
avoid
+``va_list`` even in the C API, which is more type-safe.
+
Multiple out parameters
~~~~~~~~~~~~~~~~~~~~~~~
@@ -107,12 +113,66 @@
gint *y);
+In-out parameters
+~~~~~~~~~~~~~~~~~
+
+Don't use in-out arguments, especially not for non-scalar values. It's
difficult
+to enforce or validate the conventions for in-out arguments, which can easily
+lead to crashes.
+
+Instead, pass the input as an in argument, and receive the output as either a
+return value or an out argument.
+
+.. code-block:: c
+
+ FooBoxed *foo_bar_scale_boxed(FooBar *self,
+ FooBoxed *boxed);
+
+ void foo_bar_scale_boxed(FooBar *self,
+ FooBoxed *boxed_in,
+ FooBoxed **boxed_out);
+
+In particular, do not require the caller to pass an initialized ``GValue`` to
+avoid the in-out annotation; instead, pass a ``GValue`` as an out argument, and
+have the function initialize it.
+
+
Arrays
~~~~~~
For reference types, zero-terminated arrays are the easiest to work with.
Arrays of primitive type such as "int" will require length metadata.
+In a general-purpose library, it's best not to expose GLib array and hash types
+such as ``GArray``, ``GPtrArray``, ``GByteArray``, ``GList``, ``GSList``,
+``GQueue``, and ``GHashTable`` in the public API. They are fine for internal
+libraries, but difficult in general for consumers of introspected libraries to
+deal with.
+
+
+Strings
+~~~~~~~
+
+C treats strings as zero-terminated arrays of bytes, but many other languages
do not. So don't
+write APIs that treat ``const char *`` parameters as arrays that need an
+``array length`` annotation.
+
+Treat all ``const char *`` parameters as zero-terminated strings. Don't use the
+same entry point for zero-terminated strings as for byte arrays which may
+contain embedded zeroes.
+
+.. code-block:: c
+
+ void foo_bar_snarf_string(FooBar *self,
+ const char *str);
+
+ void foo_bar_snarf_bytes(FooBar *self,
+ const uint8_t *bytes,
+ size_t length);
+
+In particular, avoid functions taking a ``const char *`` with a signed length
+that can be set to a negative value to let the function compute the string
+length in bytes. These functions are hard to bind, and require manual
overrides.
Callbacks
~~~~~~~~~
@@ -168,3 +228,31 @@
Instead, put initialization code in the ``foo_bar_init()`` function or the
``foo_bar_constructed()`` virtual function.
+
+
+Transfer-none return values from the binding
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If your library expects to call a function from C which may be implemented in
+another language and exposed through the binding (for example, a signal
handler,
+or a GObject vfunc), it's best not to return transfer-none values, because what
+you assume about storage lifetime in C may not apply in other languages.
+
+For example,
+
+.. code-block:: c
+
+ typedef struct {
+ GTypeInterface iface;
+
+ const char * (*my_vfunc) (FooBaz *self); /* Don't do this! */
+ char * (*my_better_vfunc) (FooBaz *self); /* Do this instead! */
+ } FooBazIface;
+
+A class that implements ``FooBazIface`` in another programming language may not
+be able to return a static string here, because the language may not have a
+concept of static storage lifetime, or it may not store strings as
+zero-terminated UTF-8 bytes as C code would expect. This can cause memory
leaks.
+Instead, duplicate the string before returning it, and use transfer-full. This
+recommendation applies to any data type with an ownership, including boxed and
+object types.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gobject-introspection-1.76.0/girepository/gdump.c
new/gobject-introspection-1.76.1/girepository/gdump.c
--- old/gobject-introspection-1.76.0/girepository/gdump.c 2023-03-14
00:47:03.000000000 +0100
+++ new/gobject-introspection-1.76.1/girepository/gdump.c 2023-03-22
23:43:34.000000000 +0100
@@ -119,12 +119,36 @@
return sym ();
}
+static char *
+value_transform_to_string (const GValue *value)
+{
+ GValue tmp = G_VALUE_INIT;
+ char *s = NULL;
+
+ g_value_init (&tmp, G_TYPE_STRING);
+
+ if (g_value_transform (value, &tmp))
+ {
+ const char *str = g_value_get_string (&tmp);
+
+ if (str != NULL)
+ s = g_strescape (str, NULL);
+ }
+
+ g_value_unset (&tmp);
+
+ return s;
+}
+
/* A simpler version of g_strdup_value_contents(), but with stable
* output and less complex semantics
*/
static char *
value_to_string (const GValue *value)
{
+ if (value == NULL)
+ return NULL;
+
if (G_VALUE_HOLDS_STRING (value))
{
const char *s = g_value_get_string (value);
@@ -134,25 +158,35 @@
return g_strescape (s, NULL);
}
- else if (g_value_type_transformable (G_VALUE_TYPE (value), G_TYPE_STRING))
+ else
{
- GValue tmp = G_VALUE_INIT;
- char *s = NULL;
-
- g_value_init (&tmp, G_TYPE_STRING);
+ GType value_type = G_VALUE_TYPE (value);
- if (g_value_transform (value, &tmp))
- s = g_strescape (g_value_get_string (&tmp), NULL);
-
- g_value_unset (&tmp);
-
- if (s == NULL)
- return NULL;
-
- return s;
+ switch (G_TYPE_FUNDAMENTAL (value_type))
+ {
+ case G_TYPE_BOXED:
+ if (g_value_get_boxed (value) == NULL)
+ return NULL;
+ else
+ return value_transform_to_string (value);
+ break;
+
+ case G_TYPE_OBJECT:
+ if (g_value_get_object (value) == NULL)
+ return NULL;
+ else
+ return value_transform_to_string (value);
+ break;
+
+ case G_TYPE_POINTER:
+ return NULL;
+
+ default:
+ return value_transform_to_string (value);
+ }
}
- else
- return NULL;
+
+ return NULL;
}
static void
@@ -186,7 +220,7 @@
const GValue *v = g_param_spec_get_default_value (prop);
char *default_value = value_to_string (v);
- if (default_value != NULL)
+ if (v != NULL && default_value != NULL)
{
escaped_printf (out, " <property name=\"%s\" type=\"%s\"
flags=\"%d\" default-value=\"%s\"/>\n",
prop->name,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gobject-introspection-1.76.0/meson.build
new/gobject-introspection-1.76.1/meson.build
--- old/gobject-introspection-1.76.0/meson.build 2023-03-14
00:47:03.000000000 +0100
+++ new/gobject-introspection-1.76.1/meson.build 2023-03-22
23:43:34.000000000 +0100
@@ -1,5 +1,5 @@
project('gobject-introspection', 'c',
- version: '1.76.0',
+ version: '1.76.1',
meson_version: '>= 0.60.0',
default_options: [
'c_std=gnu99',
@@ -124,7 +124,7 @@
endif
# Reset to 0 if g-i micro version exceeds GLib's
-glib_micro_version = gi_versions[2]
+glib_micro_version = 0 # gi_versions[2]
glib_version = '>=2.@0@.@1@'.format(gi_versions[1], glib_micro_version)
glib_dep = dependency('glib-2.0', version: glib_version,