diff --git a/.ci b/.ci index 93062ba..899b183 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 93062ba941879f5eeaef40308b406c9d5dbf51c5 +Subproject commit 899b18336b4ce3bd9328fd30c33621224c78a4d7 diff --git a/documentation/release_notes.dox b/documentation/release_notes.dox index 27bc1aa..6e2927f 100644 --- a/documentation/release_notes.dox +++ b/documentation/release_notes.dox @@ -5,6 +5,8 @@ Release 8.0.6 (UNRELEASED) ======================== +- Compatible changes + - Actually enable JSON-5 output in PVStructure::Formatter::JSON when available. Release 8.0.5 (Sep 2022) ======================== diff --git a/src/factory/Convert.cpp b/src/factory/Convert.cpp index f8ec4a1..af39b21 100644 --- a/src/factory/Convert.cpp +++ b/src/factory/Convert.cpp @@ -27,7 +27,7 @@ using std::string; namespace epics { namespace pvData { -static std::vector split(string commaSeparatedList) { +static std::vector split(const string& commaSeparatedList) { string::size_type numValues = 1; string::size_type index=0; while(true) { diff --git a/src/factory/printer.cpp b/src/factory/printer.cpp index 55fb01c..846f2de 100644 --- a/src/factory/printer.cpp +++ b/src/factory/printer.cpp @@ -404,6 +404,9 @@ std::ostream& operator<<(std::ostream& strm, const PVStructure::Formatter& forma if(format.xfmt==PVStructure::Formatter::JSON) { JSONPrintOptions opts; opts.multiLine = false; +#if EPICS_VERSION_INT>=VERSION_INT(7,0,6,1) + opts.json5 = true; +#endif printJSON(strm, format.xtop, format.xshow ? *format.xshow : BitSet().set(0), opts); strm<<'\n'; return strm; diff --git a/src/json/Makefile b/src/json/Makefile index 0baca83..1988c17 100644 --- a/src/json/Makefile +++ b/src/json/Makefile @@ -7,4 +7,4 @@ INC += pv/json.h LIBSRCS += parsehelper.cpp LIBSRCS += parseany.cpp LIBSRCS += parseinto.cpp -LIBSRCS += print.cpp +LIBSRCS += jprint.cpp diff --git a/src/json/print.cpp b/src/json/jprint.cpp similarity index 100% rename from src/json/print.cpp rename to src/json/jprint.cpp diff --git a/src/misc/anyscalar.cpp b/src/misc/anyscalar.cpp index 7072922..c140a97 100644 --- a/src/misc/anyscalar.cpp +++ b/src/misc/anyscalar.cpp @@ -31,7 +31,7 @@ AnyScalar::AnyScalar(const AnyScalar& o) } #if __cplusplus>=201103L -AnyScalar::AnyScalar(AnyScalar&& o) +AnyScalar::AnyScalar(AnyScalar&& o) noexcept :_stype(o._stype) { typedef std::string string; @@ -136,7 +136,7 @@ void AnyScalar::swap(AnyScalar& o) { } const void* AnyScalar::bufferUnsafe() const { if(_stype==pvString) { - return as().c_str(); + return ref().c_str(); } else { return _wrap.blob; } diff --git a/src/misc/debugPtr.cpp b/src/misc/debugPtr.cpp index 62146e0..3cd3210 100644 --- a/src/misc/debugPtr.cpp +++ b/src/misc/debugPtr.cpp @@ -35,7 +35,7 @@ void shared_ptr_base::track_new() } // create new tracker if ptr!=nullptr, otherwise clear -void shared_ptr_base::track_new(void* ptr) +void shared_ptr_base::track_new(const void* ptr) { track_clear(); if(ptr){ diff --git a/src/misc/pv/anyscalar.h b/src/misc/pv/anyscalar.h index 2efccae..fdf44b0 100644 --- a/src/misc/pv/anyscalar.h +++ b/src/misc/pv/anyscalar.h @@ -123,7 +123,7 @@ public: AnyScalar(const AnyScalar& o); #if __cplusplus>=201103L - AnyScalar(AnyScalar&& o); + AnyScalar(AnyScalar&& o) noexcept; #endif inline ~AnyScalar() {clear();} @@ -140,7 +140,7 @@ public: } #if __cplusplus>=201103L - inline AnyScalar& operator=(AnyScalar&& o) { + inline AnyScalar& operator=(AnyScalar&& o) noexcept { clear(); swap(o); return *this; diff --git a/src/misc/pv/byteBuffer.h b/src/misc/pv/byteBuffer.h index e507f15..321f35d 100644 --- a/src/misc/pv/byteBuffer.h +++ b/src/misc/pv/byteBuffer.h @@ -150,14 +150,17 @@ struct swap<8> { #undef _PVA_swap64 /* PVD serialization doesn't pay attention to alignement, - * which some targets really care about and treat unaligned + * which some targets (ARM and powerpc) really care about and treat unaligned * access as a fault, or with a heavy penalty (~= to a syscall). * * For those targets,, we will have to live with the increase * in execution time and/or object code size of byte-wise copy. + * + * Treat x86 32/64 as an outlier, and assume all other targets + * need, or greatly benefit, from aligned access. */ -#ifdef _ARCH_PPC +#if !(defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)) template union alignu { diff --git a/src/misc/pv/debugPtr.h b/src/misc/pv/debugPtr.h index 479eafc..3ce0771 100644 --- a/src/misc/pv/debugPtr.h +++ b/src/misc/pv/debugPtr.h @@ -78,7 +78,7 @@ protected: // add ourselves to tracker void track_new(); // create new tracker if ptr!=nullptr, otherwise clear - void track_new(void* ptr); + void track_new(const void* ptr); // copy tracker and add ourself void track_assign(const shared_ptr_base& o); void track_clear(); @@ -286,6 +286,7 @@ public: long use_count() const noexcept { return real.use_count(); } bool unique() const noexcept { return real.unique(); } + bool expired() const noexcept { return real.expired(); } }; template @@ -316,13 +317,12 @@ do_enable_shared_from_this(const shared_ptr& dest, self->xxInternalSelf = actual; } -}} // namespace epics::debug - template -inline std::ostream& operator<<(std::ostream& strm, const epics::debug::shared_ptr& ptr) +inline std::ostream& operator<<(std::ostream& strm, const shared_ptr& ptr) { strm<getSubField("value"); *pvValue <<= testDV; - double dv; + double dv = 0.; *pvValue >>= dv; testOk1(testDV == dv);