[glibmm/gmmproc-refactor] Ignore transfer in identity conversions.



commit ccd1eebe62f8630ac6b5e8bad6c77f3b5176e7d4
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jul 12 18:20:24 2012 +0200

    Ignore transfer in identity conversions.
    
    Hope that won't bite me.

 tools/pm/Common/TypeInfo/Local.pm |   36 ++++++++++++++++--------------------
 1 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/tools/pm/Common/TypeInfo/Local.pm b/tools/pm/Common/TypeInfo/Local.pm
index a98a7f7..ded8f92 100644
--- a/tools/pm/Common/TypeInfo/Local.pm
+++ b/tools/pm/Common/TypeInfo/Local.pm
@@ -93,32 +93,28 @@ sub _get_named_conversion ($$$$$)
 sub _get_identity_conversion
 {
   my ($self, $from, $to, $transfer, $subst) = @_;
+  my $from_details = Common::TypeDetails::disassemble_type ($from);
+  my $to_details = Common::TypeDetails::disassemble_type ($to);
 
-  if ($transfer == Common::TypeInfo::Common::TRANSFER_NONE)
+  if ($from_details->equal ($to_details, Common::TypeDetails::Base::RECURSIVE))
   {
-    my $from_details = Common::TypeDetails::disassemble_type ($from);
-    my $to_details = Common::TypeDetails::disassemble_type ($to);
+    return $subst;
+  }
+  else
+  {
+    my $from_value = $from_details->get_value_details ();
+    my $to_value = $to_details->get_value_details ();
 
-    if ($from_details->equal ($to_details, Common::TypeDetails::Base::RECURSIVE))
-    {
-      return $subst;
-    }
-    else
+    if ($from_value->get_base () eq $to_value->get_base ())
     {
-      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 ([['&'], ['*']], [['*&'], ['**']], [['**&'], ['***']])
       {
-        foreach my $sigil_pair ([['&'], ['*']], [['*&'], ['**']], [['**&'], ['***']])
-        {
-          my $from_sigil = $sigil_pair->[0];
-          my $to_sigil = $sigil_pair->[1];
+        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;
-          }
+        if ($from_details->match_sigil ($from_sigil) and $to_details->match_sigil ($to_sigil))
+        {
+          return '&' . $subst;
         }
       }
     }



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