mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
netlist: Fix more lint warnings/hints (nw)
This commit is contained in:
parent
29eac3a315
commit
1077396473
@ -16,7 +16,6 @@
|
||||
#define xstr(s) # s
|
||||
|
||||
#define NETLIB_DEVICE_DECL(chip) extern factory::constructor_ptr_t decl_ ## chip
|
||||
|
||||
#define LIB_DECL(nic, decl) factory.register_device( decl ( pstring(xstr(nic))) );
|
||||
#define LIB_ENTRY(nic) { NETLIB_DEVICE_DECL(nic); LIB_DECL(NETLIB_NAME(nic), decl_ ## nic) }
|
||||
|
||||
|
@ -14,8 +14,8 @@ namespace netlist
|
||||
namespace devices
|
||||
{
|
||||
|
||||
static constexpr const netlist_time delay_107[2] = { NLTIME_FROM_NS(16), NLTIME_FROM_NS(25) };
|
||||
static constexpr const netlist_time delay_107A[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(15) };
|
||||
static constexpr const std::array<netlist_time, 2> delay_107 = { NLTIME_FROM_NS(16), NLTIME_FROM_NS(25) };
|
||||
static constexpr const std::array<netlist_time, 2> delay_107A = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(15) };
|
||||
|
||||
NETLIB_OBJECT(74107A)
|
||||
{
|
||||
@ -46,7 +46,7 @@ namespace netlist
|
||||
logic_output_t m_Q;
|
||||
logic_output_t m_QQ;
|
||||
|
||||
netlist_time m_delay[2];
|
||||
std::array<netlist_time, 2> m_delay;
|
||||
|
||||
logic_input_t m_J;
|
||||
logic_input_t m_K;
|
||||
|
@ -45,7 +45,7 @@ namespace devices
|
||||
|
||||
NETLIB_HANDLERI(sub)
|
||||
{
|
||||
constexpr const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
|
||||
constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
|
||||
if (!m_G())
|
||||
{
|
||||
auto t = m_C[m_chan]();
|
||||
|
@ -71,8 +71,8 @@ namespace netlist
|
||||
}
|
||||
};
|
||||
|
||||
constexpr const netlist_time delay[2] = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) };
|
||||
constexpr const netlist_time delay_clear[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
|
||||
constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) };
|
||||
constexpr const std::array<netlist_time, 2> delay_clear = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
|
||||
|
||||
NETLIB_HANDLER(74175, clk)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ namespace netlist
|
||||
}
|
||||
|
||||
// FIXME: Timing
|
||||
static constexpr const netlist_time delay[4] =
|
||||
static constexpr const std::array<netlist_time, 4> delay =
|
||||
{
|
||||
NLTIME_FROM_NS(40),
|
||||
NLTIME_FROM_NS(40),
|
||||
|
@ -91,7 +91,7 @@ namespace netlist
|
||||
}
|
||||
|
||||
// FIXME: Timing
|
||||
static constexpr const netlist_time delay[4] =
|
||||
static constexpr const std::array<netlist_time, 4> delay =
|
||||
{
|
||||
NLTIME_FROM_NS(40),
|
||||
NLTIME_FROM_NS(40),
|
||||
|
@ -13,6 +13,9 @@ namespace netlist
|
||||
{
|
||||
namespace devices
|
||||
{
|
||||
|
||||
static constexpr const std::array<netlist_time, 2> times = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
|
||||
|
||||
NETLIB_OBJECT(7450)
|
||||
{
|
||||
NETLIB_CONSTRUCTOR(7450)
|
||||
@ -78,8 +81,6 @@ namespace netlist
|
||||
auto t1 = m_A() & m_B();
|
||||
auto t2 = m_C() & m_D();
|
||||
|
||||
const netlist_time times[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
|
||||
|
||||
uint_fast8_t res = 0;
|
||||
if (t1 ^ 1)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ namespace netlist
|
||||
m_last_B = 0;
|
||||
}
|
||||
|
||||
static constexpr const netlist_time delay[4] =
|
||||
static constexpr const std::array<netlist_time, 4> delay =
|
||||
{
|
||||
NLTIME_FROM_NS(18),
|
||||
NLTIME_FROM_NS(36) - NLTIME_FROM_NS(18),
|
||||
|
@ -18,8 +18,8 @@ namespace netlist
|
||||
namespace devices
|
||||
{
|
||||
|
||||
static constexpr const netlist_time out_delay_CLK_Y[2] = { NLTIME_FROM_NS(20), NLTIME_FROM_NS(26) }; // tPHL, tPLH
|
||||
static constexpr const netlist_time out_delay_CLK_Z[2] = { NLTIME_FROM_NS(17), NLTIME_FROM_NS(12) };
|
||||
static constexpr const std::array<netlist_time, 2> out_delay_CLK_Y = { NLTIME_FROM_NS(20), NLTIME_FROM_NS(26) }; // tPHL, tPLH
|
||||
static constexpr const std::array<netlist_time, 2> out_delay_CLK_Z = { NLTIME_FROM_NS(17), NLTIME_FROM_NS(12) };
|
||||
|
||||
NETLIB_OBJECT(7497)
|
||||
{
|
||||
|
@ -258,7 +258,7 @@ ptokenizer::token_t ptokenizer::get_token_internal()
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
ppreprocessor::ppreprocessor(defines_map_type *defines)
|
||||
: std::istream(new st(this))
|
||||
: std::istream(new readbuffer(this))
|
||||
, m_ifflag(0)
|
||||
, m_level(0)
|
||||
, m_lineno(0)
|
||||
|
@ -197,9 +197,8 @@ public:
|
||||
COPYASSIGN(ppreprocessor, delete)
|
||||
ppreprocessor &operator=(ppreprocessor &&src) = delete;
|
||||
|
||||
|
||||
ppreprocessor(ppreprocessor &&s) noexcept
|
||||
: std::istream(new st(this))
|
||||
: std::istream(new readbuffer(this))
|
||||
, m_defines(std::move(s.m_defines))
|
||||
, m_expr_sep(std::move(s.m_expr_sep))
|
||||
, m_ifflag(s.m_ifflag)
|
||||
@ -214,11 +213,14 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
class st : public std::streambuf
|
||||
class readbuffer : public std::streambuf
|
||||
{
|
||||
public:
|
||||
st(ppreprocessor *strm) : m_strm(strm), m_buf() { setg(nullptr, nullptr, nullptr); }
|
||||
st(st &&rhs) noexcept : m_strm(rhs.m_strm), m_buf() {}
|
||||
readbuffer(ppreprocessor *strm) : m_strm(strm), m_buf() { setg(nullptr, nullptr, nullptr); }
|
||||
readbuffer(readbuffer &&rhs) noexcept : m_strm(rhs.m_strm), m_buf() {}
|
||||
COPYASSIGN(readbuffer, delete)
|
||||
readbuffer &operator=(readbuffer &&src) = delete;
|
||||
|
||||
int_type underflow() override
|
||||
{
|
||||
//printf("here\n");
|
||||
|
@ -69,9 +69,8 @@ namespace plib {
|
||||
using generic_function = void (*)();
|
||||
|
||||
template<typename MemberFunctionType>
|
||||
mfp(MemberFunctionType mftp) // NOLINT(cppcoreguidelines-pro-type-member-init)
|
||||
|
||||
: m_function(0), m_this_delta(0), m_size(sizeof(mfp))
|
||||
mfp(MemberFunctionType mftp) // XXNOLINT(cppcoreguidelines-pro-type-member-init)
|
||||
: m_function(0), m_this_delta(0), m_dummy1(0), m_dummy2(0), m_size(sizeof(mfp))
|
||||
{
|
||||
*reinterpret_cast<MemberFunctionType *>(this) = mftp;
|
||||
}
|
||||
|
@ -15,12 +15,12 @@
|
||||
#include "pstring.h"
|
||||
|
||||
#include <array>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <ios>
|
||||
#include <fstream>
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace plib {
|
||||
|
||||
|
@ -12,10 +12,10 @@
|
||||
#include "pstring.h"
|
||||
#include <algorithm>
|
||||
#include <initializer_list>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#define PSTRINGIFY_HELP(y) # y
|
||||
#define PSTRINGIFY(x) PSTRINGIFY_HELP(x)
|
||||
|
@ -10,16 +10,16 @@
|
||||
|
||||
#include "netlist/plib/pmain.h"
|
||||
#include "netlist/devices/net_lib.h"
|
||||
#include "netlist/nl_parser.h"
|
||||
#include "netlist/nl_errstr.h"
|
||||
#include "netlist/nl_parser.h"
|
||||
#include "netlist/nl_setup.h"
|
||||
#include "netlist/solver/nld_solver.h"
|
||||
#include "netlist/tools/nl_convert.h"
|
||||
|
||||
#include <cstdio> // scanf
|
||||
#include <iomanip> // scanf
|
||||
#include <iostream> // scanf
|
||||
#include <ios>
|
||||
#include <iostream> // scanf
|
||||
|
||||
#define NLTOOL_VERSION 20190420
|
||||
|
||||
|
@ -75,9 +75,9 @@ public:
|
||||
private:
|
||||
struct riff_chunk_t
|
||||
{
|
||||
uint8_t group_id[4] = {'R','I','F','F'};
|
||||
uint32_t filelen = 0;
|
||||
uint8_t rifftype[4] = {'W','A','V','E'};
|
||||
std::array<uint8_t, 4> group_id = {'R','I','F','F'};
|
||||
uint32_t filelen = 0;
|
||||
std::array<uint8_t, 4> rifftype = {'W','A','V','E'};
|
||||
};
|
||||
|
||||
struct riff_format_t
|
||||
@ -89,7 +89,7 @@ private:
|
||||
block_align = channels * ((bits_sample + 7) / 8);
|
||||
bytes_per_second = sample_rate * block_align;
|
||||
}
|
||||
uint8_t signature[4] = {'f','m','t',' '};
|
||||
std::array<uint8_t, 4> signature = {'f','m','t',' '};
|
||||
uint32_t fmt_length = 16;
|
||||
uint16_t format_tag = 0x0001; // PCM
|
||||
uint16_t channels;
|
||||
@ -102,7 +102,7 @@ private:
|
||||
struct riff_data_t
|
||||
{
|
||||
riff_data_t(uint32_t alen) : len(alen) {}
|
||||
uint8_t signature[4] = {'d','a','t','a'};
|
||||
std::array<uint8_t, 4> signature = {'d','a','t','a'};
|
||||
uint32_t len;
|
||||
// data follows
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user