summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2017-01-27 18:36:45 +0100
committer couriersud <couriersud@gmx.org>2017-01-27 18:38:01 +0100
commitcb16de91c61c387b3215d77c16fbef0376a23677 (patch)
tree86435e9cced881b4053ccafbf92211d2458e5208 /src
parent5b0d4772a392461ebb7b6d450517bd0fe5ceca7d (diff)
Minor refactoring. (nw)
Diffstat (limited to 'src')
-rw-r--r--src/lib/netlist/nl_lists.h1
-rw-r--r--src/lib/netlist/plib/pconfig.h24
-rw-r--r--src/lib/netlist/plib/pfmtlog.h22
-rw-r--r--src/lib/netlist/plib/ptypes.h31
-rw-r--r--src/lib/netlist/plib/putil.cpp4
5 files changed, 37 insertions, 45 deletions
diff --git a/src/lib/netlist/nl_lists.h b/src/lib/netlist/nl_lists.h
index 728bba6f440..f643af2020e 100644
--- a/src/lib/netlist/nl_lists.h
+++ b/src/lib/netlist/nl_lists.h
@@ -17,6 +17,7 @@
#include "nl_config.h"
#include "plib/plists.h"
#include "plib/pchrono.h"
+#include "plib/ptypes.h"
// ----------------------------------------------------------------------------------------
// timed queue
diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h
index 71b4b4d955b..105463fe489 100644
--- a/src/lib/netlist/plib/pconfig.h
+++ b/src/lib/netlist/plib/pconfig.h
@@ -51,30 +51,6 @@ typedef __int128_t INT128;
// Standard defines
//============================================================
-// prevent implicit copying
-#if 0
-#define P_PREVENT_COPYING(name) \
- private: \
- name(const name &); \
- name(const name &&); \
- name &operator=(const name &);
-#else
-
-namespace plib
-{
- struct nocopyassignmove
- {
- protected:
- nocopyassignmove() = default;
- ~nocopyassignmove() = default;
- private:
- nocopyassignmove(const nocopyassignmove &) = delete;
- nocopyassignmove(nocopyassignmove &&) = delete;
- nocopyassignmove &operator=(const nocopyassignmove &) = delete;
- };
-}
-#endif
-
//============================================================
// Pointer to Member Function
//============================================================
diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h
index 8ee3c75c5f8..1a212e601b8 100644
--- a/src/lib/netlist/plib/pfmtlog.h
+++ b/src/lib/netlist/plib/pfmtlog.h
@@ -14,6 +14,14 @@
namespace plib {
+P_ENUM(plog_level,
+ DEBUG,
+ INFO,
+ VERBOSE,
+ WARNING,
+ ERROR,
+ FATAL)
+
template <typename T>
struct ptype_traits_base
{
@@ -175,14 +183,6 @@ private:
unsigned m_arg;
};
-P_ENUM(plog_level,
- DEBUG,
- INFO,
- VERBOSE,
- WARNING,
- ERROR,
- FATAL)
-
class plog_dispatch_intf;
template <bool build_enabled = true>
@@ -242,7 +242,7 @@ private:
};
-template <plog_level::e L, bool build_enabled = true>
+template <plog_level::E L, bool build_enabled = true>
class plog_channel : public pfmt_writer_t<build_enabled>
{
public:
@@ -258,7 +258,7 @@ private:
class plog_dispatch_intf
{
- template<plog_level::e, bool> friend class plog_channel;
+ template<plog_level::E, bool> friend class plog_channel;
public:
virtual ~plog_dispatch_intf();
@@ -290,7 +290,7 @@ public:
};
-template <plog_level::e L, bool build_enabled>
+template <plog_level::E L, bool build_enabled>
void plog_channel<L, build_enabled>::vdowrite(const pstring &ls) const
{
m_base->vlog(L, ls);
diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h
index 6aabed738e9..182333875d0 100644
--- a/src/lib/netlist/plib/ptypes.h
+++ b/src/lib/netlist/plib/ptypes.h
@@ -40,10 +40,25 @@ namespace plib
#endif
//============================================================
+ // prevent implicit copying
+ //============================================================
+
+ struct nocopyassignmove
+ {
+ protected:
+ nocopyassignmove() = default;
+ ~nocopyassignmove() = default;
+ private:
+ nocopyassignmove(const nocopyassignmove &) = delete;
+ nocopyassignmove(nocopyassignmove &&) = delete;
+ nocopyassignmove &operator=(const nocopyassignmove &) = delete;
+ };
+
+ //============================================================
// penum - strongly typed enumeration
//============================================================
- struct enum_base
+ struct penum_base
{
protected:
static int from_string_int(const char *str, const char *x);
@@ -53,22 +68,22 @@ namespace plib
}
#define P_ENUM(ename, ...) \
- struct ename : public plib::enum_base { \
- enum e { __VA_ARGS__ }; \
- ename (e v) : m_v(v) { } \
+ struct ename : public plib::penum_base { \
+ enum E { __VA_ARGS__ }; \
+ ename (E v) : m_v(v) { } \
bool set_from_string (const pstring &s) { \
static const char *strings = # __VA_ARGS__; \
int f = from_string_int(strings, s.c_str()); \
- if (f>=0) { m_v = static_cast<e>(f); return true; } else { return false; } \
+ if (f>=0) { m_v = static_cast<E>(f); return true; } else { return false; } \
} \
- operator e() const {return m_v;} \
+ operator E() const {return m_v;} \
bool operator==(const ename &rhs) const {return m_v == rhs.m_v;} \
- bool operator==(const e &rhs) const {return m_v == rhs;} \
+ bool operator==(const E &rhs) const {return m_v == rhs;} \
const pstring name() const { \
static const char *strings = # __VA_ARGS__; \
return nthstr(static_cast<int>(m_v), strings); \
} \
- private: e m_v; };
+ private: E m_v; };
#endif /* PTYPES_H_ */
diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp
index 87ac06b3f75..6a24e8c4012 100644
--- a/src/lib/netlist/plib/putil.cpp
+++ b/src/lib/netlist/plib/putil.cpp
@@ -104,7 +104,7 @@ namespace plib
}
- int enum_base::from_string_int(const char *str, const char *x)
+ int penum_base::from_string_int(const char *str, const char *x)
{
int cnt = 0;
const char *cur = str;
@@ -131,7 +131,7 @@ namespace plib
return cnt;
return -1;
}
- pstring enum_base::nthstr(int n, const char *str)
+ pstring penum_base::nthstr(int n, const char *str)
{
char buf[64];
char *bufp = buf;
- vsystem/crshrace.cpp, vsystem/f1gp.cpp, vsystem/taotaido.cpp: consolidated ... Ivan Vangelista2023-02-018-24/+24 * mame/b*-e*: put drivers in anonymous namespaces where applicable, updated #if... Ivan Vangelista2023-01-1813-12/+56 * New working clones Ivan Vangelista2023-01-101-10/+10 * capcom/cps1.cpp: Added proper B board GAL fusemap to run ffightae hack on har... Vas Crabb2022-12-211-1/+1 * capcom/cps1.cpp: Added 3-player Final Fight hack. Vas Crabb2022-12-212-0/+91 * gunsmoke: make game string build date more readable hap2022-12-191-8/+8 * capcom/gunsmoke.cpp: Dumped and added a new North American Gun.Smoke set. (#1... ClawGrip2022-12-201-10/+59 * capcom/cps1.cpp: Added SFZ63B mapper. (#10673) Tom2022-12-122-12/+44 * hkittymp: add steering wheel [dink] hap2022-12-032-3/+23 * More ROM labels updates [Brian Troha] Ivan Vangelista2022-11-261-4/+4 * capcom/sonson: Change vsync to 55.40Hz (#10537) birdybro2022-11-231-1/+1 * New machines marked as NOT_WORKING Ivan Vangelista2022-11-222-2/+49 * New working clones