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



commit 9ffa1e332ce4c12c780decf4884c9ee54d43657d
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jul 12 18:17:38 2012 +0200

    Handle * -> &, ** -> *& and *** -> **& C parameters for identity conversions.

 tools/pm/Common/TypeInfo/Local.pm |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/tools/pm/Common/TypeInfo/Local.pm b/tools/pm/Common/TypeInfo/Local.pm
index 5808a58..a98a7f7 100644
--- a/tools/pm/Common/TypeInfo/Local.pm
+++ b/tools/pm/Common/TypeInfo/Local.pm
@@ -103,6 +103,25 @@ sub _get_identity_conversion
     {
       return $subst;
     }
+    else
+    {
+      my $from_value = $from_details->get_value_details ();
+      my $to_value = $to_details->get_value_details ();
+
+      if ($from_value->get_base () eq $to_value->get_base ())
+      {
+        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;
+          }
+        }
+      }
+    }
   }
 
   return undef;



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