Conversation
killenb
left a comment
There was a problem hiding this comment.
maybe we should make a static assert for the moment that the FixedPointConverter is only instantiated with int32_t?
Apart from that I think we are ready to merge to the master. I would do a full final review af the remaining issues are fixed (only did the delta of the comments and the commit, and lost the overview)
a6c8cbf to
c566c84
Compare
| return numericToUserType<UserType>(f * *(std::bit_cast<uint32_t*>(&rawValue))); | ||
| } | ||
| else if constexpr(sizeof(RawType) == 8) { | ||
| return numericToUserType<UserType>(f * *(std::bit_cast<uint64_t*>(&rawValue))); |
There was a problem hiding this comment.
These will start giving trouble if we have 64 bit values with more than 48 significant bits and negative fractional bits > -(64-nSignificant). I guess it's not a realistic scenario, but you would want 64 bit integer user type, which can hold the full resolution, but it is converted through double, which can only hold 48 significant bits.\
| #define SIGNED_HEX_TO_DOUBLE(INPUT) static_cast<double>(static_cast<int32_t>(INPUT)) | ||
| #define SIGNED_HEX_TO_INT64(INPUT) static_cast<int64_t>(static_cast<int32_t>(INPUT)) | ||
|
|
||
| #define SIGNED_HEX16_TO_DOUBLE(INPUT) static_cast<double>(static_cast<int16_t>(INPUT)) |
There was a problem hiding this comment.
What about SIGNED_HEX64_TOxxx ?
5932365 to
846c302
Compare
…he same fractional bit as size of the converter
846c302 to
ba74da6
Compare
This is not allowed according to the TransferElement specification. Seems to be unused anyway.
When the provided initial values were not yet consistent, but a data update coming in turned them into a consistent set, the data made available to the user was corrupt, due to unnecessary buffer switch happening
e193493 to
197b95a
Compare
No description provided.