[Pkg-electronics-commits] [gnucap] 27/47: compile fix DEV_SUBCKT::port_name

felix salfelder felix-guest at moszumanska.debian.org
Mon Sep 26 10:37:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository gnucap.

commit 1ed93ce0df4f0d6172c16fdaae022f7131b06ece
Author: Felix Salfelder <felix at salfelder.org>
Date:   Tue Sep 15 11:44:51 2015 +0200

    compile fix DEV_SUBCKT::port_name
---
 apps/lang_spice.cc |  2 +-
 lib/d_subckt.cc    | 28 +++++++++++++++++-----------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/apps/lang_spice.cc b/apps/lang_spice.cc
index 6131cf4..18b23d6 100644
--- a/apps/lang_spice.cc
+++ b/apps/lang_spice.cc
@@ -763,7 +763,7 @@ void LANG_SPICE_BASE::print_type(OMSTREAM& o, const COMPONENT* x)
   assert(x);
   if (x->print_type_in_spice()) {
     o << "  " << x->dev_type();
-  }else if (fix_case(x->short_label()[0]) != fix_case(x->id_letter())) {untested();
+  }else if (fix_case(x->short_label()[0]) != fix_case(x->id_letter())) {itested();
     o << "  " << x->dev_type();
   }else{
     // don't print type
diff --git a/lib/d_subckt.cc b/lib/d_subckt.cc
index 3cc4698..95f99d3 100644
--- a/lib/d_subckt.cc
+++ b/lib/d_subckt.cc
@@ -139,17 +139,7 @@ private:
   double	tr_probe_num(const std::string&)const;
   int param_count_dont_print()const {return common()->COMMON_COMPONENT::param_count();}
 
-  std::string port_name(int i)const {itested();
-    if (_parent) {itested();
-      if (i<_parent->net_nodes()){ untested();
-        return _parent->port_value(i);
-      }else{ untested();
-        return "";
-      }
-    }else{itested();
-      return "";
-    }
-  }
+  std::string port_name(int i)const;
 public:
   static int	count()			{return _count;}
 protected:
@@ -262,6 +252,22 @@ DEV_SUBCKT::DEV_SUBCKT(const DEV_SUBCKT& p)
   ++_count;
 }
 /*--------------------------------------------------------------------------*/
+std::string DEV_SUBCKT::port_name(int i)const
+{itested();
+  if (const DEV_SUBCKT* p=dynamic_cast<const DEV_SUBCKT*>(_parent)) {itested();
+    if (i<p->net_nodes()){ untested();
+      return p->port_value(i);
+    }else{ untested();
+      return "";
+    }
+  }else if(_parent){ untested();
+    // reachable?
+    return "";
+  }else{itested();
+    return "";
+  }
+}
+/*--------------------------------------------------------------------------*/
 void DEV_SUBCKT::expand()
 { untested();
   BASE_SUBCKT::expand();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git



More information about the Pkg-electronics-commits mailing list