diff options
author | 2019-01-11 21:50:43 +0100 | |
---|---|---|
committer | 2019-01-11 21:50:43 +0100 | |
commit | f12f735f54966b992d23d0502027e8e6d9e1dd95 (patch) | |
tree | 7f47ac7064a18b24fd1d7ecc5ff5fa0e1cbf47f4 /src/lib/netlist/plib | |
parent | a14dc4158fc1b1dd9fd1e45c6649ef048775625a (diff) |
Fix clang-8 warnings. (nw)
Diffstat (limited to 'src/lib/netlist/plib')
-rw-r--r-- | src/lib/netlist/plib/palloc.h | 2 | ||||
-rw-r--r-- | src/lib/netlist/plib/pexception.h | 2 | ||||
-rw-r--r-- | src/lib/netlist/plib/pfmtlog.cpp | 2 | ||||
-rw-r--r-- | src/lib/netlist/plib/pfunction.cpp | 4 | ||||
-rw-r--r-- | src/lib/netlist/plib/pomp.h | 10 | ||||
-rw-r--r-- | src/lib/netlist/plib/pstring.h | 4 | ||||
-rw-r--r-- | src/lib/netlist/plib/putil.h | 3 |
7 files changed, 16 insertions, 11 deletions
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index 264cc656bbf..de992b7bc50 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -52,7 +52,7 @@ std::unique_ptr<T> make_unique(Args&&... args) } template<typename BC, typename DC, typename... Args> -static std::unique_ptr<BC> make_unique_base(Args&&... args) +std::unique_ptr<BC> make_unique_base(Args&&... args) { std::unique_ptr<BC> ret(new DC(std::forward<Args>(args)...)); return ret; diff --git a/src/lib/netlist/plib/pexception.h b/src/lib/netlist/plib/pexception.h index 4827081b754..1a5957099fd 100644 --- a/src/lib/netlist/plib/pexception.h +++ b/src/lib/netlist/plib/pexception.h @@ -23,7 +23,7 @@ public: explicit pexception(const pstring &text); pexception(const pexception &e) : std::exception(e), m_text(e.m_text) { } - virtual ~pexception() noexcept; + virtual ~pexception() noexcept override; const pstring &text() { return m_text; } const char* what() const noexcept override { return m_text.c_str(); } diff --git a/src/lib/netlist/plib/pfmtlog.cpp b/src/lib/netlist/plib/pfmtlog.cpp index 381c19bc349..2c120f6b7a4 100644 --- a/src/lib/netlist/plib/pfmtlog.cpp +++ b/src/lib/netlist/plib/pfmtlog.cpp @@ -69,7 +69,7 @@ pfmt &pfmt::format_element(const char *l, const unsigned cfmt_spec, ...) if (pstring("duxo").find(cfmt_spec) != pstring::npos) { if (pstring("duxo").find(pend) == pstring::npos) - fmt += (pstring(l) + (char) cfmt_spec); + fmt += (pstring(l) + static_cast<pstring::value_type>(cfmt_spec)); else fmt = plib::left(fmt, fmt.size() - 1) + pstring(l) + plib::right(fmt, 1); } diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index f2ef3522813..f08fa2c60ea 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -199,8 +199,8 @@ double pfunction::evaluate(const std::vector<double> &values) OP(SUB, 1, ST2 - ST1) OP(DIV, 1, ST2 / ST1) OP(POW, 1, std::pow(ST2, ST1)) - OP(SIN, 0, std::sin(ST2)); - OP(COS, 0, std::cos(ST2)); + OP(SIN, 0, std::sin(ST2)) + OP(COS, 0, std::cos(ST2)) case RAND: stack[ptr++] = lfsr_random(); break; diff --git a/src/lib/netlist/plib/pomp.h b/src/lib/netlist/plib/pomp.h index 6559207f09d..221c0d61c00 100644 --- a/src/lib/netlist/plib/pomp.h +++ b/src/lib/netlist/plib/pomp.h @@ -18,8 +18,8 @@ namespace plib { namespace omp { -template <class T> -void for_static(const int start, const int end, const T &what) +template <typename I, class T> +void for_static(const I start, const I end, const T &what) { #if HAS_OPENMP && USE_OPENMP #pragma omp parallel @@ -28,19 +28,19 @@ void for_static(const int start, const int end, const T &what) #if HAS_OPENMP && USE_OPENMP #pragma omp for schedule(static) #endif - for (int i = start; i < end; i++) + for (I i = start; i < end; i++) what(i); } } -inline void set_num_threads(const int threads) +inline void set_num_threads(const std::size_t threads) { #if HAS_OPENMP && USE_OPENMP omp_set_num_threads(threads); #endif } -inline int get_max_threads() +inline std::size_t get_max_threads() { #if HAS_OPENMP && USE_OPENMP return omp_get_max_threads(); diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index 677ce9e43b8..ebdca57c9a5 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -561,7 +561,9 @@ namespace plib decltype(arg.c_str()) cstr = arg.c_str(); std::size_t idx(0); auto ret = pstonum_helper<T>()(cstr, &idx); - if (ret >= std::numeric_limits<T>::lowest() && ret <= std::numeric_limits<T>::max()) + typedef decltype(ret) ret_type; + if (ret >= static_cast<ret_type>(std::numeric_limits<T>::lowest()) + && ret <= static_cast<ret_type>(std::numeric_limits<T>::max())) //&& (ret == T(0) || std::abs(ret) >= std::numeric_limits<T>::min() )) { if (cstr[idx] != 0) diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h index 914d9820560..05cc44f5f68 100644 --- a/src/lib/netlist/plib/putil.h +++ b/src/lib/netlist/plib/putil.h @@ -74,6 +74,9 @@ namespace plib std::vector<pstring> psplit(const pstring &str, const pstring &onstr, bool ignore_empty = false); std::vector<pstring> psplit(const pstring &str, const std::vector<pstring> &onstrl); + std::vector<std::string> psplit_r(const std::string &stri, + const std::string &token, + const std::size_t maxsplit); } |