[Pkg-electronics-commits] [gnucap] 28/47: subckt-1: rebase, testing, headers

felix salfelder felix-guest at moszumanska.debian.org
Mon Sep 26 10:37:08 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 52302682342db2ef7303ac0450d65e553356147f
Author: al davis <ad211 at freeelectron.net>
Date:   Fri Sep 16 19:58:36 2016 -0400

    subckt-1: rebase, testing, headers
---
 apps/Make.depend     | 45 ++++++++++++++-------------------
 apps/c_delete.cc     |  4 +--
 apps/lang_spectre.cc |  3 ++-
 apps/lang_spice.cc   |  6 ++---
 apps/lang_verilog.cc |  6 ++---
 include/d_subckt.h   |  3 +--
 include/e_subckt.h   |  2 +-
 include/patchlev.h   |  2 +-
 lib/Make.depend      | 31 +++++++++++------------
 lib/d_logic.cc       |  2 +-
 lib/d_subckt.cc      | 70 +++++++++++++++++++++++++++-------------------------
 lib/e_card.cc        | 22 ++++++++---------
 lib/e_cardlist.cc    |  2 +-
 lib/u_lang.cc        | 52 +++++++++++++++++---------------------
 14 files changed, 119 insertions(+), 131 deletions(-)

diff --git a/apps/Make.depend b/apps/Make.depend
index 10f6f76..beb389e 100644
--- a/apps/Make.depend
+++ b/apps/Make.depend
@@ -465,15 +465,11 @@ c_comand.o: c_comand.cc ../include/constant.h ../include/md.h \
  ../include/e_card.h ../include/e_base.h ../include/globals.h \
  ../include/l_dispatcher.h ../include/l_stlextra.h ../include/u_opt.h \
  ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h
-c_delete.o: c_delete.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/d_subckt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/e_subckt.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h ../include/c_comand.h
+c_delete.o: c_delete.cc ../include/e_cardlist.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/ap.h ../include/c_comand.h ../include/e_card.h
 c_exp.o: c_exp.cc ../include/globals.h ../include/l_dispatcher.h \
  ../include/e_base.h ../include/md.h ../include/io_trace.h \
  ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
@@ -641,36 +637,33 @@ lang_spice.o: lang_spice.cc ../include/globals.h \
  ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
  ../include/ap.h ../include/u_status.h ../include/l_timer.h \
  ../include/c_comand.h ../include/e_card.h ../include/d_dot.h \
- ../include/d_coment.h ../include/d_subckt.h ../include/e_node.h \
+ ../include/d_coment.h ../include/e_subckt.h ../include/e_compon.h \
  ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/e_subckt.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_matrix.h ../include/u_time_pair.h ../include/u_parameter.h \
  ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
  ../include/u_lang.h ../include/d_logic.h ../include/e_model.h \
- ../include/e_elemnt.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/bm.h
+ ../include/e_elemnt.h ../include/e_node.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/bm.h
 lang_spectre.o: lang_spectre.cc ../include/globals.h \
  ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
  ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
  ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
  ../include/ap.h ../include/c_comand.h ../include/e_card.h \
- ../include/d_dot.h ../include/d_coment.h ../include/d_subckt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/e_subckt.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_model.h ../include/u_lang.h
+ ../include/d_dot.h ../include/d_coment.h ../include/e_subckt.h \
+ ../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_model.h ../include/u_lang.h
 lang_verilog.o: lang_verilog.cc ../include/globals.h \
  ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
  ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
  ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
  ../include/ap.h ../include/c_comand.h ../include/e_card.h \
- ../include/d_dot.h ../include/d_coment.h ../include/d_subckt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/e_subckt.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_model.h ../include/u_lang.h
+ ../include/d_dot.h ../include/d_coment.h ../include/e_subckt.h \
+ ../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_model.h ../include/u_lang.h
 func_core.o: func_core.cc ../include/globals.h ../include/l_dispatcher.h \
  ../include/e_base.h ../include/md.h ../include/io_trace.h \
  ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
diff --git a/apps/c_delete.cc b/apps/c_delete.cc
index b22ad18..07a9af0 100644
--- a/apps/c_delete.cc
+++ b/apps/c_delete.cc
@@ -28,7 +28,7 @@
 // usually before anything else.
 
 #include "globals.h"
