From 4966baf423a2800347e55630841df19170c01d15 Mon Sep 17 00:00:00 2001 From: DW Date: Sun, 19 May 2024 18:57:41 +0200 Subject: [PATCH] fix sizv for printf & fix doc --- modules/database/src/std/rec/lsiRecord.dbd.pod | 4 ++-- modules/database/src/std/rec/lsoRecord.dbd.pod | 2 +- modules/database/src/std/rec/printfRecord.c | 3 +++ modules/database/src/std/rec/printfRecord.dbd.pod | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/database/src/std/rec/lsiRecord.dbd.pod b/modules/database/src/std/rec/lsiRecord.dbd.pod index 619a1df1af..d5016672d8 100644 --- a/modules/database/src/std/rec/lsiRecord.dbd.pod +++ b/modules/database/src/std/rec/lsiRecord.dbd.pod @@ -9,7 +9,7 @@ =title Long String Input Record (lsi) The long string input record is used to retrieve an arbitrary ASCII string with -a maximum length of 65535 characters. +a maximum length of 32767 characters. This record type was included in base.dbd beginning with epics-base 3.15.0.2 . @@ -36,7 +36,7 @@ from. It can be a database or channel access link, or a constant. If constant, the VAL field is initialized with the constant and can be changed via dbPuts. Otherwise, the string is read from the specified location each time the record is processed and placed in the VAL field. The maximum number of characters in -VAL is given by SIZV, and cannot be larger than 65535. In addition, the +VAL is given by SIZV, and cannot be larger than 32767. In addition, the appropriate device support module must be entered into the DTYP field. =fields VAL, OVAL, SIZV, INP, DTYP diff --git a/modules/database/src/std/rec/lsoRecord.dbd.pod b/modules/database/src/std/rec/lsoRecord.dbd.pod index edfc9c4fcd..6e2c013ac1 100644 --- a/modules/database/src/std/rec/lsoRecord.dbd.pod +++ b/modules/database/src/std/rec/lsoRecord.dbd.pod @@ -9,7 +9,7 @@ =title Long String Output Record (lso) The long string output record is used to write an arbitrary ASCII string with a -maximum length of 65535 characters. +maximum length of 32767 characters. This record type was included in base.dbd beginning with epics-base 3.15.0.2 . diff --git a/modules/database/src/std/rec/printfRecord.c b/modules/database/src/std/rec/printfRecord.c index 0552ff7bb3..72589b2e31 100644 --- a/modules/database/src/std/rec/printfRecord.c +++ b/modules/database/src/std/rec/printfRecord.c @@ -337,6 +337,9 @@ static long init_record(struct dbCommon *pcommon, int pass) if (sizv < 16) { sizv = 16; /* Enforce a minimum size for the VAL field */ prec->sizv = sizv; + } else if (sizv > 0x7fff) { + sizv = 0x7fff; /* SIZV is unsigned, but dbAddr::field_size is signed */ + prec->sizv = sizv; } prec->val = callocMustSucceed(1, sizv, "printf::init_record"); diff --git a/modules/database/src/std/rec/printfRecord.dbd.pod b/modules/database/src/std/rec/printfRecord.dbd.pod index b649158ee7..a3bef96107 100644 --- a/modules/database/src/std/rec/printfRecord.dbd.pod +++ b/modules/database/src/std/rec/printfRecord.dbd.pod @@ -152,7 +152,7 @@ Specification|https://docs.epics-controls.org/en/latest/guides/EPICS_Process_Dat for information on specifying links. The formatted string is written to the VAL field. The maximum number of -characters in VAL is given by SIZV, and cannot be larger than 65535. The LEN +characters in VAL is given by SIZV, and cannot be larger than 32767. The LEN field contains the length of the formatted string in the VAL field. =fields FMT, INP0, INP1, INP2, INP3, INP4, INP5, INP6, INP7, INP8, INP9, VAL, SIZV, LEN