Mageia Bugzilla – Attachment 13903 Details for
Bug 32063
MCC - GLib-GObject-CRITICAL warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
perl-Pango patch to fix GLib-GObject-CRITICALs
0001-Use-boxed-types.patch (text/plain), 6.19 KB, created by
Jani Välimaa
on 2023-07-04 20:30:54 CEST
(
hide
)
Description:
perl-Pango patch to fix GLib-GObject-CRITICALs
Filename:
MIME Type:
Creator:
Jani Välimaa
Created:
2023-07-04 20:30:54 CEST
Size:
6.19 KB
patch
obsolete
>From ddd0aa0a910d6935293972e6f5db1ded301e6228 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Jani=20V=C3=A4limaa?= <wally@mageia.org> >Date: Tue, 4 Jul 2023 21:09:42 +0300 >Subject: [PATCH] Use boxed types > >Switch PangoAttribute, PangoAttrIterator, PangoLayoutIter, PangoLayoutLine, and >PangoScriptIter to use G_DEFINE_BOXED_TYPE() instead of g_boxed_type_register_static(). >--- > pango-perl.h | 20 ++++++++++---------- > pango.exports | 5 ----- > xs/PangoAttributes.xs | 26 ++++++-------------------- > xs/PangoLayout.xs | 28 +++++++--------------------- > xs/PangoScript.xs | 14 +++----------- > 5 files changed, 26 insertions(+), 67 deletions(-) > >diff --git a/pango-perl.h b/pango-perl.h >index 2b6b30d..74f76fd 100644 >--- a/pango-perl.h >+++ b/pango-perl.h >@@ -30,33 +30,33 @@ > > /* custom GType for PangoAttribute */ > #ifndef PANGO_TYPE_ATTRIBUTE >-# define PANGO_TYPE_ATTRIBUTE (gtk2perl_pango_attribute_get_type ()) >- GType gtk2perl_pango_attribute_get_type (void) G_GNUC_CONST; >+# define PANGO_TYPE_ATTRIBUTE (pango_attribute_get_type ()) >+ GType pango_attribute_get_type (void) G_GNUC_CONST; > #endif > > /* custom GType for PangoAttrIter */ > #ifndef PANGO_TYPE_ATTR_ITERATOR >-# define PANGO_TYPE_ATTR_ITERATOR (gtk2perl_pango_attr_iterator_get_type ()) >- GType gtk2perl_pango_attr_iterator_get_type (void) G_GNUC_CONST; >+# define PANGO_TYPE_ATTR_ITERATOR (pango_attr_iterator_get_type ()) >+ GType pango_attr_iterator_get_type (void) G_GNUC_CONST; > #endif > > /* custom GType for PangoLayoutIter */ > #ifndef PANGO_TYPE_LAYOUT_ITER >-# define PANGO_TYPE_LAYOUT_ITER (gtk2perl_pango_layout_iter_get_type ()) >- GType gtk2perl_pango_layout_iter_get_type (void) G_GNUC_CONST; >+# define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type ()) >+ GType pango_layout_iter_get_type (void) G_GNUC_CONST; > #endif > > /* custom GType for PangoLayoutLine */ > #ifndef PANGO_TYPE_LAYOUT_LINE >-# define PANGO_TYPE_LAYOUT_LINE (gtk2perl_pango_layout_line_get_type ()) >- GType gtk2perl_pango_layout_line_get_type (void) G_GNUC_CONST; >+# define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type ()) >+ GType pango_layout_line_get_type (void) G_GNUC_CONST; > #endif > > /* custom GType for PangoScriptIter */ > #if PANGO_CHECK_VERSION (1, 4, 0) > # ifndef PANGO_TYPE_SCRIPT_ITER >-# define PANGO_TYPE_SCRIPT_ITER (gtk2perl_pango_script_iter_get_type ()) >- GType gtk2perl_pango_script_iter_get_type (void) G_GNUC_CONST; >+# define PANGO_TYPE_SCRIPT_ITER (pango_script_iter_get_type ()) >+ GType pango_script_iter_get_type (void) G_GNUC_CONST; > # endif > #endif > >diff --git a/pango.exports b/pango.exports >index d6adfca..b5cda85 100644 >--- a/pango.exports >+++ b/pango.exports >@@ -1,8 +1,3 @@ > newSVPangoRectangle > SvPangoRectangle >-gtk2perl_pango_attribute_get_type > gtk2perl_pango_attribute_register_custom_type >-gtk2perl_pango_attr_iterator_get_type >-gtk2perl_pango_layout_iter_get_type >-gtk2perl_pango_layout_line_get_type >-gtk2perl_pango_script_iter_get_type >diff --git a/xs/PangoAttributes.xs b/xs/PangoAttributes.xs >index 06cabc2..a3120bc 100644 >--- a/xs/PangoAttributes.xs >+++ b/xs/PangoAttributes.xs >@@ -105,16 +105,9 @@ pango_color_destroy (SV * sv) > > /* ------------------------------------------------------------------------- */ > >-GType >-gtk2perl_pango_attribute_get_type (void) >-{ >- static GType t = 0; >- if (!t) >- t = g_boxed_type_register_static ("PangoAttribute", >- (GBoxedCopyFunc) pango_attribute_copy, >- (GBoxedFreeFunc) pango_attribute_destroy); >- return t; >-} >+G_DEFINE_BOXED_TYPE (PangoAttribute, pango_attribute, >+ pango_attribute_copy, >+ pango_attribute_destroy); > > static GHashTable *gtk2perl_pango_attribute_table = NULL; > >@@ -253,16 +246,9 @@ gtk2perl_pango_attribute_unwrap (GType gtype, > > /* ------------------------------------------------------------------------- */ > >-GType >-gtk2perl_pango_attr_iterator_get_type (void) >-{ >- static GType t = 0; >- if (!t) >- t = g_boxed_type_register_static ("PangoAttrIterator", >- (GBoxedCopyFunc) pango_attr_iterator_copy, >- (GBoxedFreeFunc) pango_attr_iterator_destroy); >- return t; >-} >+G_DEFINE_BOXED_TYPE (PangoAttrIterator, pango_attr_iterator, >+ pango_attr_iterator_copy, >+ pango_attr_iterator_destroy); > > /* ------------------------------------------------------------------------- */ > >diff --git a/xs/PangoLayout.xs b/xs/PangoLayout.xs >index b8b8c67..01547e9 100644 >--- a/xs/PangoLayout.xs >+++ b/xs/PangoLayout.xs >@@ -31,33 +31,19 @@ gtk2perl_pango_layout_iter_copy (gpointer boxed) > > #endif > >-GType >-gtk2perl_pango_layout_iter_get_type (void) >-{ >- static GType t = 0; >- if (!t) >- t = g_boxed_type_register_static ("PangoLayoutIter", >+G_DEFINE_BOXED_TYPE (PangoLayoutIter, pango_layout_iter, > #if PANGO_CHECK_VERSION (1, 20, 0) >- (GBoxedCopyFunc) pango_layout_iter_copy, >+ pango_layout_iter_copy, > #else >- (GBoxedCopyFunc) gtk2perl_pango_layout_iter_copy, >+ gtk2perl_pango_layout_iter_copy, > #endif >- (GBoxedFreeFunc) pango_layout_iter_free); >- return t; >-} >+ pango_layout_iter_free); > > /* ------------------------------------------------------------------------- */ > >-GType >-gtk2perl_pango_layout_line_get_type (void) >-{ >- static GType t = 0; >- if (!t) >- t = g_boxed_type_register_static ("PangoLayoutLine", >- (GBoxedCopyFunc) pango_layout_line_ref, >- (GBoxedFreeFunc) pango_layout_line_unref); >- return t; >-} >+G_DEFINE_BOXED_TYPE (PangoLayoutLine, pango_layout_line, >+ pango_layout_line_ref, >+ pango_layout_line_unref); > > /* ------------------------------------------------------------------------- */ > >diff --git a/xs/PangoScript.xs b/xs/PangoScript.xs >index 5626757..ee8c97b 100644 >--- a/xs/PangoScript.xs >+++ b/xs/PangoScript.xs >@@ -29,17 +29,9 @@ gtk2perl_pango_script_iter_copy (gpointer boxed) > return boxed; > } > >-GType >-gtk2perl_pango_script_iter_get_type (void) >-{ >- static GType t = 0; >- if (!t) >- t = g_boxed_type_register_static ("PangoScriptIter", >- (GBoxedCopyFunc) gtk2perl_pango_script_iter_copy, >- (GBoxedFreeFunc) pango_script_iter_free); >- return t; >-} >- >+G_DEFINE_BOXED_TYPE (PangoScriptIter, pango_script_iter, >+ gtk2perl_pango_script_iter_copy, >+ pango_script_iter_free); > #endif > > /* ------------------------------------------------------------------------- */ >-- >2.41.0 >
From ddd0aa0a910d6935293972e6f5db1ded301e6228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= <wally@mageia.org> Date: Tue, 4 Jul 2023 21:09:42 +0300 Subject: [PATCH] Use boxed types Switch PangoAttribute, PangoAttrIterator, PangoLayoutIter, PangoLayoutLine, and PangoScriptIter to use G_DEFINE_BOXED_TYPE() instead of g_boxed_type_register_static(). --- pango-perl.h | 20 ++++++++++---------- pango.exports | 5 ----- xs/PangoAttributes.xs | 26 ++++++-------------------- xs/PangoLayout.xs | 28 +++++++--------------------- xs/PangoScript.xs | 14 +++----------- 5 files changed, 26 insertions(+), 67 deletions(-) diff --git a/pango-perl.h b/pango-perl.h index 2b6b30d..74f76fd 100644 --- a/pango-perl.h +++ b/pango-perl.h @@ -30,33 +30,33 @@ /* custom GType for PangoAttribute */ #ifndef PANGO_TYPE_ATTRIBUTE -# define PANGO_TYPE_ATTRIBUTE (gtk2perl_pango_attribute_get_type ()) - GType gtk2perl_pango_attribute_get_type (void) G_GNUC_CONST; +# define PANGO_TYPE_ATTRIBUTE (pango_attribute_get_type ()) + GType pango_attribute_get_type (void) G_GNUC_CONST; #endif /* custom GType for PangoAttrIter */ #ifndef PANGO_TYPE_ATTR_ITERATOR -# define PANGO_TYPE_ATTR_ITERATOR (gtk2perl_pango_attr_iterator_get_type ()) - GType gtk2perl_pango_attr_iterator_get_type (void) G_GNUC_CONST; +# define PANGO_TYPE_ATTR_ITERATOR (pango_attr_iterator_get_type ()) + GType pango_attr_iterator_get_type (void) G_GNUC_CONST; #endif /* custom GType for PangoLayoutIter */ #ifndef PANGO_TYPE_LAYOUT_ITER -# define PANGO_TYPE_LAYOUT_ITER (gtk2perl_pango_layout_iter_get_type ()) - GType gtk2perl_pango_layout_iter_get_type (void) G_GNUC_CONST; +# define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type ()) + GType pango_layout_iter_get_type (void) G_GNUC_CONST; #endif /* custom GType for PangoLayoutLine */ #ifndef PANGO_TYPE_LAYOUT_LINE -# define PANGO_TYPE_LAYOUT_LINE (gtk2perl_pango_layout_line_get_type ()) - GType gtk2perl_pango_layout_line_get_type (void) G_GNUC_CONST; +# define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type ()) + GType pango_layout_line_get_type (void) G_GNUC_CONST; #endif /* custom GType for PangoScriptIter */ #if PANGO_CHECK_VERSION (1, 4, 0) # ifndef PANGO_TYPE_SCRIPT_ITER -# define PANGO_TYPE_SCRIPT_ITER (gtk2perl_pango_script_iter_get_type ()) - GType gtk2perl_pango_script_iter_get_type (void) G_GNUC_CONST; +# define PANGO_TYPE_SCRIPT_ITER (pango_script_iter_get_type ()) + GType pango_script_iter_get_type (void) G_GNUC_CONST; # endif #endif diff --git a/pango.exports b/pango.exports index d6adfca..b5cda85 100644 --- a/pango.exports +++ b/pango.exports @@ -1,8 +1,3 @@ newSVPangoRectangle SvPangoRectangle -gtk2perl_pango_attribute_get_type gtk2perl_pango_attribute_register_custom_type -gtk2perl_pango_attr_iterator_get_type -gtk2perl_pango_layout_iter_get_type -gtk2perl_pango_layout_line_get_type -gtk2perl_pango_script_iter_get_type diff --git a/xs/PangoAttributes.xs b/xs/PangoAttributes.xs index 06cabc2..a3120bc 100644 --- a/xs/PangoAttributes.xs +++ b/xs/PangoAttributes.xs @@ -105,16 +105,9 @@ pango_color_destroy (SV * sv) /* ------------------------------------------------------------------------- */ -GType -gtk2perl_pango_attribute_get_type (void) -{ - static GType t = 0; - if (!t) - t = g_boxed_type_register_static ("PangoAttribute", - (GBoxedCopyFunc) pango_attribute_copy, - (GBoxedFreeFunc) pango_attribute_destroy); - return t; -} +G_DEFINE_BOXED_TYPE (PangoAttribute, pango_attribute, + pango_attribute_copy, + pango_attribute_destroy); static GHashTable *gtk2perl_pango_attribute_table = NULL; @@ -253,16 +246,9 @@ gtk2perl_pango_attribute_unwrap (GType gtype, /* ------------------------------------------------------------------------- */ -GType -gtk2perl_pango_attr_iterator_get_type (void) -{ - static GType t = 0; - if (!t) - t = g_boxed_type_register_static ("PangoAttrIterator", - (GBoxedCopyFunc) pango_attr_iterator_copy, - (GBoxedFreeFunc) pango_attr_iterator_destroy); - return t; -} +G_DEFINE_BOXED_TYPE (PangoAttrIterator, pango_attr_iterator, + pango_attr_iterator_copy, + pango_attr_iterator_destroy); /* ------------------------------------------------------------------------- */ diff --git a/xs/PangoLayout.xs b/xs/PangoLayout.xs index b8b8c67..01547e9 100644 --- a/xs/PangoLayout.xs +++ b/xs/PangoLayout.xs @@ -31,33 +31,19 @@ gtk2perl_pango_layout_iter_copy (gpointer boxed) #endif -GType -gtk2perl_pango_layout_iter_get_type (void) -{ - static GType t = 0; - if (!t) - t = g_boxed_type_register_static ("PangoLayoutIter", +G_DEFINE_BOXED_TYPE (PangoLayoutIter, pango_layout_iter, #if PANGO_CHECK_VERSION (1, 20, 0) - (GBoxedCopyFunc) pango_layout_iter_copy, + pango_layout_iter_copy, #else - (GBoxedCopyFunc) gtk2perl_pango_layout_iter_copy, + gtk2perl_pango_layout_iter_copy, #endif - (GBoxedFreeFunc) pango_layout_iter_free); - return t; -} + pango_layout_iter_free); /* ------------------------------------------------------------------------- */ -GType -gtk2perl_pango_layout_line_get_type (void) -{ - static GType t = 0; - if (!t) - t = g_boxed_type_register_static ("PangoLayoutLine", - (GBoxedCopyFunc) pango_layout_line_ref, - (GBoxedFreeFunc) pango_layout_line_unref); - return t; -} +G_DEFINE_BOXED_TYPE (PangoLayoutLine, pango_layout_line, + pango_layout_line_ref, + pango_layout_line_unref); /* ------------------------------------------------------------------------- */ diff --git a/xs/PangoScript.xs b/xs/PangoScript.xs index 5626757..ee8c97b 100644 --- a/xs/PangoScript.xs +++ b/xs/PangoScript.xs @@ -29,17 +29,9 @@ gtk2perl_pango_script_iter_copy (gpointer boxed) return boxed; } -GType -gtk2perl_pango_script_iter_get_type (void) -{ - static GType t = 0; - if (!t) - t = g_boxed_type_register_static ("PangoScriptIter", - (GBoxedCopyFunc) gtk2perl_pango_script_iter_copy, - (GBoxedFreeFunc) pango_script_iter_free); - return t; -} - +G_DEFINE_BOXED_TYPE (PangoScriptIter, pango_script_iter, + gtk2perl_pango_script_iter_copy, + pango_script_iter_free); #endif /* ------------------------------------------------------------------------- */ -- 2.41.0
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32063
: 13903