Commit Graph
394 Commits
Author SHA1 Message Date
Andrew Johnson 2c5854a7ec Add a max string len param to deserializeString()
Defaults to INT32_MAX if not provided, but several places in
pvAccess can set limits, e.g. MAX_CHANNEL_NAME_LENGTH, and
this is the best way to harden them against huge values.

Document that SerializeHelper::readSize() returns -1 for NULL.
2026-08-09 18:26:52 -07:00
Andrew Johnson 5012ff95b2 Harden array allocation in BitSet::deserialize()
Move bounds check to before the allocation.
Treat NULL bitset values as empty to avoid overflow.

Add tests for excessive allocation, and Null values.
2026-08-09 17:49:39 -07:00
Michael Davidsaver abc95982ed bound deserialize() recursion 2026-08-09 17:31:03 -07:00
Michael Davidsaver 777c921535 Check for match of complex element types
eg. Array of Structure must have Structure elements.
2026-08-09 17:31:03 -07:00
Michael Davidsaver 13b56e704c doc: add leading * for @code listings 2026-06-03 14:42:30 -07:00
Michael Davidsaver 9ec9a526f5 revise Timer phase reset 2025-12-05 17:01:00 -08:00
Chris Johns b4114589ff Skip any missed timer events updating the timer to now
This stops a timer calling the callback for every missed event if the
time jumps forward when corrected or moved.
2025-12-05 17:01:00 -08:00
Andrew Johnson 0c1773f25d Clang warnings: sprintf() => epicsSnprintf() 2025-12-01 18:20:27 -08:00
JJL772 bf36070860 Allow Timer to be cancelled during callback execution
Useful for when e.g. a periodic timer needs to cancel itself
2025-11-19 08:49:41 -08:00
thomasms 3da69257a0 Remove duplicate doxygen comment - see issue #75 2023-11-01 09:39:33 -05:00
Michael Davidsaver 5387face45 rename print.cpp -> jprint.cpp
In GHA builder somehow print.cpp becomes PRINT.obj
instead of print.obj for mkmf.pl, which later fails
when print.obj is missing.  (apparently windows
filesystems are now case sensitive...)
2023-10-22 16:24:15 -07:00
JJL772 eac2a8e70f Fix use-after-destroy in epicsRefSnapshopCurrent 2023-08-06 21:30:32 -07:00
JJL772 04fcb7e38f Don't return local copy of std::string in AnyScalar::bufferUnsafe 2023-08-06 21:30:32 -07:00
Andrew Johnson 45018a2163 Generate JSON5 when available
Fixes lp: #2029482 / GitHub #92
2023-08-06 21:28:01 -07:00
Simon Rose b7ad4478a4 Update debugPtr to work with EPICS base 7.0.7
There are at least two changes to EPICS base since the addition of
debugPtr:
* In pvAccess/**/dbdToPv.cpp, a write to an ostream was added (also in
  pvData/**/testSerialization.cpp) which does not resolve correctly when
  the operator<< overload is in the global namespace.
* In pvAccess/**/caChannel.cpp, weak_ptr->expired() was added

The interface to deal with each of these has been added.
2023-05-29 17:09:29 -07:00
Michael Davidsaver c16f19c80e Flip #if logic for unaligned access
Assume only x86 can correctly/efficiently handle unaligned access.
2023-05-24 21:49:38 -07:00
Michael Davidsaver 87018882d1 ARM/Linux can fault on unaligned access
Sometimes SIGBUS results from unaligned access.
2023-05-24 20:44:32 -07:00
zimoch 2547514abb fix for use-after-free warning 2023-02-28 09:04:58 -08:00
Michael Davidsaver 0b424a71ec isprint() wants value in range [-1, 255]
The MSVC impl. assert()s this
2022-11-26 10:52:03 -08:00
Andrew Johnson 016d1154fc Set module version number for release 2022-09-07 10:17:07 -05:00
Michael Davidsaver 93e90c5a04 fix 3.16 2022-01-27 09:27:19 -08:00
Michael Davidsaver a647c8b174 printJSON() use yajl_gen 2022-01-19 10:27:09 -08:00
Michael Davidsaver 07b79693af Deprecate/remove unused buffer alignment tools
ByteBuffer::align() does not work as expected
on some RTEMS targets where malloc() returns
buffers aligned only to 4 bytes.