-#include "d_subckt.h"
+#include "e_cardlist.h"
 #include "c_comand.h"
 /*--------------------------------------------------------------------------*/
 namespace {
@@ -62,7 +62,7 @@ private:
       if (i == Scope->end()) {
 	// can't find "container" (probably .subckt) - no match
 	return false;
-      }else if (!dynamic_cast<BASE_SUBCKT*>(*i)) {
+      }else if ((**i).is_device()) {
 	// found a match, but it isn't a container (subckt)
 	return false;
       }else{
diff --git a/apps/lang_spectre.cc b/apps/lang_spectre.cc
index 600f803..57d6e3d 100644
--- a/apps/lang_spectre.cc
+++ b/apps/lang_spectre.cc
@@ -24,7 +24,7 @@
 #include "c_comand.h"
 #include "d_dot.h"
 #include "d_coment.h"
-#include "d_subckt.h"
+#include "e_subckt.h"
 #include "e_model.h"
 #include "u_lang.h"
 /*--------------------------------------------------------------------------*/
@@ -418,6 +418,7 @@ class CMD_SUBCKT : public CMD {
     assert(new_module->subckt());
     assert(new_module->subckt()->is_empty());
     lang_spectre.parse_module(cmd, new_module);
+    assert(!new_module->is_device());
     Scope->push_back(new_module);
   }
 } p2;
diff --git a/apps/lang_spice.cc b/apps/lang_spice.cc
index 18b23d6..72191b8 100644
--- a/apps/lang_spice.cc
+++ b/apps/lang_spice.cc
@@ -25,7 +25,7 @@
 #include "c_comand.h"
 #include "d_dot.h"
 #include "d_coment.h"
-#include "d_subckt.h"
+#include "e_subckt.h"
 #include "u_lang.h"
 #include "d_logic.h"
 #include "bm.h"
@@ -587,7 +587,7 @@ void LANG_SPICE_BASE::parse_module_body(CS& cmd, BASE_SUBCKT* x, CARD_LIST* Scop
 /*--------------------------------------------------------------------------*/
 COMPONENT* LANG_SPICE_BASE::parse_instance(CS& cmd, COMPONENT* x)
 {
-  try { untested();
+  try {
     assert(x);
     cmd.reset().umatch(ANTI_COMMENT);
     
@@ -860,7 +860,7 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, ".model", &p1);
 /*--------------------------------------------------------------------------*/
 class CMD_SUBCKT : public CMD {
   void do_it(CS& cmd, CARD_LIST* Scope)
-  { untested();
+  {
     const CARD* s = device_dispatcher["subckt"];
     assert(s); // for now
     BASE_SUBCKT* new_module = dynamic_cast<BASE_SUBCKT*>(s->clone());
diff --git a/apps/lang_verilog.cc b/apps/lang_verilog.cc
index 7cf78b8..8423fcf 100644
--- a/apps/lang_verilog.cc
+++ b/apps/lang_verilog.cc
@@ -24,7 +24,7 @@
 #include "c_comand.h"
 #include "d_dot.h"
 #include "d_coment.h"
-#include "d_subckt.h"
+#include "e_subckt.h"
 #include "e_model.h"
 #include "u_lang.h"
 /*--------------------------------------------------------------------------*/
@@ -262,7 +262,7 @@ MODEL_CARD* LANG_VERILOG::parse_paramset(CS& cmd, MODEL_CARD* x)
 //BUG// strictly one device per line
 
 BASE_SUBCKT* LANG_VERILOG::parse_module(CS& cmd, BASE_SUBCKT* x)
-{ untested();
+{
   assert(x);
 
   // header
@@ -489,7 +489,7 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "paramset", &p1);
 /*--------------------------------------------------------------------------*/
 class CMD_MODULE : public CMD {
   void do_it(CS& cmd, CARD_LIST* Scope)
-  { untested();
+  {
     CARD const* sckt = device_dispatcher["subckt"];
     assert(sckt);
     BASE_SUBCKT* new_module = dynamic_cast<BASE_SUBCKT*>(sckt->clone());
diff --git a/include/d_subckt.h b/include/d_subckt.h
index 51dd553..981bf81 100644
--- a/include/d_subckt.h
+++ b/include/d_subckt.h
@@ -24,8 +24,7 @@
 //testing=script,sparse 2006.07.17
 #ifndef D_SUBCKT_H
 #define D_SUBCKT_H
-#include "e_node.h"
-#include "e_subckt.h"
+#include "e_compon.h"
 /*--------------------------------------------------------------------------*/
 /*--------------------------------------------------------------------------*/
 class INTERFACE COMMON_SUBCKT : public COMMON_COMPONENT {
diff --git a/include/e_subckt.h b/include/e_subckt.h
index 423266c..d5a1d5e 100644
--- a/include/e_subckt.h
+++ b/include/e_subckt.h
@@ -42,7 +42,7 @@ protected: // override virtual
   //int	  min_nodes()const		//COMPONENT/null
   int     matrix_nodes()const		{return 0;}
   int     net_nodes()const		{return _net_nodes;}
-  CARD*   clone()const			{unreachable(); return NULL;}
+  //CARD*   clone()const			{unreachable(); return NULL;}
   //void  precalc_first()	{assert(subckt()); subckt()->precalc();}
   //void  expand()			//COMPONENT
   //void  precalc_last()	{assert(subckt()); subckt()->precalc();}
diff --git a/include/patchlev.h b/include/patchlev.h
index b4e2b1b..12eef8b 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "bm_pulse 2016.09.15"
+#define PATCHLEVEL "subckt-1 2016.09.16"
diff --git a/lib/Make.depend b/lib/Make.depend
index 5dbd014..234cca2 100644
--- a/lib/Make.depend
+++ b/lib/Make.depend
@@ -83,10 +83,9 @@ u_lang.o: u_lang.cc ../include/globals.h ../include/l_dispatcher.h \
  ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
  ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
  ../include/c_comand.h ../include/e_card.h ../include/d_dot.h \
- ../include/d_coment.h ../include/d_subckt.h ../include/e_node.h \
+ ../include/d_coment.h ../include/e_subckt.h ../include/e_compon.h \
  ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/e_subckt.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_matrix.h ../include/u_time_pair.h ../include/u_parameter.h \
  ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
  ../include/e_model.h ../include/u_lang.h
 u_nodemap.o: u_nodemap.cc ../include/e_node.h ../include/u_sim_data.h \
@@ -135,25 +134,25 @@ u_xprobe.o: u_xprobe.cc ../include/m_phase.h ../include/constant.h \
  ../include/md.h ../include/io_trace.h ../include/io_error.h \
  ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
  ../include/u_xprobe.h
-d_subckt.o: d_subckt.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/d_subckt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/e_subckt.h ../include/e_compon.h ../include/u_time_pair.h \
+d_subckt.o: d_subckt.cc ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_compar.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/ap.h \
+ ../include/d_subckt.h ../include/e_compon.h ../include/u_time_pair.h \
  ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h
+ ../include/e_cardlist.h ../include/e_card.h ../include/e_subckt.h
 d_logic.o: d_logic.cc ../include/globals.h ../include/l_dispatcher.h \
  ../include/e_base.h ../include/md.h ../include/io_trace.h \
  ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
  ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/d_subckt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_subckt.h ../include/e_compon.h ../include/u_sim_data.h \
  ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/e_subckt.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h ../include/u_xprobe.h \
- ../include/d_logic.h ../include/e_model.h ../include/e_elemnt.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h ../include/u_xprobe.h ../include/d_logic.h \
+ ../include/e_model.h ../include/e_elemnt.h ../include/e_node.h \
  ../include/m_cpoly.h ../include/l_denoise.h
 d_logicmod.o: d_logicmod.cc ../include/d_logic.h ../include/e_model.h \
  ../include/u_parameter.h ../include/u_opt.h ../include/mode.h \
diff --git a/lib/d_logic.cc b/lib/d_logic.cc
index df48fad..1652936 100644
--- a/lib/d_logic.cc
+++ b/lib/d_logic.cc
@@ -26,7 +26,7 @@
  */
 //testing=script,sparse 2006.07.17
 #include "globals.h"
-#include "d_subckt.h"
+#include "e_subckt.h"
 #include "u_xprobe.h"
 #include "d_logic.h"
 /*--------------------------------------------------------------------------*/
diff --git a/lib/d_subckt.cc b/lib/d_subckt.cc
index 95f99d3..b934f56 100644
--- a/lib/d_subckt.cc
+++ b/lib/d_subckt.cc
@@ -31,8 +31,10 @@
  * the expansion (attact to the X) has all comments removed
  *	- need to process the entire ring - for doesn't work
  */
+#include "e_node.h"
 #include "globals.h"
 #include "d_subckt.h"
+#include "e_subckt.h"
 /*--------------------------------------------------------------------------*/
 int COMMON_SUBCKT::_count = -1;
 static COMMON_SUBCKT Default_SUBCKT(CC_STATIC);
@@ -119,7 +121,7 @@ private:
 public:
   explicit	DEV_SUBCKT();
 		~DEV_SUBCKT()	{--_count;}
-  CARD*		clone()const		{untested(); return new DEV_SUBCKT(*this);}
+  CARD*		clone()const		{return new DEV_SUBCKT(*this);}
 private: // override virtual
   char		id_letter()const	{return 'X';}
   bool		print_type_in_spice()const {return true;}
@@ -166,30 +168,30 @@ public: // override virtual
   int		min_nodes()const	{return 0;}
   int		matrix_nodes()const	{untested();return 0;}
   int		net_nodes()const	{return _net_nodes;}
-  CARD*		clone()const		{untested(); return new DEV_SUBCKT_PROTO(*this);}
+  CARD*		clone()const		{return new DEV_SUBCKT_PROTO(*this);}
   bool		is_device()const	{return false;}
   bool		makes_own_scope()const  {return true;}
   CARD_LIST*	   scope()		{return subckt();}
   const CARD_LIST* scope()const		{return subckt();}
 private: // no-ops for prototype
-  void precalc_first(){untested();}
-  void expand(){untested();}
-  void precalc_last(){untested();}
-  void map_nodes(){untested();}
-  void tr_begin(){untested();}
-  void tr_load(){untested();}
-  TIME_PAIR tr_review(){untested(); return TIME_PAIR(NEVER, NEVER);}
-  void tr_accept(){untested();}
-  void tr_advance(){untested();}
-  void tr_restore(){untested();}
-  void tr_regress(){untested();}
-  void dc_advance(){untested();}
-  void ac_begin(){untested();}
-  void do_ac(){untested();}
-  void ac_load(){untested();}
-  bool do_tr(){untested(); return true;}
+  void precalc_first(){}
+  void expand(){}
+  void precalc_last(){}
+  void map_nodes(){}
+  void tr_begin(){}
+  void tr_load(){}
+  TIME_PAIR tr_review(){ return TIME_PAIR(NEVER, NEVER);}
+  void tr_accept(){}
+  void tr_advance(){}
+  void tr_restore(){}
+  void tr_regress(){}
+  void dc_advance(){}
+  void ac_begin(){}
+  void do_ac(){}
+  void ac_load(){}
+  bool do_tr(){ return true;}
   bool tr_needs_eval()const{untested(); return false;}
-  void tr_queue_eval(){untested();}
+  void tr_queue_eval(){}
   std::string port_name(int)const {return "";}
 public:
   static int	count()			{return _count;}
@@ -204,25 +206,25 @@ static DISPATCHER<CARD>::INSTALL
 /*--------------------------------------------------------------------------*/
 DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO(const DEV_SUBCKT_PROTO& p)
   :DEV_SUBCKT(p)
-{ untested();
+{
   new_subckt();
 }
 /*--------------------------------------------------------------------------*/
 DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO()
   :DEV_SUBCKT()
-{ untested();
+{
   new_subckt();
 }
 /*--------------------------------------------------------------------------*/
 CARD* DEV_SUBCKT_PROTO::clone_instance()const
-{untested();
+{
   DEV_SUBCKT* new_instance = dynamic_cast<DEV_SUBCKT*>(p1.clone());
   assert(!new_instance->subckt());
 
-  if (this == &pp){ untested();
+  if (this == &pp){
     // cloning from static, empty model
     // look out for _parent in expand
-  }else{ untested();
+  }else{
     new_instance->_parent = this;
   }
 
@@ -233,7 +235,7 @@ CARD* DEV_SUBCKT_PROTO::clone_instance()const
 DEV_SUBCKT::DEV_SUBCKT()
   :BASE_SUBCKT(),
    _parent(NULL)
-{ untested();
+{
   attach_common(&Default_SUBCKT);
   _n = _nodes;
   ++_count;
@@ -242,7 +244,7 @@ DEV_SUBCKT::DEV_SUBCKT()
 DEV_SUBCKT::DEV_SUBCKT(const DEV_SUBCKT& p)
   :BASE_SUBCKT(p),
    _parent(p._parent)
-{ untested();
+{
   //strcpy(modelname, p.modelname); in common
   for (int ii = 0;  ii < max_nodes();  ++ii) {
     _nodes[ii] = p._nodes[ii];
@@ -255,7 +257,7 @@ DEV_SUBCKT::DEV_SUBCKT(const DEV_SUBCKT& p)
 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();
+    if (i<p->net_nodes()){
       return p->port_value(i);
     }else{ untested();
       return "";
@@ -269,20 +271,20 @@ std::string DEV_SUBCKT::port_name(int i)const
 }
 /*--------------------------------------------------------------------------*/
 void DEV_SUBCKT::expand()
-{ untested();
+{
   BASE_SUBCKT::expand();
   COMMON_SUBCKT* c = prechecked_cast<COMMON_SUBCKT*>(mutable_common());
   assert(c);
-  if (!_parent) { untested();
+  if (!_parent) {
     // get here when instanciating X, then set modelname
     assert(c->modelname()!="");
     const CARD* model = find_looking_out(c->modelname());
-    if(!dynamic_cast<const BASE_SUBCKT*>(model)) { untested();
+    if(!dynamic_cast<const BASE_SUBCKT*>(model)) {
       throw Exception_Type_Mismatch(long_label(), c->modelname(), "subckt");
-    }else{ untested();
+    }else{
       _parent = prechecked_cast<const BASE_SUBCKT*>(model);
     }
-  }else{ untested();
+  }else{
     // possible after clone_instance.
     assert(find_looking_out(c->modelname()) == _parent);
   }
@@ -301,12 +303,12 @@ void DEV_SUBCKT::precalc_first()
 {
   BASE_SUBCKT::precalc_first();
 
-  if (subckt()) { untested();
+  if (subckt()) {
     COMMON_SUBCKT* c = prechecked_cast<COMMON_SUBCKT*>(mutable_common());
     assert(c);
     subckt()->attach_params(&(c->_params), scope());
     subckt()->precalc_first();
-  }else{ untested();
+  }else{
   }
   assert(!is_constant()); /* because I have more work to do */
 }
diff --git a/lib/e_card.cc b/lib/e_card.cc
index d01a5be..05124ca 100644
--- a/lib/e_card.cc
+++ b/lib/e_card.cc
@@ -165,21 +165,21 @@ const CARD* CARD::find_in_parent_scope(const std::string& name)const
  * throws exception if can't find.
  */
 const CARD* CARD::find_looking_out(const std::string& name)const
-{ untested();
-  try { untested();
+{
+  try {
     return find_in_parent_scope(name);
-  }catch (Exception_Cant_Find&) { untested();
-    if (owner()) { untested();
+  }catch (Exception_Cant_Find&) {
+    if (owner()) {
       return owner()->find_looking_out(name);
-    }else if (makes_own_scope()) { untested();
+    }else if (makes_own_scope()) {
       // probably a subckt or "module"
       CARD_LIST::const_iterator i = CARD_LIST::card_list.find_(name);
-      if (i != CARD_LIST::card_list.end()) { untested();
+      if (i != CARD_LIST::card_list.end()) {
 	return *i;
-      }else{ untested();
+      }else{
 	throw;
       }
-    }else{ untested();
+    }else{
       throw;
     }
   }
@@ -197,11 +197,11 @@ void CARD::new_subckt()
 }
 /*--------------------------------------------------------------------------*/
 void CARD::new_subckt(const CARD* Model, PARAM_LIST* Params)
-{ itested();
+{
   delete _subckt;
-  try{ itested();
+  try{
     _subckt = new CARD_LIST(Model, this, scope(), Params);
-  }catch(...){ itested();
+  }catch(...){untested();
     // BUG?
     // new CARD_LIST must not throw if it has been successful previously.
     assert(!_subckt);
diff --git a/lib/e_cardlist.cc b/lib/e_cardlist.cc
index 6c43572..6e6826c 100644
--- a/lib/e_cardlist.cc
+++ b/lib/e_cardlist.cc
@@ -504,7 +504,7 @@ void CARD_LIST::map_subckt_nodes(const CARD* model, const CARD* owner)
     if ((**ci).is_device()) {
       for (int ii = 0;  ii < (**ci).net_nodes();  ++ii) {
 	// for each connection node in card
-	try{ untested();
+	try{
 	  (**ci).n_(ii).map_subckt_node(map, owner);
 	}catch(...){ untested();
 	  delete[] map;
diff --git a/lib/u_lang.cc b/lib/u_lang.cc
index 586425d..7ded7e1 100644
--- a/lib/u_lang.cc
+++ b/lib/u_lang.cc
@@ -24,7 +24,7 @@
 #include "c_comand.h"
 #include "d_dot.h"
 #include "d_coment.h"
-#include "d_subckt.h"
+#include "e_subckt.h"
 #include "e_model.h"
 #include "u_lang.h"
 /*--------------------------------------------------------------------------*/
@@ -127,20 +127,18 @@ CARD* LANGUAGE::parse_item(CS& cmd, CARD* c)
   // If you can think of a better way, tell me.
   // It must be in the LANGUAGE class, not CARD.
 
-  if (BASE_SUBCKT* s=dynamic_cast<BASE_SUBCKT*>(c)) { untested();
-    if (c->is_device()){ untested();
-      return parse_instance(cmd, s);
-    }else{ untested();
-      return parse_module(cmd, s);
-    }
-  }else if (dynamic_cast<COMPONENT*>(c)) {
+  assert(c);
+  if (c->is_device()){
+    assert(dynamic_cast<COMPONENT*>(c));
     return parse_instance(cmd, prechecked_cast<COMPONENT*>(c));
-  }else if (dynamic_cast<MODEL_CARD*>(c)) {untested();
-    return parse_paramset(cmd, prechecked_cast<MODEL_CARD*>(c));
-  }else if (dynamic_cast< DEV_COMMENT*>(c)) {
-    return parse_comment(cmd, prechecked_cast<DEV_COMMENT*>(c));
-  }else if (dynamic_cast<DEV_DOT*>(c)) {
-    return parse_command(cmd, prechecked_cast<DEV_DOT*>(c));
+  }else if (BASE_SUBCKT* s = dynamic_cast<BASE_SUBCKT*>(c)) {
+    return parse_module(cmd, s);
+  }else if (MODEL_CARD* m = dynamic_cast<MODEL_CARD*>(c)) {untested();
+    return parse_paramset(cmd, m);
+  }else if (DEV_COMMENT* com = dynamic_cast<DEV_COMMENT*>(c)) {
+    return parse_comment(cmd, com);
+  }else if (DEV_DOT* d = dynamic_cast<DEV_DOT*>(c)) {
+    return parse_command(cmd, d);
   }else{untested();
     incomplete();
     unreachable();
@@ -153,23 +151,19 @@ void LANGUAGE::print_item(OMSTREAM& o, const CARD* c)
   // See Stroustrup 15.4.5
   // If you can think of a better way, tell me.
   // It must be in the LANGUAGE class, not CARD.
-  assert(c);
-  assert(dynamic_cast<const CARD*>(c));
 
-  if (const BASE_SUBCKT* s=dynamic_cast<const BASE_SUBCKT*>(c)) { untested();
-    if (s->is_device()){ untested();
-      print_instance(o, s);
-    }else{ untested();
-      print_module(o, s);
-    }
-  }else if (dynamic_cast<const COMPONENT*>(c)) {
+  assert(c);
+  if (c->is_device()){
+    assert(dynamic_cast<const COMPONENT*>(c));
     print_instance(o, prechecked_cast<const COMPONENT*>(c));
-  }else if (dynamic_cast<const MODEL_CARD*>(c)) {
-    print_paramset(o, prechecked_cast<const MODEL_CARD*>(c));
-  }else if (dynamic_cast<const DEV_COMMENT*>(c)) {
-    print_comment(o, prechecked_cast<const DEV_COMMENT*>(c));
-  }else if (dynamic_cast<const DEV_DOT*>(c)) {untested();
-    print_command(o, prechecked_cast<const DEV_DOT*>(c));
+  }else if (const BASE_SUBCKT* s = dynamic_cast<const BASE_SUBCKT*>(c)) {
+    print_module(o, s);
+  }else if (const MODEL_CARD* m = dynamic_cast<const MODEL_CARD*>(c)) {
+    print_paramset(o, m);
+  }else if (const DEV_COMMENT* com = dynamic_cast<const DEV_COMMENT*>(c)) {
+    print_comment(o, com);
+  }else if (const DEV_DOT* d = dynamic_cast<const DEV_DOT*>(c)) {untested();
+    print_command(o, d);
   }else{untested();
     incomplete();
     unreachable();

-- 
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