Fixed bug when putting int64_t
CI / build-and-test (push) Successful in 11s

This commit is contained in:
2026-05-18 08:30:35 +02:00
parent 464f1758dc
commit 4323ce04e4
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -574,7 +574,8 @@ int mEpicsCa<T>::put(V *value) {
// it as a double. This means we have some loss of precision for large
// integers, but it is the best we can do ...
if (ca_field_type(_pChanID) == DBF_DOUBLE) {
return putRaw<S>(static_cast<double>(*value));
double dval = static_cast<double>(*value);
return putRaw<S>(&dval);
} else {
return putRaw<S>(value);
}
+8
View File
@@ -298,6 +298,14 @@ int main() {
EQUAL(status, CM_SUCCESS);
EQUAL(int_val, new_int_val);
// Write an int64 to a record and read it to check
int64_t new_int64_val = 1111;
status = int64_ca.put(&new_int64_val);
EQUAL(status, CM_SUCCESS);
status = int64_ca.get(&int64_val);
EQUAL(status, CM_SUCCESS);
EQUAL(int64_val, new_int64_val);
// Write to the limit field of the longin record
new_int_val = 40;
status = int_hopr_ca.put(&new_int_val);