mirror of
https://github.com/holub/mame
synced 2025-04-19 15:11:37 +03:00
Remove c99-type usage of non-const arrays. (nw)
This commit is contained in:
parent
c6db5abc81
commit
bb519c8c70
@ -154,45 +154,6 @@ NETLIB_UPDATE(7448_sub)
|
||||
update_outputs(v);
|
||||
}
|
||||
|
||||
#if 0
|
||||
ATTR_HOT void NETLIB_NAME(7448_sub)::inc_active()
|
||||
{
|
||||
const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
|
||||
nl_assert(netlist().use_deactivate());
|
||||
if (++m_active == 1)
|
||||
{
|
||||
m_A.activate();
|
||||
m_B.activate();
|
||||
m_C.activate();
|
||||
m_D.activate();
|
||||
m_RBIQ.activate();
|
||||
|
||||
netlist_time mt = this->m_Q[0].net().time();
|
||||
for (int i=1; i<7; i++)
|
||||
{
|
||||
if (this->m_Q[i].net().time() > mt)
|
||||
mt = this->m_Q[i].net().time();
|
||||
}
|
||||
|
||||
for (int i=0; i<7; i++)
|
||||
m_Q[i].net().set_Q_time( tab7448[m_state][i], mt + NLTIME_FROM_NS(100));
|
||||
}
|
||||
}
|
||||
|
||||
ATTR_HOT void NETLIB_NAME(7448_sub)::dec_active()
|
||||
{
|
||||
nl_assert(netlist().use_deactivate());
|
||||
if (--m_active == 0)
|
||||
{
|
||||
m_A.inactivate();
|
||||
m_B.inactivate();
|
||||
m_C.inactivate();
|
||||
m_D.inactivate();
|
||||
m_RBIQ.inactivate();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NETLIB_FUNC_VOID(7448_sub, update_outputs, (UINT8 v))
|
||||
{
|
||||
nl_assert(v<16);
|
||||
|
@ -63,11 +63,6 @@ NETLIB_SUBDEVICE(7448_sub,
|
||||
|
||||
netlist_logic_output_t m_Q[7]; /* a .. g */
|
||||
|
||||
// FIXME: doesn't work
|
||||
/*
|
||||
ATTR_HOT void inc_active();
|
||||
ATTR_HOT void dec_active();
|
||||
*/
|
||||
);
|
||||
|
||||
NETLIB_DEVICE(7448,
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "nld_truthtable.h"
|
||||
#include "../plists.h"
|
||||
|
||||
int truthtable_desc_t::count_bits(UINT32 v)
|
||||
{
|
||||
@ -170,7 +171,9 @@ ATTR_COLD void truthtable_desc_t::setup(const char **truthtable, UINT32 disabled
|
||||
nl_assert_always(times.count() == m_NO, "timing count not matching");
|
||||
|
||||
UINT16 val = 0;
|
||||
UINT8 tindex[m_NO];
|
||||
plinearlist_t<UINT8> tindex;
|
||||
tindex.set_count(m_NO);
|
||||
|
||||
for (int j=0; j<m_NO; j++)
|
||||
{
|
||||
pstring outs = out[j].trim();
|
||||
@ -192,7 +195,9 @@ ATTR_COLD void truthtable_desc_t::setup(const char **truthtable, UINT32 disabled
|
||||
}
|
||||
|
||||
// determine ignore
|
||||
UINT32 ign[m_size];
|
||||
plinearlist_t<UINT32> ign;
|
||||
ign.set_count(m_size);
|
||||
|
||||
for (int j=0; j < m_size; j++)
|
||||
ign[j] = -1;
|
||||
|
||||
|
@ -162,6 +162,17 @@ public:
|
||||
clear();
|
||||
}
|
||||
|
||||
ATTR_COLD void set_count(const int new_count)
|
||||
{
|
||||
if (new_count < m_count)
|
||||
m_count = new_count;
|
||||
else
|
||||
{
|
||||
resize(new_count);
|
||||
m_count = new_count;
|
||||
}
|
||||
|
||||
}
|
||||
private:
|
||||
ATTR_COLD void resize(const int new_size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user