[glibmm/gmmproc-refactor] Handle * -> &, ** -> *& and *** -> **& C parameters for EQUAL types.



commit 433a5ce946ec84fe1c14457bc38c89b3561f8ce7
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jul 12 18:15:47 2012 +0200

    Handle * -> &, ** -> *& and *** -> **& C parameters for EQUAL types.

 tools/pm/Common/TypeInfo/Convertors/Equal.pm |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/tools/pm/Common/TypeInfo/Convertors/Equal.pm b/tools/pm/Common/TypeInfo/Convertors/Equal.pm
index 1d49fb9..d7c527d 100644
--- a/tools/pm/Common/TypeInfo/Convertors/Equal.pm
+++ b/tools/pm/Common/TypeInfo/Convertors/Equal.pm
@@ -36,9 +36,18 @@ sub convert ($$$$$$)
       {
         return $subst;
       }
-      if ($from_details->equal ($to_details, Common::TypeDetails::Base::ACCESS_MODIFIERS) and $from_details->match_sigil(['&']) and $to_details->match_sigil (['*']))
+      if ($from_details->equal ($to_details, Common::TypeDetails::Base::ACCESS_MODIFIERS))
       {
-        return join '', '&(', $subst, ')';
+        foreach my $sigil_pair ([['&'], ['*']], [['*&'], ['**']], [['**&'], ['***']])
+        {
+          my $from_sigil = $sigil_pair->[0];
+          my $to_sigil = $sigil_pair->[1];
+
+          if ($from_details->match_sigil ($from_sigil) and $to_details->match_sigil ($to_sigil))
+          {
+            return '&' . $subst;
+          }
+        }
       }
     }
     when (Common::TypeInfo::Global::C_CXX)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]