summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2017-02-12 01:23:28 +0100
committer couriersud <couriersud@gmx.org>2017-02-13 00:51:41 +0100
commit290185cf00ba5e8f39437786ccb91af2123bc00e (patch)
tree067070c5a36242fe1403a635fe9af7e1fb3dba07 /src/lib/netlist
parentf2c3b5155392165ebbf0ae9c1f42ae98a15cb520 (diff)
Remove duplicate save states / Save state simplification. (nw)
Diffstat (limited to 'src/lib/netlist')
-rw-r--r--src/lib/netlist/nl_base.cpp6
-rw-r--r--src/lib/netlist/nl_base.h6
-rw-r--r--src/lib/netlist/nl_time.h2
-rw-r--r--src/lib/netlist/plib/pstate.h27
4 files changed, 12 insertions, 29 deletions
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index 14e16f8dbe7..bd1c6dcb9d0 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -994,9 +994,9 @@ logic_t::~logic_t()
terminal_t::terminal_t(core_device_t &dev, const pstring &aname)
: analog_t(dev, aname, STATE_BIDIR)
, m_otherterm(nullptr)
-, m_Idr1(*this, "m_Idr1", nullptr)
-, m_go1(*this, "m_go1", nullptr)
-, m_gt1(*this, "m_gt1", nullptr)
+, m_Idr1(nullptr)
+, m_go1(nullptr)
+, m_gt1(nullptr)
{
netlist().setup().register_term(*this);
}
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index b8cb99933a9..9b353da4370 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -589,9 +589,9 @@ namespace netlist
}
}
- state_var<nl_double *> m_Idr1; // drive current
- state_var<nl_double *> m_go1; // conductance for Voltage from other term
- state_var<nl_double *> m_gt1; // conductance for total conductance
+ nl_double *m_Idr1; // drive current
+ nl_double *m_go1; // conductance for Voltage from other term
+ nl_double *m_gt1; // conductance for total conductance
};
diff --git a/src/lib/netlist/nl_time.h b/src/lib/netlist/nl_time.h
index fd4ddb77445..1b94c4c4827 100644
--- a/src/lib/netlist/nl_time.h
+++ b/src/lib/netlist/nl_time.h
@@ -136,7 +136,7 @@ namespace netlist
namespace plib {
template<> inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &nlt, const pstring &stname)
{
- save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), false, true, false), 1, nlt.get_internaltype_ptr());
+ save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, nlt.get_internaltype_ptr());
}
}
diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h
index 27acaa0fb2c..7887d5a11ec 100644
--- a/src/lib/netlist/plib/pstate.h
+++ b/src/lib/netlist/plib/pstate.h
@@ -25,15 +25,14 @@ public:
struct datatype_t
{
- datatype_t(std::size_t bsize, bool bptr, bool bintegral, bool bfloat)
- : size(bsize), is_ptr(bptr), is_integral(bintegral), is_float(bfloat), is_custom(false)
+ datatype_t(std::size_t bsize, bool bintegral, bool bfloat)
+ : size(bsize), is_integral(bintegral), is_float(bfloat), is_custom(false)
{}
explicit datatype_t(bool bcustom)
- : size(0), is_ptr(false), is_integral(false), is_float(false), is_custom(bcustom)
+ : size(0), is_integral(false), is_float(false), is_custom(bcustom)
{}
const std::size_t size;
- const bool is_ptr;
const bool is_integral;
const bool is_float;
const bool is_custom;
@@ -43,15 +42,8 @@ public:
{
static inline const datatype_t f()
{
- return datatype_t(sizeof(T), false, plib::is_integral<T>::value || std::is_enum<T>::value,
- std::is_floating_point<T>::value); }
- };
-
- template<typename T> struct datatype_f<T *>
- {
- static inline const datatype_t f()
- {
- return datatype_t(sizeof(T), true, plib::is_integral<T>::value || std::is_enum<T>::value,
+ return datatype_t(sizeof(T),
+ plib::is_integral<T>::value || std::is_enum<T>::value,
std::is_floating_point<T>::value);
}
};
@@ -88,15 +80,6 @@ public:
callback_t * m_callback;
const std::size_t m_count;
void * m_ptr;
-
- template<typename T>
- T *resolved()
- {
- if (m_dt.is_ptr)
- return *static_cast<T **>(m_ptr);
- else
- return static_cast<T *>(m_ptr);
- }
};
state_manager_t();