Fix some pedantic clang warnings. (nw)

This commit is contained in:
couriersud 2017-01-04 20:30:07 +01:00
parent ac111836fd
commit 67841056da
6 changed files with 7 additions and 7 deletions

View File

@ -73,7 +73,7 @@ namespace netlist
// FIXME: Timing
NETLIB_UPDATE(7485)
{
for (std::int_fast32_t i = 3; i >= 0; i--)
for (std::size_t i = 3; i-- > 0; )
{
if (m_A[i]() > m_B[i]())
{

View File

@ -113,7 +113,7 @@ namespace netlist
}
}
uint_fast8_t q = m_last_Q;
unsigned q = m_last_Q;
if (!m_CQ())
{

View File

@ -70,7 +70,7 @@ namespace netlist
//m_V0.initial(0.0);
//m_RV.do_reset();
m_RV.set(NL_FCONST(1.0) / R_LOW, 0.0, 0.0);
m_inc = netlist_time::from_hz(m_FREQ());
m_inc = netlist_time::from_double(1.0 / m_FREQ());
if (m_FREQ() < 24000 || m_FREQ() > 56000)
netlist().log().warning("MM5837: Frequency outside of specs.", m_FREQ());
@ -80,7 +80,7 @@ namespace netlist
NETLIB_UPDATE_PARAM(MM5837_dip)
{
m_inc = netlist_time::from_hz(m_FREQ());
m_inc = netlist_time::from_double(1.0 / m_FREQ());
if (m_FREQ() < 24000 || m_FREQ() > 56000)
netlist().log().warning("MM5837: Frequency outside of specs.", m_FREQ());
}

View File

@ -37,7 +37,7 @@ namespace netlist { namespace factory
virtual ~element_t() {}
virtual plib::owned_ptr<device_t> Create(netlist_t &anetlist, const pstring &name) = 0;
virtual void macro_actions(netlist_t &anetlist, const pstring &name) {};
virtual void macro_actions(netlist_t &anetlist, const pstring &name) {}
const pstring &name() const { return m_name; }
const pstring &classname() const { return m_classname; }

View File

@ -68,7 +68,7 @@ fpsignalenabler::fpsignalenabler(unsigned fpexceptions)
#if HAS_FEENABLE_EXCEPT
if (m_enable)
{
unsigned b = 0;
int b = 0;
if (fpexceptions & plib::FP_INEXACT) b = b | FE_INEXACT;
if (fpexceptions & plib::FP_DIVBYZERO) b = b | FE_DIVBYZERO;
if (fpexceptions & plib::FP_UNDERFLOW) b = b | FE_UNDERFLOW;

View File

@ -101,7 +101,7 @@ public:
static bool global_enable(bool enable);
private:
unsigned m_last_enabled;
int m_last_enabled;
static bool m_enable;
};