From 25166e1ab675f2f61fcaa5cbf3ffb4f2cec1a6f6 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 4 Jul 2012 22:44:02 +0200 Subject: [PATCH] giscanner: Fix pointer parsing. They were parsed in wrong order resulting in having wrong pointer being const. For example - g_settings_list_schemas return type is normally 'const gchar *const *', but parsing result was 'const gchar ** const'. This was unnoticed, because pointer constness information is rather not used by gobject-introspection now. https://bugzilla.gnome.org/show_bug.cgi?id=656445 --- giscanner/scannerparser.y | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y index 65ac5946..48e3c132 100644 --- a/giscanner/scannerparser.y +++ b/giscanner/scannerparser.y @@ -1088,12 +1088,24 @@ pointer } | '*' type_qualifier_list pointer { - $$ = gi_source_pointer_new ($3); - $$->type_qualifier = $2; + GISourceType **base = &($3->base_type); + + while (*base != NULL) { + base = &((*base)->base_type); + } + *base = gi_source_pointer_new (NULL); + (*base)->type_qualifier = $2; + $$ = $3; } | '*' pointer { - $$ = gi_source_pointer_new ($2); + GISourceType **base = &($2->base_type); + + while (*base != NULL) { + base = &((*base)->base_type); + } + *base = gi_source_pointer_new (NULL); + $$ = $2; } ; -- 2.34.1