SerializableControl::alignBuffer() and
DeserializableControl::alignData() are implemented,
but never called, in this module and pvAccessCPP.
ByteBuffer::align() is only needed to implement
these two methods.

Leave non-pure virtual stubs to assist in migration.
2020-11-14 11:07:15 -08:00
Michael Davidsaver 320cc3c60b shared_vector_convert<>() fix convert of empty array
Empty arrays can be untyped, but this doesn't matter.
2020-09-29 15:52:49 -07:00
Michael Davidsaver 2e775ef2fb drop THROW_BASE_EXCEPTION_CAUSE() 2020-06-17 14:08:14 -07:00
Michael Davidsaver f17d2bbca1 add maybeQuote()
Something for the *NIX gurus
to light their pipes with.
2020-06-17 14:08:14 -07:00
Michael Davidsaver 19245ce805 sharedVector extend base_ptr() to VS2013 2020-06-03 10:14:38 -07:00
zimoch 1038182a16 removed empty lines at end of file 2020-04-15 07:53:22 -07:00
zimoch 60091bfe56 removed spaces at end of line 2020-04-15 07:53:22 -07:00
zimoch f4de6dd9b1 replaced tabs with spaces 2020-04-15 07:53:22 -07:00
Michael Davidsaver e9dde4d2f8 update doc 2019-12-13 09:32:42 -08:00
Michael Davidsaver df89135455 cleanup 2019-10-11 16:17:49 -07:00
Michael Davidsaver 95d452870c move dedup to most derived
Making virtual calls from a base class dtor is not safe.
2019-10-11 16:17:25 -07:00
Michael Davidsaver 8a82ff9fe4 Revert "dynamic_cast may not be defined during dtor"
This reverts commit dd24b2ad75.
2019-10-11 08:41:30 -07:00
Michael Davidsaver dd24b2ad75 dynamic_cast may not be defined during dtor 2019-09-30 18:24:13 -07:00
Michael Davidsaver d01ba94ed7 avoid extraneous copy 2019-09-23 10:14:55 -07:00
Michael Davidsaver 0ad253c6f0 Remove Base 3.14 compatibility 2019-09-23 10:14:55 -07:00
Michael Davidsaver 416d910577 Timer: further attempt to avoid state corruption 2019-07-31 20:13:33 -07:00
Michael Davidsaver 37b7a0708f Timer more alive checks 2019-07-31 19:01:20 -07:00
Michael Davidsaver 0447826e7c minor 2019-07-14 19:09:54 -07:00
Michael Davidsaver 3ef60a61a2 always epicsThreadStackBig
On RTEMS at least, c++ code needs the largest
standard stack frame size.
2019-07-08 09:07:09 -07:00
Daniel Damiani 31802a8bde Added additional explicit template instantiations to fix build problems on macos with c+11 2019-07-04 07:09:58 -07:00
Bruno Martins 4dd7a18301 Improve docs. Make getFieldT(offset) use vector::at. 2019-05-20 16:35:59 -07:00
Bruno Martins a29894ee2b getField<T>() fail to compile when T isn't Field or a sub-class 2019-05-20 16:35:59 -07:00
Bruno Martins b050fbbcbe Revert {Structure,Union}::getField to previous behavior 2019-05-20 16:35:59 -07:00
Bruno Martins caa11605fc Add {Structure,Union}::getFieldT, fix {Structure,Union}::getField 2019-05-20 16:35:59 -07:00
Michael Davidsaver cfcdd1a3f9 deprecate ByteBuffer::getArray()
in favor of identical ByteBuffer::getBuffer()
2019-05-18 18:21:06 -07:00
Michael Davidsaver 4cc9b650c5 getSubField<T>() fail to compile when T isn't PVField or a sub-class 2019-05-16 10:17:56 -07:00
Michael Davidsaver cd2436342d Revert "Replace display.format with .form and .precision"
This reverts commit 4ffddfa2f6.
2019-05-06 10:40:54 -07:00
Michael Davidsaver 35b3403de6 remove deprecated pvCopy 2019-05-01 14:18:48 -07:00