From 66ce1c2076f6e0af8aee3e1e6714f2dbbc1492ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Thu, 2 May 2024 15:29:22 -0300 Subject: [PATCH 01/46] Fix calcout doc typo. --- modules/database/src/std/rec/calcoutRecord.dbd.pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/std/rec/calcoutRecord.dbd.pod b/modules/database/src/std/rec/calcoutRecord.dbd.pod index 490aec9c9..96cccd031 100644 --- a/modules/database/src/std/rec/calcoutRecord.dbd.pod +++ b/modules/database/src/std/rec/calcoutRecord.dbd.pod @@ -1160,7 +1160,7 @@ See next section. =head2 C -This is called id CALC or OCAL is changed. C calls postfix. +This is called if CALC or OCAL is changed. C calls postfix. =head2 C From 4bb50fe66468111a6c7ff4c086bdc56f2937bd1e Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Thu, 14 Mar 2024 16:25:33 +0100 Subject: [PATCH 02/46] Memory leak in caservertask.c --- modules/database/src/ioc/rsrv/caservertask.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/database/src/ioc/rsrv/caservertask.c b/modules/database/src/ioc/rsrv/caservertask.c index 8e347deb8..e1e10dd03 100644 --- a/modules/database/src/ioc/rsrv/caservertask.c +++ b/modules/database/src/ioc/rsrv/caservertask.c @@ -748,6 +748,7 @@ void rsrv_init (void) if(!havesometcp) cantProceed("CAS: No TCP server started\n"); } + free(socks); /* servers list is considered read-only from this point */ From 839f764bcb37a628b22ee988460fb4e8f04de27c Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Fri, 22 Mar 2024 16:30:21 +0100 Subject: [PATCH 03/46] Clean up some potential memory leaks The watchdog tasks are allocated, but not consistently removed. In general this doesn't matter: they run in threads that will only end when the process actually quits. For consistency and for the purpose of future-proofing, I think there is value in having the cleanup added in each case. --- modules/database/src/ioc/as/asCa.c | 5 +++++ modules/database/src/ioc/rsrv/caservertask.c | 5 +++++ modules/database/src/ioc/rsrv/online_notify.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/modules/database/src/ioc/as/asCa.c b/modules/database/src/ioc/as/asCa.c index a250a0f7a..a62d86769 100644 --- a/modules/database/src/ioc/as/asCa.c +++ b/modules/database/src/ioc/as/asCa.c @@ -225,6 +225,11 @@ static void asCaTask(void) if(asCaDebug) printf("asCaTask has cleared all channels\n"); epicsEventSignal(asCaTaskWait); } + + /* ATM never reached, just a placeholder */ + cantProceed("Unreachable. Perpetual thread."); + + taskwdRemove(0); } void asCaStart(void) diff --git a/modules/database/src/ioc/rsrv/caservertask.c b/modules/database/src/ioc/rsrv/caservertask.c index e1e10dd03..7e3ad7673 100644 --- a/modules/database/src/ioc/rsrv/caservertask.c +++ b/modules/database/src/ioc/rsrv/caservertask.c @@ -120,6 +120,11 @@ static void req_server (void *pParm) } } } + + /* ATM never reached, just a placeholder */ + cantProceed("Unreachable. Perpetual thread."); + + taskwdRemove(0); } static diff --git a/modules/database/src/ioc/rsrv/online_notify.c b/modules/database/src/ioc/rsrv/online_notify.c index e192e7461..29e7d8acc 100644 --- a/modules/database/src/ioc/rsrv/online_notify.c +++ b/modules/database/src/ioc/rsrv/online_notify.c @@ -129,7 +129,11 @@ void rsrv_online_notify_task(void *pParm) } } + /* ATM never reached, just a placeholder */ + cantProceed("Unreachable. Perpetual thread."); + free(lastError); + taskwdRemove(0); } From b3f92d81db4b48059bf47f4cf2b04699ffe4b340 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Wed, 15 May 2024 16:57:34 +0200 Subject: [PATCH 04/46] ci: add workaround for GHA node20@centos7 failures --- .github/workflows/ci-scripts-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 65384d23b..af7b4b1dd 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -199,6 +199,10 @@ jobs: submodules: true - name: Automatic core dumper analysis uses: mdavidsaver/ci-core-dumper@master + if: matrix.image!='centos:7' + - name: Automatic core dumper analysis + uses: mdavidsaver/ci-core-dumper@node16 + if: matrix.image=='centos:7' - name: "apt-get install" run: | sudo apt-get update From 92615a77fe4e0a390c26d735ef1e8acc7785d418 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Wed, 15 May 2024 18:04:58 +0200 Subject: [PATCH 05/46] ci: fix last commit (GHA workaround) --- .github/workflows/ci-scripts-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index af7b4b1dd..4d85d120b 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -199,10 +199,6 @@ jobs: submodules: true - name: Automatic core dumper analysis uses: mdavidsaver/ci-core-dumper@master - if: matrix.image!='centos:7' - - name: Automatic core dumper analysis - uses: mdavidsaver/ci-core-dumper@node16 - if: matrix.image=='centos:7' - name: "apt-get install" run: | sudo apt-get update @@ -288,6 +284,10 @@ jobs: submodules: true - name: Automatic core dumper analysis uses: mdavidsaver/ci-core-dumper@master + if: matrix.image!='centos:7' + - name: Automatic core dumper analysis + uses: mdavidsaver/ci-core-dumper@node16 + if: matrix.image=='centos:7' - name: Prepare and compile dependencies run: python .ci/cue.py prepare - name: Build main module From d8b5616772df78c50e94fb642c4903d757232e38 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 16 May 2024 10:07:12 +0200 Subject: [PATCH 06/46] ci: bump checkout to v4 in check-editorconfig.yml - fix node16.js usage warning --- .github/workflows/check-editorconfig.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-editorconfig.yml b/.github/workflows/check-editorconfig.yml index 07f6d6c94..927718762 100644 --- a/.github/workflows/check-editorconfig.yml +++ b/.github/workflows/check-editorconfig.yml @@ -8,6 +8,6 @@ jobs: editorconfig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: EditorConfig-Action uses: greut/eclint-action@v0 From e5b4829074b296634233dea756d77379749c1bd6 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sun, 19 May 2024 11:54:33 -0400 Subject: [PATCH 07/46] bound lso/lsi to limit of dbAddr::field_size --- modules/database/src/std/rec/lsiRecord.c | 3 +++ modules/database/src/std/rec/lsoRecord.c | 3 +++ modules/database/src/std/rec/lsoRecord.dbd.pod | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/database/src/std/rec/lsiRecord.c b/modules/database/src/std/rec/lsiRecord.c index 496350875..5ecceab09 100644 --- a/modules/database/src/std/rec/lsiRecord.c +++ b/modules/database/src/std/rec/lsiRecord.c @@ -49,6 +49,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, "lsi::init_record"); diff --git a/modules/database/src/std/rec/lsoRecord.c b/modules/database/src/std/rec/lsoRecord.c index 0f6d51640..755a0e865 100644 --- a/modules/database/src/std/rec/lsoRecord.c +++ b/modules/database/src/std/rec/lsoRecord.c @@ -53,6 +53,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, "lso::init_record"); diff --git a/modules/database/src/std/rec/lsoRecord.dbd.pod b/modules/database/src/std/rec/lsoRecord.dbd.pod index 0b3bc06e2..edfc9c4fc 100644 --- a/modules/database/src/std/rec/lsoRecord.dbd.pod +++ b/modules/database/src/std/rec/lsoRecord.dbd.pod @@ -41,7 +41,7 @@ C is specified, DOL is ignored, the current value of VAL is written, and VAL can be changed externally via dbPuts at run-time. The maximum number of characters in VAL is given by SIZV, and cannot be larger -than 65535. +than 32767. DOL can also be a constant instead of a link, in which case VAL is initialized to the constant value. Most simple string constants are likely to be interpreted From 4966baf423a2800347e55630841df19170c01d15 Mon Sep 17 00:00:00 2001 From: DW Date: Sun, 19 May 2024 18:57:41 +0200 Subject: [PATCH 08/46] 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 619a1df1a..d5016672d 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 edfc9c4fc..6e2c013ac 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 0552ff7bb..72589b2e3 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 b649158ee..a3bef9610 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 From beec00b403ac5d9e395c9fce37987ff0d7f51b37 Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Thu, 14 Mar 2024 09:29:11 +0100 Subject: [PATCH 09/46] Fix issue with compress record The handling of N-to-M array compression was broken with the addition of the partial buffer option, which broke the bounds check that was being used. Note that this also makes the partial buffer option more consistent; if, for example, you have ``` record(compress, foo) { field(ALG, "N to 1 Average") field(INP, "bar NPP") field(NSAM, 2) field(N, 2) field(PBUF, YES) } ``` (with `bar` having, e.g. length 3), then this will now behave as expected on both of the samples. --- modules/database/src/std/rec/compressRecord.c | 80 +++++++++---------- modules/database/test/std/rec/compressTest.c | 66 ++++++++++++++- 2 files changed, 103 insertions(+), 43 deletions(-) diff --git a/modules/database/src/std/rec/compressRecord.c b/modules/database/src/std/rec/compressRecord.c index b6fafb4ab..22e804915 100644 --- a/modules/database/src/std/rec/compressRecord.c +++ b/modules/database/src/std/rec/compressRecord.c @@ -149,13 +149,16 @@ static int compare(const void *arg1, const void *arg2) else return 1; } +#define min(a, b) ((a) < (b) ? (a) : (b)) + static int compress_array(compressRecord *prec, double *psource, int no_elements) { - epicsInt32 i,j; + epicsInt32 j; epicsInt32 n, nnew; epicsInt32 nsam = prec->nsam; - double value; + epicsUInt32 samples_written = 0; + double value = 0.0; /* skip out of limit data */ if (prec->ilil < prec->ihil) { @@ -167,61 +170,54 @@ static int compress_array(compressRecord *prec, } if (prec->n <= 0) prec->n = 1; - if (no_elements < prec->n && prec->pbuf != menuYesNoYES) - return 1; /*dont do anything*/ - n = no_elements; + n = prec->n; - /* determine number of samples to take */ - if (no_elements < nsam * n) - nnew = (no_elements / n); - else nnew = nsam; + nnew = min(no_elements, nsam * n); - /* compress according to specified algorithm */ - switch (prec->alg){ - case compressALG_N_to_1_Low_Value: - /* compress N to 1 keeping the lowest value */ - for (i = 0; i < nnew; i++) { + while (nnew > 0) + { + if (nnew < n && prec->pbuf != menuYesNoYES) + break; + + n = min(n, nnew); + switch (prec->alg) + { + case compressALG_N_to_1_Low_Value: value = *psource++; - for (j = 1; j < n; j++, psource++) { + for (j = 1; j < n; j++, psource++) + { if (value > *psource) value = *psource; } - put_value(prec, &value, 1); - } - break; - case compressALG_N_to_1_High_Value: - /* compress N to 1 keeping the highest value */ - for (i = 0; i < nnew; i++){ + break; + case compressALG_N_to_1_High_Value: value = *psource++; - for (j = 1; j < n; j++, psource++) { + for (j = 1; j < n; j++, psource++) + { if (value < *psource) value = *psource; } - put_value(prec, &value, 1); - } - break; - case compressALG_N_to_1_Average: - /* compress N to 1 keeping the average value */ - for (i = 0; i < nnew; i++) { - value = 0; - for (j = 0; j < n; j++, psource++) + break; + case compressALG_N_to_1_Average: + value = *psource++; + for (j = 1; j < n; j++, psource++) + { value += *psource; - value /= n; - put_value(prec, &value, 1); - } - break; - - case compressALG_N_to_1_Median: - /* compress N to 1 keeping the median value */ - /* note: sorts source array (OK; it's a work pointer) */ - for (i = 0; i < nnew; i++, psource += nnew) { + } + value = value / n; + break; + case compressALG_N_to_1_Median: + /* note: sorts source array (OK; it's a work pointer) */ qsort(psource, n, sizeof(double), compare); value = psource[n / 2]; - put_value(prec, &value, 1); + psource += n; + break; } - break; + nnew -= n; + put_value(prec, &value, 1); + samples_written++; } - return 0; + return (samples_written == 0); } static int array_average(compressRecord *prec, diff --git a/modules/database/test/std/rec/compressTest.c b/modules/database/test/std/rec/compressTest.c index ed5f31e63..cedb28f48 100644 --- a/modules/database/test/std/rec/compressTest.c +++ b/modules/database/test/std/rec/compressTest.c @@ -469,6 +469,38 @@ testNto1Average(void) { testdbCleanup(); } +void testNto2Average(void) { + DBADDR wfaddr, caddr; + + testDiag("Test N to 1 Average, NSAM=2, N=2"); + + testdbPrepare(); + + testdbReadDatabase("recTestIoc.dbd", NULL, NULL); + + recTestIoc_registerRecordDeviceDriver(pdbbase); + + testdbReadDatabase("compressTest.db", NULL, "INP=wf,ALG=N to 1 Average,BALG=FIFO Buffer,NSAM=2,N=2"); + + eltc(0); + testIocInitOk(); + eltc(1); + + fetchRecordOrDie("wf", wfaddr); + fetchRecordOrDie("comp", caddr); + + writeToWaveform(&wfaddr, 4, 1., 2., 3., 4.); + + dbScanLock(caddr.precord); + dbProcess(caddr.precord); + + checkArrD("comp", 2, 1.5, 3.5, 0, 0); + dbScanUnlock(caddr.precord); + + testIocShutdownOk(); + testdbCleanup(); +} + void testNto1AveragePartial(void) { double buf = 0.0; @@ -517,6 +549,36 @@ testNto1AveragePartial(void) { testdbCleanup(); } +void +testNtoMPartial(void) { + DBADDR wfaddr, caddr; + + testDiag("Test Average, N to M, Partial"); + + testdbPrepare(); + testdbReadDatabase("recTestIoc.dbd", NULL, NULL); + recTestIoc_registerRecordDeviceDriver(pdbbase); + testdbReadDatabase("compressTest.db", NULL, "INP=wf,ALG=N to 1 Average,BALG=FIFO Buffer,NSAM=2,N=3,PBUF=YES"); + + eltc(0); + testIocInitOk(); + eltc(1); + + fetchRecordOrDie("wf", wfaddr); + fetchRecordOrDie("comp", caddr); + + writeToWaveform(&wfaddr, 4, 1., 2., 3., 4.); + + dbScanLock(caddr.precord); + dbProcess(caddr.precord); + + checkArrD("comp", 2, 2.0, 4.0, 0, 0); + dbScanUnlock(caddr.precord); + + testIocShutdownOk(); + testdbCleanup(); +} + void testNto1LowValue(void) { double buf = 0.0; @@ -634,12 +696,14 @@ testAIAveragePartial(void) { MAIN(compressTest) { - testPlan(132); + testPlan(134); testFIFOCirc(); testLIFOCirc(); testArrayAverage(); testNto1Average(); + testNto2Average(); testNto1AveragePartial(); + testNtoMPartial(); testAIAveragePartial(); testNto1LowValue(); return testDone(); From 1db37bcd91110195b5e8bdebb80b1bda43fb06b5 Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Wed, 15 May 2024 16:40:16 +0200 Subject: [PATCH 10/46] Update release notes --- documentation/RELEASE_NOTES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 73a50594d..c66a44c66 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -22,6 +22,11 @@ should also be read to understand what has changed since earlier releases: ## Changes made on the 7.0 branch since 7.0.8 +### Fix issue with compress record + +In Base 7.0.8, an update to the compress record was added to allow for certain +algorithms to use partially filled buffers in their computations. Unfortunately, +this broke the behaviour of the records in certain cases. This has been fixed. ----- From 11fba63d1878bad35a047f25e671a4e20f612549 Mon Sep 17 00:00:00 2001 From: DW Date: Thu, 16 May 2024 20:56:29 +0200 Subject: [PATCH 11/46] Fix histogram doc --- modules/database/src/std/rec/histogramRecord.dbd.pod | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/database/src/std/rec/histogramRecord.dbd.pod b/modules/database/src/std/rec/histogramRecord.dbd.pod index 1c8a4a556..c23ae6550 100644 --- a/modules/database/src/std/rec/histogramRecord.dbd.pod +++ b/modules/database/src/std/rec/histogramRecord.dbd.pod @@ -91,10 +91,10 @@ The BPTR field contains a pointer to the unsigned long array of frequency values. The VAL field references this array as well. However, the BPTR field is not accessible at run-time. -The MCNT field keeps counts the number of signal counts since the last monitor +The MCNT field keeps the number of signal counts since the last monitor was invoked. -The collections controls field (CMD) is a menu field with five choices: +The collections controls field (CMD) is a menu field with four choices: =menu histogramCMD @@ -110,8 +110,6 @@ array. Unlike C, it doesn't clear the array first. The C command disables the reading of signal values into the array. -The C command waits until the C or C command has been issued -to start counting. The CSTA or collections status field implements the CMD field choices by enabling or disabling the reading of values into the histogram array. While From 4a305a42a79bc586ba57a0017761e0fc05402fdc Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 3 Nov 2021 11:34:12 -0700 Subject: [PATCH 12/46] softMain log iocInit() failure. --- modules/database/src/std/softIoc/softMain.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/database/src/std/softIoc/softMain.cpp b/modules/database/src/std/softIoc/softMain.cpp index 11eb76120..892246ae1 100644 --- a/modules/database/src/std/softIoc/softMain.cpp +++ b/modules/database/src/std/softIoc/softMain.cpp @@ -21,6 +21,7 @@ #include "epicsExit.h" #include "epicsStdio.h" #include "epicsString.h" +#include "errlog.h" #include "dbStaticLib.h" #include "subRecord.h" #include "dbAccess.h" @@ -92,7 +93,7 @@ void usage(const char *arg0, const std::string& base_dbd) { "interactive IOC shell.\n" "\n" "Compiled-in path to softIoc.dbd is:\n" - "\t"< Date: Mon, 15 Apr 2024 13:26:19 -0700 Subject: [PATCH 13/46] WARN for FLNK uses CA without PROC --- modules/database/src/ioc/db/dbLink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/ioc/db/dbLink.c b/modules/database/src/ioc/db/dbLink.c index f5d286447..a2819d553 100644 --- a/modules/database/src/ioc/db/dbLink.c +++ b/modules/database/src/ioc/db/dbLink.c @@ -133,7 +133,7 @@ void dbInitLink(struct link *plink, short dbfType) plink->value.pv_link.pvlMask |= pvlOptFWD; } else { - errlogPrintf("Forward-link uses Channel Access " + errlogPrintf(ERL_WARNING ": Forward-link uses Channel Access " "without pointing to PROC field\n" " %s.%s => %s\n", precord->name, dbLinkFieldName(plink), From 77490d4939bcce41bc2b053053e63dd820e1329d Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 24 Jan 2024 11:32:26 -0500 Subject: [PATCH 14/46] space in errPrintf() output --- modules/libcom/src/error/errlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libcom/src/error/errlog.c b/modules/libcom/src/error/errlog.c index 480375ea4..75c6e63c1 100644 --- a/modules/libcom/src/error/errlog.c +++ b/modules/libcom/src/error/errlog.c @@ -500,7 +500,7 @@ void errPrintf(long status, const char *pFileName, int lineno, errSymLookup(status, name, sizeof(name)); } - nchar = epicsSnprintf(buf, pvt.maxMsgSize, "%s%sfilename=\"%s\" line number=%d", + nchar = epicsSnprintf(buf, pvt.maxMsgSize, "%s%sfilename=\"%s\" line number=%d ", name, status ? " " : "", pFileName, lineno); if(nchar < pvt.maxMsgSize) nchar += epicsVsnprintf(buf + nchar, pvt.maxMsgSize - nchar, pformat, pvar); From fe4247d57d01ce542b99f36bc3331cfd1385e503 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sun, 14 Jan 2024 16:43:18 -0800 Subject: [PATCH 15/46] Send .db parser errors to stderr --- .../database/src/ioc/dbStatic/dbLexRoutines.c | 60 +++++++++---------- modules/database/src/ioc/dbStatic/dbYacc.y | 6 +- modules/database/src/std/softIoc/softMain.cpp | 4 +- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/modules/database/src/ioc/dbStatic/dbLexRoutines.c b/modules/database/src/ioc/dbStatic/dbLexRoutines.c index cd3c6ff0d..702b2291e 100644 --- a/modules/database/src/ioc/dbStatic/dbLexRoutines.c +++ b/modules/database/src/ioc/dbStatic/dbLexRoutines.c @@ -225,7 +225,7 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp, char **macPairs; if (ellCount(&tempList)) { - epicsPrintf("dbReadCOM: Parser stack dirty %d\n", ellCount(&tempList)); + fprintf(stderr, ERL_WARNING ": dbReadCOM: Parser stack dirty %d\n", ellCount(&tempList)); } if (getIocState() != iocVoid) { @@ -250,7 +250,7 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp, if (substitutions == NULL) substitutions = ""; if(macCreateHandle(&macHandle,NULL)) { - epicsPrintf("macCreateHandle error\n"); + fprintf(stderr, ERL_ERROR ": macCreateHandle failed\n"); status = -1; goto cleanup; } @@ -294,7 +294,7 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp, status = pvt_yy_parse(); if (ellCount(&tempList) && !yyAbort) - epicsPrintf("dbReadCOM: Parser stack dirty w/o error. %d\n", ellCount(&tempList)); + fprintf(stderr, ERL_WARNING ": dbReadCOM: Parser stack dirty w/o error. %d\n", ellCount(&tempList)); while (ellCount(&tempList)) popFirstTemp(); /* Memory leak on parser failure */ @@ -401,15 +401,15 @@ static void dbIncludePrint(void) inputFile *pinputFile = pinputFileNow; while (pinputFile) { - epicsPrintf(" in"); + fprintf(stderr, " in"); if (pinputFile->path) - epicsPrintf(" path \"%s\" ",pinputFile->path); + fprintf(stderr, " path \"%s\" ",pinputFile->path); if (pinputFile->filename) { - epicsPrintf(" file \"%s\"",pinputFile->filename); + fprintf(stderr, " file \"%s\"",pinputFile->filename); } else { - epicsPrintf(" standard input"); + fprintf(stderr, " standard input"); } - epicsPrintf(" line %d\n",pinputFile->line_num); + fprintf(stderr, " line %d\n",pinputFile->line_num); pinputFile = (inputFile *)ellPrevious(&pinputFile->node); } return; @@ -434,7 +434,7 @@ static void dbIncludeNew(char *filename) pinputFile->filename = macEnvExpand(filename); pinputFile->path = dbOpenFile(savedPdbbase, pinputFile->filename, &fp); if (!fp) { - epicsPrintf("Can't open include file \"%s\"\n", filename); + fprintf(stderr, "Can't open include file \"%s\"\n", filename); yyerror(NULL); free((void *)pinputFile->filename); free((void *)pinputFile); @@ -696,7 +696,7 @@ static void dbRecordtypeEmpty(void) ptempListNode = (tempListNode *)ellFirst(&tempList); pdbRecordType = ptempListNode->item; - epicsPrintf("Declaration of recordtype(%s) preceeded full definition.\n", + fprintf(stderr, "Declaration of recordtype(%s) preceeded full definition.\n", pdbRecordType->name); yyerrorAbort(NULL); } @@ -801,7 +801,7 @@ static void dbDevice(char *recordtype,char *linktype, int i,link_type; pgphentry = gphFind(savedPdbbase->pgpHash,recordtype,&savedPdbbase->recordTypeList); if(!pgphentry) { - epicsPrintf("Record type \"%s\" not found for device \"%s\"\n", + fprintf(stderr, "Record type \"%s\" not found for device \"%s\"\n", recordtype, choicestring); yyerror(NULL); return; @@ -814,7 +814,7 @@ static void dbDevice(char *recordtype,char *linktype, } } if(link_type==-1) { - epicsPrintf("Bad link type \"%s\" for device \"%s\"\n", + fprintf(stderr, "Bad link type \"%s\" for device \"%s\"\n", linktype, choicestring); yyerror(NULL); return; @@ -1077,16 +1077,16 @@ int dbRecordNameValidate(const char *name) if(i==0) { /* first character restrictions */ if(c=='-' || c=='+' || c=='[' || c=='{') { - errlogPrintf("Warning: Record/Alias name '%s' should not begin with '%c'\n", name, c); + fprintf(stderr, "Warning: Record/Alias name '%s' should not begin with '%c'\n", name, c); } } /* any character restrictions */ if(c < ' ') { - errlogPrintf("Warning: Record/Alias name '%s' should not contain non-printable 0x%02x\n", + fprintf(stderr, "Warning: Record/Alias name '%s' should not contain non-printable 0x%02x\n", name, c); } else if(c==' ' || c=='\t' || c=='"' || c=='\'' || c=='.' || c=='$') { - epicsPrintf(ERL_ERROR ": Bad character '%c' in Record/Alias name \"%s\"\n", + fprintf(stderr, ERL_ERROR ": Bad character '%c' in Record/Alias name \"%s\"\n", c, name); yyerrorAbort(NULL); return 1; @@ -1113,7 +1113,7 @@ static void dbRecordHead(char *recordType, char *name, int visible) status = dbFindRecord(pdbentry, name); if (status == 0) return; /* done */ - epicsPrintf(ERL_ERROR ": Record \"%s\" not found\n", name); + fprintf(stderr, ERL_ERROR ": Record \"%s\" not found\n", name); yyerror(NULL); duplicate = TRUE; return; @@ -1121,7 +1121,7 @@ static void dbRecordHead(char *recordType, char *name, int visible) status = dbFindRecordType(pdbentry, recordType); if (status) { - epicsPrintf("Record \"%s\" is of unknown type \"%s\"\n", + fprintf(stderr, "Record \"%s\" is of unknown type \"%s\"\n", name, recordType); yyerrorAbort(NULL); return; @@ -1132,14 +1132,14 @@ static void dbRecordHead(char *recordType, char *name, int visible) status = dbCreateRecord(pdbentry,name); if (status == S_dbLib_recExists) { if (strcmp(recordType, dbGetRecordTypeName(pdbentry)) != 0) { - epicsPrintf(ERL_ERROR ": Record \"%s\" of type \"%s\" redefined with new type " + fprintf(stderr, ERL_ERROR ": Record \"%s\" of type \"%s\" redefined with new type " "\"%s\"\n", name, dbGetRecordTypeName(pdbentry), recordType); yyerror(NULL); duplicate = TRUE; return; } else if (dbRecordsOnceOnly) { - epicsPrintf(ERL_ERROR ": Record \"%s\" already defined and dbRecordsOnceOnly set.\n" + fprintf(stderr, ERL_ERROR ": Record \"%s\" already defined and dbRecordsOnceOnly set.\n" "Used record type \"*\" to append.\n", name); yyerror(NULL); @@ -1147,7 +1147,7 @@ static void dbRecordHead(char *recordType, char *name, int visible) } } else if (status) { - epicsPrintf("Can't create record \"%s\" of type \"%s\"\n", + fprintf(stderr, "Can't create record \"%s\" of type \"%s\"\n", name, recordType); yyerrorAbort(NULL); } @@ -1167,7 +1167,7 @@ static void dbRecordField(char *name,char *value) pdbentry = ptempListNode->item; status = dbFindField(pdbentry,name); if (status) { - epicsPrintf("%s Record \"%s\" does not have a field \"%s\"\n", + fprintf(stderr, "%s Record \"%s\" does not have a field \"%s\"\n", dbGetRecordTypeName(pdbentry), dbGetRecordName(pdbentry), name); if(dbGetRecordName(pdbentry)) { DBENTRY temp; @@ -1183,17 +1183,17 @@ static void dbRecordField(char *name,char *value) } dbFinishEntry(&temp); if(bestSim>0.0) { - epicsPrintf(" Did you mean \"%s\"?", bestFld->name); + fprintf(stderr, " Did you mean \"%s\"?", bestFld->name); if(bestFld->prompt) - epicsPrintf(" (%s)", bestFld->prompt); - epicsPrintf("\n"); + fprintf(stderr, " (%s)", bestFld->prompt); + fprintf(stderr, "\n"); } } yyerror(NULL); return; } if (pdbentry->indfield == 0) { - epicsPrintf("Can't set \"NAME\" field of record \"%s\"\n", + fprintf(stderr, "Can't set \"NAME\" field of record \"%s\"\n", dbGetRecordName(pdbentry)); yyerror(NULL); return; @@ -1211,7 +1211,7 @@ static void dbRecordField(char *name,char *value) char msg[128]; errSymLookup(status, msg, sizeof(msg)); - epicsPrintf("Can't set \"%s.%s\" to \"%s\" %s : %s\n", + fprintf(stderr, "Can't set \"%s.%s\" to \"%s\" %s : %s\n", dbGetRecordName(pdbentry), name, value, pdbentry->message ? pdbentry->message : "", msg); dbPutStringSuggest(pdbentry, value); yyerror(NULL); @@ -1242,7 +1242,7 @@ static void dbRecordInfo(char *name, char *value) status = dbPutInfo(pdbentry,name,value); if (status) { - epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n", + fprintf(stderr, "Can't set \"%s\" info \"%s\" to \"%s\"\n", dbGetRecordName(pdbentry), name, value); yyerror(NULL); return; @@ -1263,7 +1263,7 @@ static void dbRecordAlias(char *name) pdbentry = ptempListNode->item; status = dbCreateAlias(pdbentry, name); if (status) { - epicsPrintf("Can't create alias \"%s\" for \"%s\"\n", + fprintf(stderr, "Can't create alias \"%s\" for \"%s\"\n", name, dbGetRecordName(pdbentry)); yyerror(NULL); return; @@ -1280,12 +1280,12 @@ static void dbAlias(char *name, char *alias) dbInitEntry(savedPdbbase, pdbEntry); if (dbFindRecord(pdbEntry, name)) { - epicsPrintf("Alias \"%s\" refers to unknown record \"%s\"\n", + fprintf(stderr, "Alias \"%s\" refers to unknown record \"%s\"\n", alias, name); yyerror(NULL); } else if (dbCreateAlias(pdbEntry, alias)) { - epicsPrintf("Can't create alias \"%s\" referring to \"%s\"\n", + fprintf(stderr, "Can't create alias \"%s\" referring to \"%s\"\n", alias, name); yyerror(NULL); } diff --git a/modules/database/src/ioc/dbStatic/dbYacc.y b/modules/database/src/ioc/dbStatic/dbYacc.y index 369fd914f..098144f05 100644 --- a/modules/database/src/ioc/dbStatic/dbYacc.y +++ b/modules/database/src/ioc/dbStatic/dbYacc.y @@ -370,11 +370,11 @@ json_value: jsonNULL { $$ = dbmfStrdup("null"); } static int yyerror(char *str) { if (str) - epicsPrintf(ERL_ERROR ": %s\n", str); + fprintf(stderr, ERL_ERROR ": %s\n", str); else - epicsPrintf(ERL_ERROR ""); + fprintf(stderr, ERL_ERROR ": "); if (!yyFailed) { /* Only print this stuff once */ - epicsPrintf(" at or before '%s'", yytext); + fprintf(stderr, " at or before '%s'", yytext); dbIncludePrint(); yyFailed = TRUE; } diff --git a/modules/database/src/std/softIoc/softMain.cpp b/modules/database/src/std/softIoc/softMain.cpp index 892246ae1..4c1b49a2b 100644 --- a/modules/database/src/std/softIoc/softMain.cpp +++ b/modules/database/src/std/softIoc/softMain.cpp @@ -17,6 +17,7 @@ #include #include "registryFunction.h" +#include "errlog.h" #include "epicsThread.h" #include "epicsExit.h" #include "epicsStdio.h" @@ -273,7 +274,8 @@ int main(int argc, char *argv[]) return 0; }catch(std::exception& e){ - std::cerr<<"Error: "< Date: Tue, 11 Jun 2024 11:13:35 -0700 Subject: [PATCH 16/46] iocInit errors say ERROR --- modules/database/src/ioc/misc/iocInit.c | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/database/src/ioc/misc/iocInit.c b/modules/database/src/ioc/misc/iocInit.c index 1b1d4fc0b..14291808a 100644 --- a/modules/database/src/ioc/misc/iocInit.c +++ b/modules/database/src/ioc/misc/iocInit.c @@ -114,7 +114,7 @@ int iocInit(void) static int iocBuild_1(void) { if (iocState != iocVoid) { - errlogPrintf("iocBuild: IOC can only be initialized from uninitialized or stopped state\n"); + errlogPrintf("iocBuild: " ERL_ERROR " IOC can only be initialized from uninitialized or stopped state\n"); return -1; } errlogInit(0); @@ -126,7 +126,7 @@ static int iocBuild_1(void) errlogPrintf("Starting iocInit\n"); if (checkDatabase(pdbbase)) { - errlogPrintf("iocBuild: Aborting, bad database definition (DBD)!\n"); + errlogPrintf("iocBuild: " ERL_ERROR " Aborting, bad database definition (DBD)!\n"); return -1; } epicsSignalInstallSigHupIgnore(); @@ -237,7 +237,7 @@ int iocBuildIsolated(void) int iocRun(void) { if (iocState != iocPaused && iocState != iocBuilt) { - errlogPrintf("iocRun: IOC not paused\n"); + errlogPrintf("iocRun: " ERL_WARNING " IOC not paused\n"); return -1; } initHookAnnounce(initHookAtIocRun); @@ -268,7 +268,7 @@ int iocRun(void) int iocPause(void) { if (iocState != iocRunning) { - errlogPrintf("iocPause: IOC not running\n"); + errlogPrintf("iocPause: " ERL_WARNING " IOC not running\n"); return -1; } initHookAnnounce(initHookAtIocPause); @@ -306,59 +306,59 @@ static int checkDatabase(dbBase *pdbbase) const dbMenu *pMenu; if (!pdbbase) { - errlogPrintf("checkDatabase: No database definitions loaded.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " No database definitions loaded.\n"); return -1; } pMenu = dbFindMenu(pdbbase, "menuConvert"); if (!pMenu) { - errlogPrintf("checkDatabase: menuConvert not defined.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuConvert not defined.\n"); return -1; } if (pMenu->nChoice <= menuConvertLINEAR) { - errlogPrintf("checkDatabase: menuConvert has too few choices.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuConvert has too few choices.\n"); return -1; } if (strcmp(pMenu->papChoiceName[menuConvertNO_CONVERSION], "menuConvertNO_CONVERSION")) { - errlogPrintf("checkDatabase: menuConvertNO_CONVERSION doesn't match.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuConvertNO_CONVERSION doesn't match.\n"); return -1; } if (strcmp(pMenu->papChoiceName[menuConvertSLOPE], "menuConvertSLOPE")) { - errlogPrintf("checkDatabase: menuConvertSLOPE doesn't match.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuConvertSLOPE doesn't match.\n"); return -1; } if (strcmp(pMenu->papChoiceName[menuConvertLINEAR], "menuConvertLINEAR")) { - errlogPrintf("checkDatabase: menuConvertLINEAR doesn't match.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuConvertLINEAR doesn't match.\n"); return -1; } pMenu = dbFindMenu(pdbbase, "menuScan"); if (!pMenu) { - errlogPrintf("checkDatabase: menuScan not defined.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuScan not defined.\n"); return -1; } if (pMenu->nChoice <= menuScanI_O_Intr) { - errlogPrintf("checkDatabase: menuScan has too few choices.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuScan has too few choices.\n"); return -1; } if (strcmp(pMenu->papChoiceName[menuScanPassive], "menuScanPassive")) { - errlogPrintf("checkDatabase: menuScanPassive doesn't match.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuScanPassive doesn't match.\n"); return -1; } if (strcmp(pMenu->papChoiceName[menuScanEvent], "menuScanEvent")) { - errlogPrintf("checkDatabase: menuScanEvent doesn't match.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuScanEvent doesn't match.\n"); return -1; } if (strcmp(pMenu->papChoiceName[menuScanI_O_Intr], "menuScanI_O_Intr")) { - errlogPrintf("checkDatabase: menuScanI_O_Intr doesn't match.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuScanI_O_Intr doesn't match.\n"); return -1; } if (pMenu->nChoice <= SCAN_1ST_PERIODIC) { - errlogPrintf("checkDatabase: menuScan has no periodic choices.\n"); + errlogPrintf("checkDatabase: " ERL_ERROR " menuScan has no periodic choices.\n"); return -1; } From 6ca716a77f24247e96952d1778bb1673600bb420 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 11 Jun 2024 13:51:44 -0700 Subject: [PATCH 17/46] iocsh: add more iocshSetError() --- modules/libcom/src/iocsh/iocsh.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/libcom/src/iocsh/iocsh.cpp b/modules/libcom/src/iocsh/iocsh.cpp index 39effd9b9..1e1cf1cd0 100644 --- a/modules/libcom/src/iocsh/iocsh.cpp +++ b/modules/libcom/src/iocsh/iocsh.cpp @@ -1433,13 +1433,16 @@ static void varCallFunc(const iocshArgBuf *args) varHandler(v->pVarDef, NULL); found = 1; } - if (!found && name != NULL) + if (!found && name != NULL) { fprintf(epicsGetStderr(), ANSI_RED("No var matching") " %s found.\n", name); + iocshSetError(1); + } } else { v = (iocshVariable *)registryFind(iocshVarID, args[0].sval); if (v == NULL) { fprintf(epicsGetStderr(), "Var %s " ANSI_RED("not found.") "\n", name); + iocshSetError(1); } else { varHandler(v->pVarDef, value); @@ -1456,7 +1459,7 @@ static const iocshFuncDef iocshCmdFuncDef = {"iocshCmd",1,iocshCmdArgs, " from vxWorks or RTEMS startup script (or command line)\n"}; static void iocshCmdCallFunc(const iocshArgBuf *args) { - iocshCmd(args[0].sval); + iocshSetError(iocshCmd(args[0].sval)); } /* iocshLoad */ @@ -1468,7 +1471,7 @@ static const iocshFuncDef iocshLoadFuncDef = {"iocshLoad",2,iocshLoadArgs, " * (optional) replace macros within the file with provided values\n"}; static void iocshLoadCallFunc(const iocshArgBuf *args) { - iocshLoad(args[0].sval, args[1].sval); + iocshSetError(iocshLoad(args[0].sval, args[1].sval)); } /* iocshRun */ @@ -1481,7 +1484,7 @@ static const iocshFuncDef iocshRunFuncDef = {"iocshRun",2,iocshRunArgs, " from vxWorks or RTEMS startup script (or command line)\n"}; static void iocshRunCallFunc(const iocshArgBuf *args) { - iocshRun(args[0].sval, args[1].sval); + iocshSetError(iocshRun(args[0].sval, args[1].sval)); } /* on */ From 4c205188640502806c7747a9ebe7c0239ffcb468 Mon Sep 17 00:00:00 2001 From: seifalrahman <130805731+seifalrahman@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:58:23 +0200 Subject: [PATCH 18/46] modifying the condition from (status!=0) to (status>0) to skip the block in case the status variable ==-1 --- modules/database/src/ioc/db/recGbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/ioc/db/recGbl.c b/modules/database/src/ioc/db/recGbl.c index c9bb62fdb..42248bdc4 100644 --- a/modules/database/src/ioc/db/recGbl.c +++ b/modules/database/src/ioc/db/recGbl.c @@ -62,7 +62,7 @@ void recGblRecordError(long status, void *pdbc, dbCommon *precord = pdbc; char errMsg[256] = ""; - if (status) + if ( status>0 ) errSymLookup(status, errMsg, sizeof(errMsg)); errlogPrintf("recGblRecordError: %s %s PV: %s\n", From a864f16318beef781555925b50f9c21326643b6e Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 11 Jun 2024 17:17:35 -0700 Subject: [PATCH 19/46] dbCa test sync. improvements --- modules/database/src/ioc/db/dbCa.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/database/src/ioc/db/dbCa.c b/modules/database/src/ioc/db/dbCa.c index 57cca404f..42fe374a8 100644 --- a/modules/database/src/ioc/db/dbCa.c +++ b/modules/database/src/ioc/db/dbCa.c @@ -225,6 +225,7 @@ void testdbCaWaitForEvent(DBLINK *plink, unsigned long cnt, enum testEvent event assert(plink->type==CA_LINK); pca = (caLink *)plink->value.pv_link.pvt; + caLinkInc(pca); epicsMutexMustLock(pca->lock); assert(!pca->monitor && !pca->connect && !pca->userPvt); @@ -239,6 +240,8 @@ void testdbCaWaitForEvent(DBLINK *plink, unsigned long cnt, enum testEvent event dbScanUnlock(plink->precord); epicsEventMustWait(evt); + /* ensure worker has finished executing */ + dbCaSync(); dbScanLock(plink->precord); epicsMutexMustLock(pca->lock); @@ -250,6 +253,7 @@ void testdbCaWaitForEvent(DBLINK *plink, unsigned long cnt, enum testEvent event epicsEventDestroy(evt); epicsMutexUnlock(pca->lock); + caLinkDec(pca); dbScanUnlock(plink->precord); } @@ -287,16 +291,15 @@ void dbCaSync(void) epicsEventMustWait(wake); /* Worker holds workListLock when calling epicsEventMustTrigger() - * we cycle through workListLock to ensure worker call to + * we hold workListLock to ensure worker call to * epicsEventMustTrigger() returns before we destroy the event. */ epicsMutexMustLock(workListLock); - epicsMutexUnlock(workListLock); - assert(templink.refcount==1); epicsMutexDestroy(templink.lock); epicsEventDestroy(wake); + epicsMutexUnlock(workListLock); } void dbCaCallbackProcess(void *userPvt) From ede745cc34a0fff55dc46b99fab037bd9aaccae5 Mon Sep 17 00:00:00 2001 From: Chris Guerrero <36832698+chrisalguerrero@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:55:01 -0400 Subject: [PATCH 20/46] Update aSubRecord.dbd.pod --- modules/database/src/std/rec/aSubRecord.dbd.pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/std/rec/aSubRecord.dbd.pod b/modules/database/src/std/rec/aSubRecord.dbd.pod index 5eeb30d54..8c97117d7 100644 --- a/modules/database/src/std/rec/aSubRecord.dbd.pod +++ b/modules/database/src/std/rec/aSubRecord.dbd.pod @@ -16,7 +16,7 @@ has a number of additional features: =item * -It provides 20 different input and output fields which can hold array or +It provides 21 different input and output fields which can hold array or scalar values. The types and array capacities of these are user configurable, and they all have an associated input or output link. From 1b46077096df18933168455f7f26dd4777b46b98 Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Wed, 13 Mar 2024 14:45:39 +0100 Subject: [PATCH 21/46] Fix off by one error in constant link fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For long string buffers, we currently write a null terminator one byte past the end of the buffer. This can be seen with a record of the type ``` record(aai, foo) { field(NELM, 1) field(FTVL, CHAR) field(INP, {const: "foo"}) } ``` where the buffer is only of size 1, but then we write at index 1 (aka past the end of the buffer). Co-authored-by: Lucas A. M. Magalhães --- modules/database/src/std/link/lnkConst.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/database/src/std/link/lnkConst.c b/modules/database/src/std/link/lnkConst.c index 4e15fa803..4374672f1 100644 --- a/modules/database/src/std/link/lnkConst.c +++ b/modules/database/src/std/link/lnkConst.c @@ -495,9 +495,11 @@ static long lnkConst_loadArray(struct link *plink, short dbrType, void *pbuffer, } else { /* Long string conversion */ - strncpy(pbuffer, clink->value.scalar_string, *pnReq); - ((char *)pbuffer)[*pnReq] = 0; - nElems = strlen(pbuffer) + 1; + if (*pnReq > 0) { + strncpy(pbuffer, clink->value.scalar_string, *pnReq); + ((char *)pbuffer)[*pnReq - 1] = 0; + nElems = strlen(pbuffer) + 1; + } status = 0; } break; From be8f8b41ff468427b3bf3f074a48480585745fee Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Mon, 10 Jun 2024 17:00:45 +0200 Subject: [PATCH 22/46] centralize -g flag for gnu targets --- configure/CONFIG.gnuCommon | 8 ++++++-- configure/os/CONFIG.Common.iosCommon | 6 ------ configure/os/CONFIG.darwinCommon.darwinCommon | 6 ------ configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 | 8 -------- configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 | 7 ------- configure/os/CONFIG_SITE.linux-x86.linux-x86 | 7 ------- configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 | 7 ------- 7 files changed, 6 insertions(+), 43 deletions(-) diff --git a/configure/CONFIG.gnuCommon b/configure/CONFIG.gnuCommon index f721b065e..a6305990b 100644 --- a/configure/CONFIG.gnuCommon +++ b/configure/CONFIG.gnuCommon @@ -27,13 +27,17 @@ RANLIB = $(GNU_BIN)/$(CMPLR_PREFIX)ranlib$(CMPLR_SUFFIX) ASAN_FLAGS_YES = -fsanitize=address ASAN_LDFLAGS_YES = $(ASAN_FLAGS_YES) +# It makes sense to include debugging symbols even in optimized builds +# in case you want to attach gdb to the process or examine a core-dump. +# This does cost disk space, but not memory as debug symbols are not +# loaded into RAM when the binary is loaded. PROF_CFLAGS_YES = -p GPROF_CFLAGS_YES = -pg CODE_CFLAGS = $(PROF_CFLAGS_$(PROFILE)) $(GPROF_CFLAGS_$(GPROF)) CODE_CFLAGS += $(ASAN_FLAGS_$(ENABLE_ASAN)) WARN_CFLAGS_YES = -Wall -Werror-implicit-function-declaration WARN_CFLAGS_NO = -w -OPT_CFLAGS_YES = -O3 +OPT_CFLAGS_YES = -O3 -g OPT_CFLAGS_NO = -g PROF_CXXFLAGS_YES = -p @@ -42,7 +46,7 @@ CODE_CXXFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF)) CODE_CXXFLAGS += $(ASAN_FLAGS_$(ENABLE_ASAN)) WARN_CXXFLAGS_YES = -Wall WARN_CXXFLAGS_NO = -w -OPT_CXXFLAGS_YES = -O3 +OPT_CXXFLAGS_YES = -O3 -g OPT_CXXFLAGS_NO = -g CODE_LDFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF)) diff --git a/configure/os/CONFIG.Common.iosCommon b/configure/os/CONFIG.Common.iosCommon index 5c248f38a..03d3cab8e 100644 --- a/configure/os/CONFIG.Common.iosCommon +++ b/configure/os/CONFIG.Common.iosCommon @@ -42,12 +42,6 @@ ARCH_DEP_LDFLAGS += $(ARCH_DEP_FLAGS) OP_SYS_CFLAGS += -isysroot $(SDK_DIR) OP_SYS_LDFLAGS += -isysroot $(SDK_DIR) -#-------------------------------------------------- -# Always compile in debugging symbol table information -# -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - #------------------------------------------------------- # Compiler definitions: diff --git a/configure/os/CONFIG.darwinCommon.darwinCommon b/configure/os/CONFIG.darwinCommon.darwinCommon index c0a69f46c..2c12b2fbb 100644 --- a/configure/os/CONFIG.darwinCommon.darwinCommon +++ b/configure/os/CONFIG.darwinCommon.darwinCommon @@ -39,12 +39,6 @@ OP_SYS_CFLAGS += -fno-common # OP_SYS_CPPFLAGS += -Ddarwin -# -# Always compile in debugging symbol table information -# -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - # # Libraries for command-line editing. # diff --git a/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 b/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 index 46a1eccea..3125c7a64 100644 --- a/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 +++ b/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 @@ -6,11 +6,3 @@ # GNU_DIR used when COMMANDLINE_LIBRARY is READLINE #GNU_DIR=C:/cygwin - -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - diff --git a/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 b/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 index e196135b7..f569951f1 100644 --- a/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 +++ b/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 @@ -3,10 +3,3 @@ # Site specific definitions for native linux-aarch64 builds #------------------------------------------------------- -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - diff --git a/configure/os/CONFIG_SITE.linux-x86.linux-x86 b/configure/os/CONFIG_SITE.linux-x86.linux-x86 index 5b2fa7c65..64810a835 100644 --- a/configure/os/CONFIG_SITE.linux-x86.linux-x86 +++ b/configure/os/CONFIG_SITE.linux-x86.linux-x86 @@ -3,13 +3,6 @@ # Site specific definitions for linux-x86 host - linux-x86 target builds #------------------------------------------------------- -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - # Uncomment the followings lines to build with CLANG instead of GCC. # #GNU = NO diff --git a/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 b/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 index 9178afd43..2f538151a 100644 --- a/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 +++ b/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 @@ -3,13 +3,6 @@ # Site specific definitions for linux-x86_64 host - linux-x86_64 target builds #------------------------------------------------------- -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - # Uncomment the followings lines to build with CLANG instead of GCC. # #GNU = NO From 0a6b9e4511ea455625566b41627e991ca0fa6e13 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 14 Jun 2024 16:00:49 -0700 Subject: [PATCH 23/46] dbScan: handle scanStop() before start --- modules/database/src/ioc/db/dbScan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/ioc/db/dbScan.c b/modules/database/src/ioc/db/dbScan.c index 6e8799784..966db7c24 100644 --- a/modules/database/src/ioc/db/dbScan.c +++ b/modules/database/src/ioc/db/dbScan.c @@ -155,7 +155,7 @@ void scanStop(void) { int i; - if (scanCtl == ctlExit) return; + if (scanCtl == ctlInit || scanCtl == ctlExit) return; scanCtl = ctlExit; interruptAccept = FALSE; From 72d50ce2749bbc791907a32c1ed77af1333a21f5 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 12 Jun 2024 21:51:52 -0700 Subject: [PATCH 24/46] fix dblsr() clearly doesn't get called very often... --- modules/database/src/ioc/db/dbLock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/ioc/db/dbLock.c b/modules/database/src/ioc/db/dbLock.c index 9a6b9efea..b6afbd629 100644 --- a/modules/database/src/ioc/db/dbLock.c +++ b/modules/database/src/ioc/db/dbLock.c @@ -918,7 +918,7 @@ long dblsr(char *recordname,int level) pdbFldDes = pdbRecordType->papFldDes[pdbRecordType->link_ind[link]]; plink = (DBLINK *)((char *)precord + pdbFldDes->offset); if(plink->type != DB_LINK) continue; - pdbAddr = (DBADDR *)(plink->value.pv_link.pvt); + pdbAddr = &((dbChannel *)(plink->value.pv_link.pvt))->addr; printf("\t%s",pdbFldDes->name); if(pdbFldDes->field_type==DBF_INLINK) { printf("\t INLINK"); From 772c10d904c2c149ce2154996091858514f27265 Mon Sep 17 00:00:00 2001 From: Tynan Ford Date: Fri, 14 Jun 2024 16:01:33 -0400 Subject: [PATCH 25/46] Fix issue with RSRV_SERVER_PORT above 9999 don't worry about null termination on epicsSnprintf call --- modules/database/src/ioc/rsrv/caservertask.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/database/src/ioc/rsrv/caservertask.c b/modules/database/src/ioc/rsrv/caservertask.c index 7e3ad7673..f904d3268 100644 --- a/modules/database/src/ioc/rsrv/caservertask.c +++ b/modules/database/src/ioc/rsrv/caservertask.c @@ -590,8 +590,7 @@ void rsrv_init (void) errlogPrintf ( "cas " ERL_WARNING ": reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)\n" ); } - epicsSnprintf(buf, sizeof(buf)-1u, "%u", ca_server_port); - buf[sizeof(buf)-1u] = '\0'; + epicsSnprintf(buf, sizeof(buf), "%u", ca_server_port); epicsEnvSet("RSRV_SERVER_PORT", buf); } From 5fe563bed8c9031c686d2d45559ef2ecf4a9357e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 26 Jun 2024 11:45:26 -0500 Subject: [PATCH 26/46] Limit _FORTIFY_SOURCE <= 2 --- configure/Makefile | 4 ++++ configure/toolchain.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/configure/Makefile b/configure/Makefile index ba77d5089..3c2c0b53a 100644 --- a/configure/Makefile +++ b/configure/Makefile @@ -34,5 +34,9 @@ CFG += TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A) include $(TOP)/configure/RULES +ifeq ($(GNU),YES) + # Pass compiler flags to preprocessor to enable _FORTIFY_SOURCE + TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A): CPPFLAGS += $(CFLAGS) +endif TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A): toolchain.c $(PREPROCESS.cpp) diff --git a/configure/toolchain.c b/configure/toolchain.c index da4e8bb2c..79333198c 100644 --- a/configure/toolchain.c +++ b/configure/toolchain.c @@ -47,3 +47,8 @@ COMMANDLINE_LIBRARY ?= EPICS #else COMMANDLINE_LIBRARY ?= $(strip $(if $(wildcard $(if $(GNU_DIR),$(GNU_DIR)/include/readline/readline.h)), READLINE, EPICS)) #endif + +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE>2 +OP_SYS_CPPFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 +#endif + From 5af9c7e50da82e1a34faea3ac172a059b8a8ebf0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 8 Jun 2024 21:51:13 -0500 Subject: [PATCH 27/46] Revert submodules to versions at R7.0.8 --- modules/normativeTypes | 2 +- modules/pvAccess | 2 +- modules/pvData | 2 +- modules/pvDatabase | 2 +- modules/pva2pva | 2 +- modules/pvaClient | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/normativeTypes b/modules/normativeTypes index 7a2d264f2..1250a3c23 160000 --- a/modules/normativeTypes +++ b/modules/normativeTypes @@ -1 +1 @@ -Subproject commit 7a2d264f2cb107bfd10adb23bc2b73d8323a79e4 +Subproject commit 1250a3c236f0aa92e0b5bd73647fd71d8a09360d diff --git a/modules/pvAccess b/modules/pvAccess index 7746ea3c6..96061ca1c 160000 --- a/modules/pvAccess +++ b/modules/pvAccess @@ -1 +1 @@ -Subproject commit 7746ea3c6c366f7bf3a949613a77c9e4c7f7f2dd +Subproject commit 96061ca1cc6d0e101b0033635396a8e6b6add68c diff --git a/modules/pvData b/modules/pvData index 7300e6b0b..0ef8a3617 160000 --- a/modules/pvData +++ b/modules/pvData @@ -1 +1 @@ -Subproject commit 7300e6b0bd560c0ea2355c64ea3a88c259f90fe2 +Subproject commit 0ef8a361721bc4972743a9c9a0112f441ba36b0f diff --git a/modules/pvDatabase b/modules/pvDatabase index d18e0c913..e4cb8d239 160000 --- a/modules/pvDatabase +++ b/modules/pvDatabase @@ -1 +1 @@ -Subproject commit d18e0c913a8d5a8d42cbf2d5ec28ffd362897809 +Subproject commit e4cb8d23973723d8d943bd86bc0213da2bd53eff diff --git a/modules/pva2pva b/modules/pva2pva index 949b3f63c..3a08da445 160000 --- a/modules/pva2pva +++ b/modules/pva2pva @@ -1 +1 @@ -Subproject commit 949b3f63c2387bb92c1c22ca2f80f8d320805117 +Subproject commit 3a08da445b46e2e7029406d24425cdd3dfd7da24 diff --git a/modules/pvaClient b/modules/pvaClient index 8ed07fef9..a34876e36 160000 --- a/modules/pvaClient +++ b/modules/pvaClient @@ -1 +1 @@ -Subproject commit 8ed07fef96e41d35d47ab61276e29eb1a81e7fec +Subproject commit a34876e36a56c9de9b172d6a83a9439bb330783d From d0d15ee911107be091dbdaa340281d72d021a6b7 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 8 Jun 2024 21:58:12 -0500 Subject: [PATCH 28/46] Replace UNRELEASED with 7.0.8.1 --- modules/database/src/ioc/dbStatic/dbBase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/database/src/ioc/dbStatic/dbBase.h b/modules/database/src/ioc/dbStatic/dbBase.h index f0a954b50..9578d1fac 100644 --- a/modules/database/src/ioc/dbStatic/dbBase.h +++ b/modules/database/src/ioc/dbStatic/dbBase.h @@ -119,7 +119,7 @@ typedef struct dbRecordNode { ELLLIST infoList; /*LIST head of info nodes*/ int flags; /** Parse order of this record() - * @since UNRELEASED + * @since 7.0.8.1 */ unsigned order; struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */ @@ -189,7 +189,7 @@ typedef struct dbBase { short ignoreMissingMenus; short loadCdefs; /** Total number of records. - * @since UNRELEASED + * @since 7.0.8.1 */ unsigned no_records; }dbBase; From 785b777baf859c48026c415ced3bbd46aec17f99 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 8 Jun 2024 22:30:01 -0500 Subject: [PATCH 29/46] Update Release Notes, set version numbers --- configure/CONFIG_BASE_VERSION | 2 +- configure/CONFIG_CA_VERSION | 2 +- configure/CONFIG_DATABASE_VERSION | 2 +- configure/CONFIG_LIBCOM_VERSION | 2 +- documentation/RELEASE_NOTES.md | 42 +++++++++++++++++++++++++++-- documentation/ReleaseChecklist.html | 14 +++++----- 6 files changed, 51 insertions(+), 13 deletions(-) diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION index 7972433a1..78e75be79 100644 --- a/configure/CONFIG_BASE_VERSION +++ b/configure/CONFIG_BASE_VERSION @@ -56,7 +56,7 @@ EPICS_PATCH_LEVEL = 1 # Immediately after an official release the EPICS_PATCH_LEVEL is incremented # and the -DEV suffix is added (similar to the Maven -SNAPSHOT versions) -EPICS_DEV_SNAPSHOT=-DEV +EPICS_DEV_SNAPSHOT= # No changes should be needed below here diff --git a/configure/CONFIG_CA_VERSION b/configure/CONFIG_CA_VERSION index 2cff78816..54d24a22b 100644 --- a/configure/CONFIG_CA_VERSION +++ b/configure/CONFIG_CA_VERSION @@ -6,7 +6,7 @@ EPICS_CA_MAINTENANCE_VERSION = 4 # Development flag, set to zero for release versions -EPICS_CA_DEVELOPMENT_FLAG = 1 +EPICS_CA_DEVELOPMENT_FLAG = 0 # Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/configure/CONFIG_DATABASE_VERSION b/configure/CONFIG_DATABASE_VERSION index 8815d2d1e..8ee2abff6 100644 --- a/configure/CONFIG_DATABASE_VERSION +++ b/configure/CONFIG_DATABASE_VERSION @@ -6,7 +6,7 @@ EPICS_DATABASE_MAINTENANCE_VERSION = 1 # Development flag, set to zero for release versions -EPICS_DATABASE_DEVELOPMENT_FLAG = 1 +EPICS_DATABASE_DEVELOPMENT_FLAG = 0 # Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/configure/CONFIG_LIBCOM_VERSION b/configure/CONFIG_LIBCOM_VERSION index 4aab82a17..8be90d9c8 100644 --- a/configure/CONFIG_LIBCOM_VERSION +++ b/configure/CONFIG_LIBCOM_VERSION @@ -6,7 +6,7 @@ EPICS_LIBCOM_MAINTENANCE_VERSION = 1 # Development flag, set to zero for release versions -EPICS_LIBCOM_DEVELOPMENT_FLAG = 1 +EPICS_LIBCOM_DEVELOPMENT_FLAG = 0 # Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index c66a44c66..8cad1a544 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -18,9 +18,20 @@ should also be read to understand what has changed since earlier releases: - [pva2pva](https://epics-base.github.io/pva2pva/release_notes.html) - [pvaClient](https://github.com/epics-base/pvaClientCPP/blob/master/documentation/RELEASE_NOTES.md) -**This version of EPICS has not been released yet.** +## EPICS Release 7.0.8.1 -## Changes made on the 7.0 branch since 7.0.8 +### Limit to `_FORTIFY_SOURCE=2` + +GCC versions 12 and beyond and glibc have added some aggressive runtime +checks for buffer overflows in libc functions at runtime, and the +[Ubuntu 2024.04](https://wiki.ubuntu.com/ToolChain/CompilerFlags) release +increased their default gcc fortification level from 2 to 3. +This has started causing EPICS Base builds to fail on that version, and +other OS releases may make that configuration change with similar results. +This release detects a compiler configured with `_FORTIFY_SOURCE=3` and +overrides it to 2. +Later releases of Base will adjust the code, providing information to the +compiler to avoid triggering these incorrect protections. ### Fix issue with compress record @@ -28,6 +39,33 @@ In Base 7.0.8, an update to the compress record was added to allow for certain algorithms to use partially filled buffers in their computations. Unfortunately, this broke the behaviour of the records in certain cases. This has been fixed. +### Various minor changes + +These included fixing minor memory leaks and documentation corrections. The +`SIZV` field of lsi, lso and printf record VAL fields now can't exceed 32767 +characters, to match an internal limit. + +### `epicsSocketAccept()` now returns `SOCKET`, not `int` + +This might have some effect on downstream modules still using `int`, but the +OS-specific osdSock.h headers which osiSock.h includes have all declared +`SOCKET` (in most casese as a typedef for `int`) for many releases. +This change removes a compiler warning on WIN32. +Further details and the discussion about this change can be found +[here](https://github.com/epics-base/epics-base/pull/458). + +### `dbLoadRecords` allows macros with default values + +Previously the parser assumed that files containing macro substitutions were +bad if no macro definitions were provided; that assumption was made incorrect +once macro substitutions were allowed to provide a default value. + +### Hostname length limit in CA removed + +Before this release, the CA client library only handled hostnames in address +list environment variables up to 255 characters long. +This limit has been removed. + ----- ## EPICS Release 7.0.8 diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html index 0db98a818..77fe6c7a9 100644 --- a/documentation/ReleaseChecklist.html +++ b/documentation/ReleaseChecklist.html @@ -198,7 +198,7 @@ everything that has to be done since it's so easy to miss steps.

  • Tag the module:
    - git tag -m 'ANJ: Tag for EPICS 7.0.8' <module-version> + git tag -m 'ANJ: Tag for EPICS 7.0.8.1' <module-version>
  • @@ -269,7 +269,7 @@ everything that has to be done since it's so easy to miss steps.

    Tag the epics-base module in Git:
    cd base-7.0
    - git tag -m 'ANJ: Tagged for release' R7.0.8 + git tag -m 'ANJ: Tagged for release' R7.0.8.1

    Don't push to GitHub yet.

    @@ -303,12 +303,12 @@ everything that has to be done since it's so easy to miss steps.

    files and directories that are only used for continuous integration:
    cd base-7.0
    - ./.tools/make-tar.sh R7.0.8 ../base-7.0.8.tar.gz base-7.0.8/ + ./.tools/make-tar.sh R7.0.8.1 ../base-7.0.8.1.tar.gz base-7.0.8.1/
    Create a GPG signature file of the tarfile as follows:
    cd ..
    - gpg --armor --sign --detach-sig base-7.0.8.tar.gz + gpg --armor --sign --detach-sig base-7.0.8.1.tar.gz
    @@ -374,7 +374,7 @@ everything that has to be done since it's so easy to miss steps.

    Upload the tar file and its .asc signature file to the epics-controls web-server.
    - scp base-7.0.8.tar.gz base-7.0.8.tar.gz.asc epics-controls:download/base
    + scp base-7.0.8.1.tar.gz base-7.0.8.1.tar.gz.asc epics-controls:download/base
    @@ -397,8 +397,8 @@ everything that has to be done since it's so easy to miss steps.

    Release Manager Go to the GitHub - - Create release from tag R7.0.8 page. + + Create release from tag R7.0.8.1 page. Upload the tar file and its .asc signature file to the new GitHub release page. From 57c930fbee53b3ca8ab4e8b5461c54f1518f9676 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 8 Jun 2024 22:34:41 -0500 Subject: [PATCH 30/46] Release R7.0.8.1 From 615e7e99ce3ca6ff8f067fe6b648e677ea37a6ff Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 8 Jun 2024 23:05:39 -0500 Subject: [PATCH 31/46] Update version numbers and submodules after release --- configure/CONFIG_BASE_VERSION | 4 ++-- configure/CONFIG_CA_VERSION | 4 ++-- configure/CONFIG_DATABASE_VERSION | 4 ++-- configure/CONFIG_LIBCOM_VERSION | 4 ++-- documentation/RELEASE_NOTES.md | 7 +++++++ modules/normativeTypes | 2 +- modules/pvAccess | 2 +- modules/pvData | 2 +- modules/pvDatabase | 2 +- modules/pva2pva | 2 +- modules/pvaClient | 2 +- 11 files changed, 21 insertions(+), 14 deletions(-) diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION index 78e75be79..e48336bf8 100644 --- a/configure/CONFIG_BASE_VERSION +++ b/configure/CONFIG_BASE_VERSION @@ -52,11 +52,11 @@ EPICS_MODIFICATION = 8 # EPICS_PATCH_LEVEL must be a number (win32 resource file requirement) # Not included in the official EPICS version number if zero -EPICS_PATCH_LEVEL = 1 +EPICS_PATCH_LEVEL = 2 # Immediately after an official release the EPICS_PATCH_LEVEL is incremented # and the -DEV suffix is added (similar to the Maven -SNAPSHOT versions) -EPICS_DEV_SNAPSHOT= +EPICS_DEV_SNAPSHOT=-DEV # No changes should be needed below here diff --git a/configure/CONFIG_CA_VERSION b/configure/CONFIG_CA_VERSION index 54d24a22b..d565e7ce1 100644 --- a/configure/CONFIG_CA_VERSION +++ b/configure/CONFIG_CA_VERSION @@ -2,11 +2,11 @@ EPICS_CA_MAJOR_VERSION = 4 EPICS_CA_MINOR_VERSION = 14 -EPICS_CA_MAINTENANCE_VERSION = 4 +EPICS_CA_MAINTENANCE_VERSION = 5 # Development flag, set to zero for release versions -EPICS_CA_DEVELOPMENT_FLAG = 0 +EPICS_CA_DEVELOPMENT_FLAG = 1 # Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/configure/CONFIG_DATABASE_VERSION b/configure/CONFIG_DATABASE_VERSION index 8ee2abff6..b770ea72a 100644 --- a/configure/CONFIG_DATABASE_VERSION +++ b/configure/CONFIG_DATABASE_VERSION @@ -2,11 +2,11 @@ EPICS_DATABASE_MAJOR_VERSION = 3 EPICS_DATABASE_MINOR_VERSION = 23 -EPICS_DATABASE_MAINTENANCE_VERSION = 1 +EPICS_DATABASE_MAINTENANCE_VERSION = 2 # Development flag, set to zero for release versions -EPICS_DATABASE_DEVELOPMENT_FLAG = 0 +EPICS_DATABASE_DEVELOPMENT_FLAG = 1 # Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/configure/CONFIG_LIBCOM_VERSION b/configure/CONFIG_LIBCOM_VERSION index 8be90d9c8..bb5c55904 100644 --- a/configure/CONFIG_LIBCOM_VERSION +++ b/configure/CONFIG_LIBCOM_VERSION @@ -2,11 +2,11 @@ EPICS_LIBCOM_MAJOR_VERSION = 3 EPICS_LIBCOM_MINOR_VERSION = 23 -EPICS_LIBCOM_MAINTENANCE_VERSION = 1 +EPICS_LIBCOM_MAINTENANCE_VERSION = 2 # Development flag, set to zero for release versions -EPICS_LIBCOM_DEVELOPMENT_FLAG = 0 +EPICS_LIBCOM_DEVELOPMENT_FLAG = 1 # Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 8cad1a544..fc535d0d8 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -18,6 +18,13 @@ should also be read to understand what has changed since earlier releases: - [pva2pva](https://epics-base.github.io/pva2pva/release_notes.html) - [pvaClient](https://github.com/epics-base/pvaClientCPP/blob/master/documentation/RELEASE_NOTES.md) +**This version of EPICS has not been released yet.** + +## Changes made on the 7.0 branch since 7.0.8.1 + + +----- + ## EPICS Release 7.0.8.1 ### Limit to `_FORTIFY_SOURCE=2` diff --git a/modules/normativeTypes b/modules/normativeTypes index 1250a3c23..7a2d264f2 160000 --- a/modules/normativeTypes +++ b/modules/normativeTypes @@ -1 +1 @@ -Subproject commit 1250a3c236f0aa92e0b5bd73647fd71d8a09360d +Subproject commit 7a2d264f2cb107bfd10adb23bc2b73d8323a79e4 diff --git a/modules/pvAccess b/modules/pvAccess index 96061ca1c..f1268adb8 160000 --- a/modules/pvAccess +++ b/modules/pvAccess @@ -1 +1 @@ -Subproject commit 96061ca1cc6d0e101b0033635396a8e6b6add68c +Subproject commit f1268adb8ecbacbd74bb66c172d02d9d427bedfd diff --git a/modules/pvData b/modules/pvData index 0ef8a3617..144f0228c 160000 --- a/modules/pvData +++ b/modules/pvData @@ -1 +1 @@ -Subproject commit 0ef8a361721bc4972743a9c9a0112f441ba36b0f +Subproject commit 144f0228cc412d2dc1eaad7e09e310697d18532f diff --git a/modules/pvDatabase b/modules/pvDatabase index e4cb8d239..f207e512d 160000 --- a/modules/pvDatabase +++ b/modules/pvDatabase @@ -1 +1 @@ -Subproject commit e4cb8d23973723d8d943bd86bc0213da2bd53eff +Subproject commit f207e512d67addab79e33a00b712e3444228ba7c diff --git a/modules/pva2pva b/modules/pva2pva index 3a08da445..949b3f63c 160000 --- a/modules/pva2pva +++ b/modules/pva2pva @@ -1 +1 @@ -Subproject commit 3a08da445b46e2e7029406d24425cdd3dfd7da24 +Subproject commit 949b3f63c2387bb92c1c22ca2f80f8d320805117 diff --git a/modules/pvaClient b/modules/pvaClient index a34876e36..8ed07fef9 160000 --- a/modules/pvaClient +++ b/modules/pvaClient @@ -1 +1 @@ -Subproject commit a34876e36a56c9de9b172d6a83a9439bb330783d +Subproject commit 8ed07fef96e41d35d47ab61276e29eb1a81e7fec From 91e1d0ab8022d610bb12b5536a7a6a21644d47f7 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 27 Jun 2024 22:20:19 -0500 Subject: [PATCH 32/46] Update release process files --- .gitattributes | 14 +++++---- .tools/make-tar.sh | 15 ++++----- documentation/ReleaseChecklist.html | 47 ++++++++++++++++++++--------- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/.gitattributes b/.gitattributes index 5221674ea..8162ae0f2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,11 @@ -.ci/ export-ignore -.tools/ export-ignore -.github/ export-ignore -.appveyor/ export-ignore -.appveyor.yml export-ignore -README export-subst +.appveyor.yml export-ignore +.appveyor/ export-ignore +.ci/ export-ignore +.github/ export-ignore +.gitmodules export-ignore +.readthedocs.yml export-ignore +.tools/ export-ignore +README export-subst #Which files need CRLF handling # default to automatic diff --git a/.tools/make-tar.sh b/.tools/make-tar.sh index 276d8e204..f018d9e8f 100755 --- a/.tools/make-tar.sh +++ b/.tools/make-tar.sh @@ -136,19 +136,20 @@ sed -i -e 's|^\./||' "$TDIR"/list.1 # Exclude files sed \ - -e '/\/\.ci\//d' \ + -e '/\/\.appveyor\.yml$/d' \ + -e '/\/\.appveyor\//d' \ -e '/\/\.ci-local\//d' \ - -e '/\/\.tools\//d' \ - -e '/\/jenkins\//d' \ + -e '/\/\.ci\//d' \ + -e '/\/\.cproject$/d' \ -e '/\/\.github\//d' \ -e '/\/\.gitmodules$/d' \ -e '/\/\.hgtags$/d' \ - -e '/\/\.cproject$/d' \ - -e '/\/\.project$/d' \ -e '/\/\.lgtm\.yml$/d' \ - -e '/\/\.travis\.yml$/d' \ - -e '/\/\.appveyor\.yml$/d' \ + -e '/\/\.project$/d' \ -e '/\/\.readthedocs\.yml$/d' \ + -e '/\/\.tools\//d' \ + -e '/\/\.travis\.yml$/d' \ + -e '/\/jenkins\//d' \ "$TDIR"/list.1 > "$TDIR"/list.2 if ! diff -U 0 "$TDIR"/list.1 "$TDIR"/list.2 diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html index 77fe6c7a9..40f6d5808 100644 --- a/documentation/ReleaseChecklist.html +++ b/documentation/ReleaseChecklist.html @@ -179,14 +179,10 @@ everything that has to be done since it's so easy to miss steps.

  • git grep UNRELEASED and insert the module version to any doxygen annotations that have a @since UNRELEASED comment. Commit (don't push yet).
  • +
  • Check that the module's Release Notes have been updated to cover all changes; add items as necessary, and set the module version - number and release date if appropriate. Convert to HTML and view in - a browser to check the formatting: -
    - cd base-7.0/modules/<module>/documentation
    - pandoc -f gfm -t html -o RELEASE_NOTES.html RELEASE_NOTES.md -
    + number and release date if appropriate. Commit these changes (don't push).
  • Edit the module's release version file @@ -194,14 +190,37 @@ everything that has to be done since it's so easy to miss steps.

    Doxyfiles in the top-level and/or documentation directories. In these, set DEVELOPMENT_FLAG to 0 and remove -dev from the PROJECT_NUMBER string. Commit these - changes (don't push).
  • + changes (don't push): +
    + git ci -m 'Final commit for <module-version>' +
    +
  • Tag the module:
    - git tag -m 'ANJ: Tag for EPICS 7.0.8.1' <module-version> + git tag -m 'ANJ: Tag for EPICS 7.0.8.2' <module-version>
  • +
  • Generate documentation or Release Notes using one of these: +
      +
    • For older modules with a RELEASE_NOTES.md file convert it to + HTML and view in a browser to check the formatting as follows: +
      + cd base-7.0/modules/<module>/documentation
      + pandoc -f gfm -t html -o RELEASE_NOTES.html RELEASE_NOTES.md +
      + +
    • For newer modules with release_notes.dox file, generate the + new github-pages website as follows: +
      + cd base-7.0/modules/<module>/documentation
      + make commit + git push --force upstream gh-pages +
      + Q: Delay this git push until later?
    • +
  • +
  • Update the git submodule on the Base-7.0 branch to the newly-tagged version, check the module's status matches the tag:
    @@ -269,7 +288,7 @@ everything that has to be done since it's so easy to miss steps.

    Tag the epics-base module in Git:
    cd base-7.0
    - git tag -m 'ANJ: Tagged for release' R7.0.8.1 + git tag -m 'ANJ: Tagged for release' R7.0.8.2

    Don't push to GitHub yet.

    @@ -303,12 +322,12 @@ everything that has to be done since it's so easy to miss steps.

    files and directories that are only used for continuous integration:
    cd base-7.0
    - ./.tools/make-tar.sh R7.0.8.1 ../base-7.0.8.1.tar.gz base-7.0.8.1/ + ./.tools/make-tar.sh R7.0.8.2 ../base-7.0.8.2.tar.gz base-7.0.8.2/
    Create a GPG signature file of the tarfile as follows:
    cd ..
    - gpg --armor --sign --detach-sig base-7.0.8.1.tar.gz + gpg --armor --sign --detach-sig base-7.0.8.2.tar.gz
    @@ -374,7 +393,7 @@ everything that has to be done since it's so easy to miss steps.

    Upload the tar file and its .asc signature file to the epics-controls web-server.
    - scp base-7.0.8.1.tar.gz base-7.0.8.1.tar.gz.asc epics-controls:download/base
    + scp base-7.0.8.2.tar.gz base-7.0.8.2.tar.gz.asc epics-controls:download/base
    @@ -397,8 +416,8 @@ everything that has to be done since it's so easy to miss steps.

    Release Manager Go to the GitHub - - Create release from tag R7.0.8.1 page. + + Create release from tag R7.0.8.2 page. Upload the tar file and its .asc signature file to the new GitHub release page. From 23999a106b1336a0b2b4596c4bf6cc69fc7ed7ea Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 6 Aug 2024 14:29:30 +0200 Subject: [PATCH 33/46] use -nologo with rc like with many other MSVC commands --- configure/os/CONFIG.win32-x86.win32-x86 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86 index 767f4c7fa..d45a48041 100644 --- a/configure/os/CONFIG.win32-x86.win32-x86 +++ b/configure/os/CONFIG.win32-x86.win32-x86 @@ -16,7 +16,7 @@ OPT_WHOLE_PROGRAM = YES WINLINK = link -RCCMD = rc -l 0x409 $(INCLUDES) -fo $@ $< +RCCMD = rc -nologo -l 0x409 $(INCLUDES) -fo $@ $< ARCMD = lib -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS) From 785237e41a4b906b9505432b4dd444f04f92f0a9 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 24 Dec 2023 17:41:30 +0000 Subject: [PATCH 34/46] Remove duplicate link libraries --- modules/ca/src/client/Makefile | 1 - modules/database/src/ioc/as/Makefile | 2 +- modules/database/src/ioc/dbtemplate/Makefile | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/ca/src/client/Makefile b/modules/ca/src/client/Makefile index 08394ea54..e80e0adfc 100644 --- a/modules/ca/src/client/Makefile +++ b/modules/ca/src/client/Makefile @@ -118,7 +118,6 @@ EXPAND_VARS = INSTALL_BIN=$(FINAL_LOCATION)/bin/$(T_A) SRC_DIRS += $(CURDIR)/test PROD_HOST += ca_test ca_test_SRCS = ca_test_main.c ca_test.c -ca_test_LIBS = ca Com ca_test_SYS_LIBS_WIN32 = ws2_32 advapi32 user32 OBJS_vxWorks += ca_test diff --git a/modules/database/src/ioc/as/Makefile b/modules/database/src/ioc/as/Makefile index bef8637e5..25237c26c 100644 --- a/modules/database/src/ioc/as/Makefile +++ b/modules/database/src/ioc/as/Makefile @@ -23,4 +23,4 @@ dbCore_SRCS += asIocRegister.c PROD_HOST += ascheck ascheck_SRCS = ascheck.c -ascheck_LIBS = dbCore ca Com +ascheck_LIBS = dbCore ca diff --git a/modules/database/src/ioc/dbtemplate/Makefile b/modules/database/src/ioc/dbtemplate/Makefile index 13b4f11fb..bba83e3fe 100644 --- a/modules/database/src/ioc/dbtemplate/Makefile +++ b/modules/database/src/ioc/dbtemplate/Makefile @@ -14,7 +14,6 @@ SRC_DIRS += $(IOCDIR)/dbtemplate PROD_HOST += msi msi_SRCS = msi.cpp -msi_LIBS += Com HTMLS += msi.html INC += dbLoadTemplate.h From f287cfa2ac619e166ea7dd6c2bbd0e746fb7deaa Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 24 Dec 2023 17:50:09 +0000 Subject: [PATCH 35/46] Introduce & use FASTCONVERTFUNC with full prototype --- modules/database/src/ioc/db/dbConvertFast.h | 7 +++++-- modules/database/src/ioc/db/dbConvertJSON.c | 6 ++---- modules/database/src/ioc/db/dbFastLinkConv.c | 4 ++-- modules/database/src/ioc/dbStatic/link.h | 6 +++--- modules/database/src/std/link/lnkCalc.c | 6 ++---- modules/database/src/std/link/lnkConst.c | 4 +--- modules/database/src/std/link/lnkState.c | 4 +--- modules/database/test/ioc/db/jlinkz.c | 9 ++++----- 8 files changed, 20 insertions(+), 26 deletions(-) diff --git a/modules/database/src/ioc/db/dbConvertFast.h b/modules/database/src/ioc/db/dbConvertFast.h index 7ab630b91..0980b6b19 100644 --- a/modules/database/src/ioc/db/dbConvertFast.h +++ b/modules/database/src/ioc/db/dbConvertFast.h @@ -14,13 +14,16 @@ #include "dbFldTypes.h" #include "dbCoreAPI.h" +#include "link.h" #ifdef __cplusplus extern "C" { #endif -DBCORE_API extern long (*dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1])(); -DBCORE_API extern long (*dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1])(); +/* typedef FASTCONVERTFUNC is now defined in link.h */ + +DBCORE_API extern FASTCONVERTFUNC dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1]; +DBCORE_API extern FASTCONVERTFUNC dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1]; #ifdef __cplusplus } diff --git a/modules/database/src/ioc/db/dbConvertJSON.c b/modules/database/src/ioc/db/dbConvertJSON.c index 95f944e2b..ce3f5bbed 100644 --- a/modules/database/src/ioc/db/dbConvertJSON.c +++ b/modules/database/src/ioc/db/dbConvertJSON.c @@ -19,8 +19,6 @@ #include "dbConvertFast.h" #include "dbConvertJSON.h" -typedef long (*FASTCONVERT)(); - typedef struct parseContext { int depth; short dbrType; @@ -42,7 +40,7 @@ static int dbcj_boolean(void *ctx, int val) { static int dbcj_integer(void *ctx, long long num) { parseContext *parser = (parseContext *) ctx; epicsInt64 val64 = num; - FASTCONVERT conv = dbFastPutConvertRoutine[DBF_INT64][parser->dbrType]; + FASTCONVERTFUNC conv = dbFastPutConvertRoutine[DBF_INT64][parser->dbrType]; if (parser->elems > 0) { conv(&val64, parser->pdest, NULL); @@ -54,7 +52,7 @@ static int dbcj_integer(void *ctx, long long num) { static int dbcj_double(void *ctx, double num) { parseContext *parser = (parseContext *) ctx; - FASTCONVERT conv = dbFastPutConvertRoutine[DBF_DOUBLE][parser->dbrType]; + FASTCONVERTFUNC conv = dbFastPutConvertRoutine[DBF_DOUBLE][parser->dbrType]; if (parser->elems > 0) { conv(&num, parser->pdest, NULL); diff --git a/modules/database/src/ioc/db/dbFastLinkConv.c b/modules/database/src/ioc/db/dbFastLinkConv.c index 39cddce5f..a3590e348 100644 --- a/modules/database/src/ioc/db/dbFastLinkConv.c +++ b/modules/database/src/ioc/db/dbFastLinkConv.c @@ -1399,7 +1399,7 @@ static long cvt_device_st( * NULL implies the conversion is not supported. */ -long (*dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1])() = { +FASTCONVERTFUNC dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = { /* Convert DBF_STRING to ... */ { cvt_st_st, cvt_st_c, cvt_st_uc, cvt_st_s, cvt_st_us, cvt_st_l, cvt_st_ul, cvt_st_q, cvt_st_uq, cvt_st_f, cvt_st_d, cvt_st_e }, @@ -1455,7 +1455,7 @@ long (*dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1])() = { * NULL implies the conversion is not supported. */ -long (*dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1])() = { +FASTCONVERTFUNC dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1] = { /* Convert DBR_STRING to ... */ { cvt_st_st, cvt_st_c, cvt_st_uc, cvt_st_s, cvt_st_us, cvt_st_l, cvt_st_ul, cvt_st_q, cvt_st_uq, cvt_st_f, cvt_st_d, cvt_st_e, cvt_st_menu, cvt_st_device}, diff --git a/modules/database/src/ioc/dbStatic/link.h b/modules/database/src/ioc/dbStatic/link.h index 6488e8caa..35f805ccf 100644 --- a/modules/database/src/ioc/dbStatic/link.h +++ b/modules/database/src/ioc/dbStatic/link.h @@ -77,14 +77,14 @@ struct macro_link { char *macroStr; }; -struct dbCommon; -typedef long (*LINKCVT)(); +struct dbAddr; +typedef long (*FASTCONVERTFUNC)(const void *from, void *to, const struct dbAddr *paddr); struct pv_link { ELLNODE backlinknode; char *pvname; /* pvname link points to */ void *pvt; /* CA or DB private */ - LINKCVT getCvt; /* input conversion function */ + FASTCONVERTFUNC getCvt; /* input conversion function */ short pvlMask; /* Options mask */ short lastGetdbrType; /* last dbrType for DB or CA get */ }; diff --git a/modules/database/src/std/link/lnkCalc.c b/modules/database/src/std/link/lnkCalc.c index 46655850e..ed5796f8a 100644 --- a/modules/database/src/std/link/lnkCalc.c +++ b/modules/database/src/std/link/lnkCalc.c @@ -36,8 +36,6 @@ #include "epicsExport.h" -typedef long (*FASTCONVERT)(); - typedef struct calc_link { jlink jlink; /* embedded object */ int nArgs; @@ -558,7 +556,7 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer, dbCommon *prec = plink->precord; int i; long status; - FASTCONVERT conv; + FASTCONVERTFUNC conv; if(INVALID_DB_REQ(dbrType)) return S_db_badDbrtype; @@ -638,7 +636,7 @@ static long lnkCalc_putValue(struct link *plink, short dbrType, dbCommon *prec = plink->precord; int i; long status; - FASTCONVERT conv; + FASTCONVERTFUNC conv; if(INVALID_DB_REQ(dbrType)) return S_db_badDbrtype; diff --git a/modules/database/src/std/link/lnkConst.c b/modules/database/src/std/link/lnkConst.c index 4374672f1..24158ef12 100644 --- a/modules/database/src/std/link/lnkConst.c +++ b/modules/database/src/std/link/lnkConst.c @@ -23,8 +23,6 @@ #include "epicsExport.h" -typedef long (*FASTCONVERT)(); - typedef struct const_link { jlink jlink; /* embedded object */ int nElems; @@ -458,7 +456,7 @@ static long lnkConst_loadArray(struct link *plink, short dbrType, void *pbuffer, short dbrSize; char *pdest = pbuffer; int nElems = clink->nElems; - FASTCONVERT conv; + FASTCONVERTFUNC conv; long status; if(INVALID_DB_REQ(dbrType)) diff --git a/modules/database/src/std/link/lnkState.c b/modules/database/src/std/link/lnkState.c index 588214a43..931e2d49f 100644 --- a/modules/database/src/std/link/lnkState.c +++ b/modules/database/src/std/link/lnkState.c @@ -34,8 +34,6 @@ #include "epicsExport.h" -typedef long (*FASTCONVERT)(); - typedef struct state_link { jlink jlink; /* embedded object */ char *name; @@ -143,7 +141,7 @@ static long lnkState_getValue(struct link *plink, short dbrType, void *pbuffer, { state_link *slink = CONTAINER(plink->value.json.jlink, struct state_link, jlink); - FASTCONVERT conv; + FASTCONVERTFUNC conv; if(INVALID_DB_REQ(dbrType)) return S_db_badDbrtype; diff --git a/modules/database/test/ioc/db/jlinkz.c b/modules/database/test/ioc/db/jlinkz.c index 087cc0520..50aca7789 100644 --- a/modules/database/test/ioc/db/jlinkz.c +++ b/modules/database/test/ioc/db/jlinkz.c @@ -83,13 +83,13 @@ long z_getval(struct link *plink, short dbrType, void *pbuffer, long *pnRequest) { long ret; - long (*pconv)(const epicsInt32 *, void *, const dbAddr *) = dbFastGetConvertRoutine[DBF_LONG][dbrType]; + FASTCONVERTFUNC pconv = dbFastGetConvertRoutine[DBF_LONG][dbrType]; zpriv *priv = CONTAINER(plink->value.json.jlink, zpriv, base); if(pnRequest && *pnRequest==0) return 0; epicsMutexLock(priv->lock); - ret = (*pconv)(&priv->value, pbuffer, NULL); + ret = pconv(&priv->value, pbuffer, NULL); epicsMutexUnlock(priv->lock); if(ret==0 && pnRequest) *pnRequest = 1; return ret; @@ -118,18 +118,17 @@ long z_putval(struct link *plink, short dbrType, const void *pbuffer, long nRequest) { long ret; - long (*pconv)(epicsInt32 *, const void *, const dbAddr *); zpriv *priv = CONTAINER(plink->value.json.jlink, zpriv, base); if(INVALID_DB_REQ(dbrType)) return S_db_badDbrtype; - pconv = dbFastPutConvertRoutine[DBF_LONG][dbrType]; + FASTCONVERTFUNC pconv = dbFastPutConvertRoutine[DBF_LONG][dbrType]; if(nRequest==0) return 0; epicsMutexLock(priv->lock); - ret = (*pconv)(&priv->value, pbuffer, NULL); + ret = pconv(pbuffer, &priv->value, NULL); epicsMutexUnlock(priv->lock); return ret; } From 1835187a867afed3ad51792544b4a213544571ef Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 24 Dec 2023 17:55:16 +0000 Subject: [PATCH 36/46] Change fast convert routines to match prototype Most of these edits were make using regexes in find/replace. --- modules/database/src/ioc/db/dbFastLinkConv.c | 1786 ++++++++++-------- 1 file changed, 1013 insertions(+), 773 deletions(-) diff --git a/modules/database/src/ioc/db/dbFastLinkConv.c b/modules/database/src/ioc/db/dbFastLinkConv.c index a3590e348..fc229605f 100644 --- a/modules/database/src/ioc/db/dbFastLinkConv.c +++ b/modules/database/src/ioc/db/dbFastLinkConv.c @@ -71,11 +71,10 @@ */ /* Convert String to String */ -static long cvt_st_st( - char *from, - char *to, - const dbAddr *paddr) +static long cvt_st_st(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + char *to = (char *) t; size_t size; if (paddr && paddr->field_size < MAX_STRING_SIZE) { @@ -89,11 +88,10 @@ static long cvt_st_st( } /* Convert String to Char */ -static long cvt_st_c( - char *from, - epicsInt8 *to, - const dbAddr *paddr) +static long cvt_st_c(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsInt8 *to = (epicsInt8 *) t; char *end; if (*from == 0) { @@ -104,11 +102,10 @@ static long cvt_st_c( } /* Convert String to Unsigned Char */ -static long cvt_st_uc( - char *from, - epicsUInt8 *to, - const dbAddr *paddr) +static long cvt_st_uc(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsUInt8 *to = (epicsUInt8 *) t; char *end; if (*from == 0) { @@ -119,11 +116,10 @@ static long cvt_st_uc( } /* Convert String to Short */ -static long cvt_st_s( - char *from, - epicsInt16 *to, - const dbAddr *paddr) +static long cvt_st_s(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsInt16 *to = (epicsInt16 *) t; char *end; if (*from == 0) { @@ -134,11 +130,10 @@ static long cvt_st_s( } /* Convert String to Unsigned Short */ -static long cvt_st_us( - char *from, - epicsUInt16 *to, - const dbAddr *paddr) +static long cvt_st_us(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsUInt16 *to = (epicsUInt16 *) t; char *end; if (*from == 0) { @@ -149,11 +144,10 @@ static long cvt_st_us( } /* Convert String to Long */ -static long cvt_st_l( - char *from, - epicsInt32 *to, - const dbAddr *paddr) +static long cvt_st_l(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsInt32 *to = (epicsInt32 *) t; char *end; if (*from == 0) { @@ -164,11 +158,10 @@ static long cvt_st_l( } /* Convert String to Unsigned Long */ -static long cvt_st_ul( - char *from, - epicsUInt32 *to, - const dbAddr *paddr) +static long cvt_st_ul(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsUInt32 *to = (epicsUInt32 *) t; char *end; long status; @@ -195,11 +188,10 @@ static long cvt_st_ul( } /* Convert String to Int64 */ -static long cvt_st_q( - char *from, - epicsInt64 *to, - const dbAddr *paddr) +static long cvt_st_q(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsInt64 *to = (epicsInt64 *) t; char *end; if (*from == 0) { @@ -210,11 +202,10 @@ static long cvt_st_q( } /* Convert String to UInt64 */ -static long cvt_st_uq( - char *from, - epicsUInt64 *to, - const dbAddr *paddr) +static long cvt_st_uq(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsUInt64 *to = (epicsUInt64 *) t; char *end; if (*from == 0) { @@ -225,41 +216,38 @@ static long cvt_st_uq( } /* Convert String to Float */ -static long cvt_st_f( - char *from, - epicsFloat32 *to, - const dbAddr *paddr) +static long cvt_st_f(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsFloat32 *to = (epicsFloat32 *) t; char *end; - if (*from == 0) { - *to = 0; - return 0; - } - return epicsParseFloat32(from, to, &end); + if (*from == 0) { + *to = 0; + return 0; + } + return epicsParseFloat32(from, to, &end); } /* Convert String to Double */ -static long cvt_st_d( - char *from, - epicsFloat64 *to, - const dbAddr *paddr) +static long cvt_st_d(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsFloat64 *to = (epicsFloat64 *) t; char *end; - if (*from == 0) { - *to = 0.0; - return 0; - } - return epicsParseFloat64(from, to, &end); + if (*from == 0) { + *to = 0.0; + return 0; + } + return epicsParseFloat64(from, to, &end); } /* Convert String to Enumerated */ -static long cvt_st_e( - char *from, - epicsEnum16 *to, - const dbAddr *paddr) +static long cvt_st_e(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsEnum16 *to = (epicsEnum16 *) t; rset *prset = dbGetRset(paddr); long status = S_db_noRSET; struct dbr_enumStrs enumStrs; @@ -294,11 +282,10 @@ static long cvt_st_e( } /* Convert String to Menu */ -static long cvt_st_menu( - char *from, - epicsEnum16 *to, - const dbAddr *paddr) +static long cvt_st_menu(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsEnum16 *to = (epicsEnum16 *) t; dbFldDes *pdbFldDes = paddr->pfldDes; dbMenu *pdbMenu; char **pchoices; @@ -325,15 +312,14 @@ static long cvt_st_menu( } } recGblDbaddrError(S_db_badChoice, paddr, "dbFastLinkConv(cvt_st_menu)"); - return(S_db_badChoice); + return S_db_badChoice; } /* Convert String to Device */ -static long cvt_st_device( - char *from, - epicsEnum16 *to, - const dbAddr *paddr) +static long cvt_st_device(const void *f, void *t, const dbAddr *paddr) { + const char *from = (const char *) f; + epicsEnum16 *to = (epicsEnum16 *) t; dbFldDes *pdbFldDes = paddr->pfldDes; dbDeviceMenu *pdbDeviceMenu = pdbFldDes->ftPvt; char **pchoices, *pchoice; @@ -363,979 +349,1234 @@ static long cvt_st_device( } /* Convert Char to String */ -static long cvt_c_st( - epicsInt8 *from, - char *to, - const dbAddr *paddr) -{ cvtCharToString(*from, to); return(0); } +static long cvt_c_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + char *to = (char *) t; + cvtCharToString(*from, to); + return 0; +} /* Convert Char to Char */ -static long cvt_c_c( - epicsInt8 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=*from; + return 0; +} /* Convert Char to Unsigned Char */ -static long cvt_c_uc( - epicsInt8 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=*from; + return 0; +} /* Convert Char to Short */ -static long cvt_c_s( - epicsInt8 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Char to Unsigned Short */ -static long cvt_c_us( - epicsInt8 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Char to Long */ -static long cvt_c_l( - epicsInt8 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Char to Unsigned Long */ -static long cvt_c_ul( - epicsInt8 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Char to Int64 */ -static long cvt_c_q( - epicsInt8 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Char to UInt64 */ -static long cvt_c_uq( - epicsInt8 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Char to Float */ -static long cvt_c_f( - epicsInt8 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Char to Double */ -static long cvt_c_d( - epicsInt8 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Char to Enumerated */ -static long cvt_c_e( - epicsInt8 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_c_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt8 *from = (const epicsInt8 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to String */ -static long cvt_uc_st( - epicsUInt8 *from, - char *to, - const dbAddr *paddr) -{ cvtUcharToString(*from, to); return(0); } +static long cvt_uc_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + char *to = (char *) t; + cvtUcharToString(*from, to); + return 0; +} /* Convert Unsigned Char to Char */ -static long cvt_uc_c( - epicsUInt8 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Unsigned Char */ -static long cvt_uc_uc( - epicsUInt8 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Short */ -static long cvt_uc_s( - epicsUInt8 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Unsigned Short */ -static long cvt_uc_us( - epicsUInt8 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Long */ -static long cvt_uc_l( - epicsUInt8 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Unsigned Long */ -static long cvt_uc_ul( - epicsUInt8 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Int64 */ -static long cvt_uc_q( - epicsUInt8 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to UInt64 */ -static long cvt_uc_uq( - epicsUInt8 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Float */ -static long cvt_uc_f( - epicsUInt8 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Double */ -static long cvt_uc_d( - epicsUInt8 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Char to Enumerated */ -static long cvt_uc_e( - epicsUInt8 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uc_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt8 *from = (const epicsUInt8 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Short to String */ -static long cvt_s_st( - epicsInt16 *from, - char *to, - const dbAddr *paddr) -{ cvtShortToString(*from, to); return(0); } +static long cvt_s_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + char *to = (char *) t; + cvtShortToString(*from, to); + return 0; +} /* Convert Short to Char */ -static long cvt_s_c( - epicsInt16 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=(epicsInt8)*from; return(0); } +static long cvt_s_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=(epicsInt8)*from; + return 0; +} /* Convert Short to Unsigned Char */ -static long cvt_s_uc( - epicsInt16 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=(epicsUInt8)*from; return(0); } +static long cvt_s_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=(epicsUInt8)*from; + return 0; +} /* Convert Short to Short */ -static long cvt_s_s( - epicsInt16 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Short to Unsigned Short */ -static long cvt_s_us( - epicsInt16 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Short to Long */ -static long cvt_s_l( - epicsInt16 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Short to Unsigned Long */ -static long cvt_s_ul( - epicsInt16 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Short to Int64 */ -static long cvt_s_q( - epicsInt16 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Short to UInt64 */ -static long cvt_s_uq( - epicsInt16 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Short to Float */ -static long cvt_s_f( - epicsInt16 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Short to Double */ -static long cvt_s_d( - epicsInt16 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Short to Enumerated */ -static long cvt_s_e( - epicsInt16 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_s_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt16 *from = (const epicsInt16 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to String */ -static long cvt_us_st( - epicsUInt16 *from, - char *to, - const dbAddr *paddr) -{ cvtUshortToString(*from, to); return(0); } +static long cvt_us_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + char *to = (char *) t; + cvtUshortToString(*from, to); + return 0; +} /* Convert Unsigned Short to Char */ -static long cvt_us_c( - epicsUInt16 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=(epicsInt8)*from; return(0); } +static long cvt_us_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=(epicsInt8)*from; + return 0; +} /* Convert Unsigned Short to Unsigned Char */ -static long cvt_us_uc( - epicsUInt16 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=(epicsUInt8)*from; return(0); } +static long cvt_us_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=(epicsUInt8)*from; + return 0; +} /* Convert Unsigned Short to Short */ -static long cvt_us_s( - epicsUInt16 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Unsigned Short */ -static long cvt_us_us( - epicsUInt16 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Long */ -static long cvt_us_l( - epicsUInt16 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Unsigned Long */ -static long cvt_us_ul( - epicsUInt16 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Int64 */ -static long cvt_us_q( - epicsUInt16 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to UInt64 */ -static long cvt_us_uq( - epicsUInt16 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Float */ -static long cvt_us_f( - epicsUInt16 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Double */ -static long cvt_us_d( - epicsUInt16 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Short to Enumerated */ -static long cvt_us_e( - epicsUInt16 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_us_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt16 *from = (const epicsUInt16 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Long to String */ -static long cvt_l_st( - epicsInt32 *from, - char *to, - const dbAddr *paddr) -{ cvtLongToString(*from, to); return(0); } +static long cvt_l_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + char *to = (char *) t; + cvtLongToString(*from, to); + return 0; +} /* Convert Long to Char */ -static long cvt_l_c( - epicsInt32 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=*from; + return 0; +} /* Convert Long to Unsigned Char */ -static long cvt_l_uc( - epicsInt32 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=*from; + return 0; +} /* Convert Long to Short */ -static long cvt_l_s( - epicsInt32 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Long to Unsigned Short */ -static long cvt_l_us( - epicsInt32 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Long to Long */ -static long cvt_l_l( - epicsInt32 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Long to Unsigned Long */ -static long cvt_l_ul( - epicsInt32 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Long to Int64 */ -static long cvt_l_q( - epicsInt32 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Long to UInt64 */ -static long cvt_l_uq( - epicsInt32 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Long to Float */ -static long cvt_l_f( - epicsInt32 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=(epicsFloat32)*from; return(0); } +static long cvt_l_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=(epicsFloat32)*from; + return 0; +} /* Convert Long to Double */ -static long cvt_l_d( - epicsInt32 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Long to Enumerated */ -static long cvt_l_e( - epicsInt32 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_l_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt32 *from = (const epicsInt32 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to String */ -static long cvt_ul_st( - epicsUInt32 *from, - char *to, - const dbAddr *paddr) -{ cvtUlongToString(*from, to); return(0); } +static long cvt_ul_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + char *to = (char *) t; + cvtUlongToString(*from, to); + return 0; +} /* Convert Unsigned Long to Char */ -static long cvt_ul_c( - epicsUInt32 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Unsigned Char */ -static long cvt_ul_uc( - epicsUInt32 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Short */ -static long cvt_ul_s( - epicsUInt32 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Unsigned Short */ -static long cvt_ul_us( - epicsUInt32 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Long */ -static long cvt_ul_l( - epicsUInt32 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Unsigned Long */ -static long cvt_ul_ul( - epicsUInt32 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Int64 */ -static long cvt_ul_q( - epicsUInt32 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to UInt64 */ -static long cvt_ul_uq( - epicsUInt32 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Float */ -static long cvt_ul_f( - epicsUInt32 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=(epicsFloat32)*from; return(0); } +static long cvt_ul_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=(epicsFloat32)*from; + return 0; +} /* Convert Unsigned Long to Double */ -static long cvt_ul_d( - epicsUInt32 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Unsigned Long to Enumerated */ -static long cvt_ul_e( - epicsUInt32 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_ul_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt32 *from = (const epicsUInt32 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Int64 to String */ -static long cvt_q_st( - epicsInt64 *from, - char *to, - const dbAddr *paddr) -{ cvtInt64ToString(*from, to); return(0); } +static long cvt_q_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + char *to = (char *) t; + cvtInt64ToString(*from, to); + return 0; +} /* Convert Int64 to Char */ -static long cvt_q_c( - epicsInt64 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Unsigned Char */ -static long cvt_q_uc( - epicsInt64 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Short */ -static long cvt_q_s( - epicsInt64 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Unsigned Short */ -static long cvt_q_us( - epicsInt64 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Long */ -static long cvt_q_l( - epicsInt64 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Unsigned Long */ -static long cvt_q_ul( - epicsInt64 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Int64 */ -static long cvt_q_q( - epicsInt64 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Int64 to UInt64 */ -static long cvt_q_uq( - epicsInt64 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Float */ -static long cvt_q_f( - epicsInt64 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Double */ -static long cvt_q_d( - epicsInt64 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Int64 to Enumerated */ -static long cvt_q_e( - epicsInt64 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_q_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsInt64 *from = (const epicsInt64 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to String */ -static long cvt_uq_st( - epicsUInt64 *from, - char *to, - const dbAddr *paddr) -{ cvtUInt64ToString(*from, to); return(0); } +static long cvt_uq_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + char *to = (char *) t; + cvtUInt64ToString(*from, to); + return 0; +} /* Convert UInt64 to Char */ -static long cvt_uq_c( - epicsUInt64 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Unsigned Char */ -static long cvt_uq_uc( - epicsUInt64 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Short */ -static long cvt_uq_s( - epicsUInt64 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Unsigned Short */ -static long cvt_uq_us( - epicsUInt64 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Long */ -static long cvt_uq_l( - epicsUInt64 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Unsigned Long */ -static long cvt_uq_ul( - epicsUInt64 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Int64 */ -static long cvt_uq_q( - epicsUInt64 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to UInt64 */ -static long cvt_uq_uq( - epicsUInt64 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Float */ -static long cvt_uq_f( - epicsUInt64 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Double */ -static long cvt_uq_d( - epicsUInt64 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert UInt64 to Enumerated */ -static long cvt_uq_e( - epicsUInt64 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_uq_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsUInt64 *from = (const epicsUInt64 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Float to String */ -static long cvt_f_st( - epicsFloat32 *from, - char *to, - const dbAddr *paddr) - { - rset *prset = 0; - long status = 0; - long precision = 6; +static long cvt_f_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + char *to = (char *) t; + + rset *prset = 0; + long status = 0; + long precision = 6; - if(paddr) prset = dbGetRset(paddr); + if (paddr) prset = dbGetRset(paddr); - if (prset && prset->get_precision) - status = (*prset->get_precision)(paddr, &precision); - cvtFloatToString(*from, to, (unsigned short)precision); - return(status); + if (prset && prset->get_precision) + status = (*prset->get_precision)(paddr, &precision); + cvtFloatToString(*from, to, (unsigned short)precision); + return status; } /* Convert Float to Char */ -static long cvt_f_c( - epicsFloat32 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=(epicsInt8)*from; return(0); } +static long cvt_f_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=(epicsInt8)*from; + return 0; +} /* Convert Float to Unsigned Char */ -static long cvt_f_uc( - epicsFloat32 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=(epicsUInt8)*from; return(0); } +static long cvt_f_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=(epicsUInt8)*from; + return 0; +} /* Convert Float to Short */ -static long cvt_f_s( - epicsFloat32 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=(epicsInt16)*from; return(0); } +static long cvt_f_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=(epicsInt16)*from; + return 0; +} /* Convert Float to Unsigned Short */ -static long cvt_f_us( - epicsFloat32 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=(epicsUInt16)*from; return(0); } +static long cvt_f_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=(epicsUInt16)*from; + return 0; +} /* Convert Float to Long */ -static long cvt_f_l( - epicsFloat32 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=(epicsInt32)*from; return(0); } +static long cvt_f_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=(epicsInt32)*from; + return 0; +} /* Convert Float to Unsigned Long */ -static long cvt_f_ul( - epicsFloat32 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=(epicsUInt32)*from; return(0); } +static long cvt_f_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=(epicsUInt32)*from; + return 0; +} /* Convert Float to Int64 */ -static long cvt_f_q( - epicsFloat32 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_f_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Float to UInt64 */ -static long cvt_f_uq( - epicsFloat32 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_f_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Float to Float */ -static long cvt_f_f( - epicsFloat32 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_f_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Float to Double */ -static long cvt_f_d( - epicsFloat32 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_f_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Float to Enumerated */ -static long cvt_f_e( - epicsFloat32 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=(epicsEnum16)*from; return(0); } +static long cvt_f_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat32 *from = (const epicsFloat32 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=(epicsEnum16)*from; + return 0; +} /* Convert Double to String */ -static long cvt_d_st( - epicsFloat64 *from, - char *to, - const dbAddr *paddr) - { - rset *prset = 0; - long status = 0; - long precision = 6; +static long cvt_d_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + char *to = (char *) t; + rset *prset = 0; + long status = 0; + long precision = 6; - if(paddr) prset = dbGetRset(paddr); + if (paddr) prset = dbGetRset(paddr); - if (prset && prset->get_precision) - status = (*prset->get_precision)(paddr, &precision); - cvtDoubleToString(*from, to, (unsigned short)precision); - return(status); + if (prset && prset->get_precision) + status = (*prset->get_precision)(paddr, &precision); + cvtDoubleToString(*from, to, (unsigned short)precision); + return status; } /* Convert Double to Char */ -static long cvt_d_c( - epicsFloat64 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=(epicsInt8)*from; return(0); } +static long cvt_d_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=(epicsInt8)*from; + return 0; +} /* Convert Double to Unsigned Char */ -static long cvt_d_uc( - epicsFloat64 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=(epicsUInt8)*from; return(0); } +static long cvt_d_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=(epicsUInt8)*from; + return 0; +} /* Convert Double to Short */ -static long cvt_d_s( - epicsFloat64 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=(epicsInt16)*from; return(0); } +static long cvt_d_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=(epicsInt16)*from; + return 0; +} /* Convert Double to Unsigned Short */ -static long cvt_d_us( - epicsFloat64 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=(epicsUInt16)*from; return(0); } +static long cvt_d_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=(epicsUInt16)*from; + return 0; +} /* Convert Double to Long */ -static long cvt_d_l( - epicsFloat64 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_d_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Double to Unsigned Long */ -static long cvt_d_ul( - epicsFloat64 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_d_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Double to Int64 */ -static long cvt_d_q( - epicsFloat64 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_d_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Double to UInt64 */ -static long cvt_d_uq( - epicsFloat64 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_d_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Double to Float */ -static long cvt_d_f( - epicsFloat64 *from, - epicsFloat32 *to, - const dbAddr *paddr) -{ *to = epicsConvertDoubleToFloat(*from); return 0;} +static long cvt_d_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to = epicsConvertDoubleToFloat(*from); return 0;} /* Convert Double to Double */ -static long cvt_d_d( - epicsFloat64 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_d_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Double to Enumerated */ -static long cvt_d_e( - epicsFloat64 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=(epicsEnum16)*from; return(0); } +static long cvt_d_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsFloat64 *from = (const epicsFloat64 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=(epicsEnum16)*from; + return 0; +} /* Convert Enumerated to Char */ -static long cvt_e_c( - epicsEnum16 *from, - epicsInt8 *to, - const dbAddr *paddr) - { *to=(epicsInt8)*from; return(0); } +static long cvt_e_c(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsInt8 *to = (epicsInt8 *) t; + *to=(epicsInt8)*from; + return 0; +} /* Convert Enumerated to Unsigned Char */ -static long cvt_e_uc( - epicsEnum16 *from, - epicsUInt8 *to, - const dbAddr *paddr) - { *to=(epicsUInt8)*from; return(0); } +static long cvt_e_uc(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsUInt8 *to = (epicsUInt8 *) t; + *to=(epicsUInt8)*from; + return 0; +} /* Convert Enumerated to Short */ -static long cvt_e_s( - epicsEnum16 *from, - epicsInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_s(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsInt16 *to = (epicsInt16 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Unsigned Short */ -static long cvt_e_us( - epicsEnum16 *from, - epicsUInt16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_us(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsUInt16 *to = (epicsUInt16 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Long */ -static long cvt_e_l( - epicsEnum16 *from, - epicsInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_l(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsInt32 *to = (epicsInt32 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Unsigned Long */ -static long cvt_e_ul( - epicsEnum16 *from, - epicsUInt32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_ul(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsUInt32 *to = (epicsUInt32 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Int64 */ -static long cvt_e_q( - epicsEnum16 *from, - epicsInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_q(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsInt64 *to = (epicsInt64 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to UInt64 */ -static long cvt_e_uq( - epicsEnum16 *from, - epicsUInt64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_uq(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsUInt64 *to = (epicsUInt64 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Float */ -static long cvt_e_f( - epicsEnum16 *from, - epicsFloat32 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_f(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsFloat32 *to = (epicsFloat32 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Double */ -static long cvt_e_d( - epicsEnum16 *from, - epicsFloat64 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_d(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsFloat64 *to = (epicsFloat64 *) t; + *to=*from; + return 0; +} /* Convert Enumerated to Enumerated */ -static long cvt_e_e( - epicsEnum16 *from, - epicsEnum16 *to, - const dbAddr *paddr) - { *to=*from; return(0); } +static long cvt_e_e(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + epicsEnum16 *to = (epicsEnum16 *) t; + *to=*from; + return 0; +} /* Convert Choices And Enumerated Types To String ... */ /* Get Enumerated to String */ -static long cvt_e_st_get( - epicsEnum16 *from, - char *to, - const dbAddr *paddr) - { - rset *prset = 0; - long status; +static long cvt_e_st_get(const void *f, void *t, const dbAddr *paddr) +{ + char *to = (char *) t; + rset *prset = 0; + long status; - if(paddr) prset = dbGetRset(paddr); + if(paddr) prset = dbGetRset(paddr); - if (prset && prset->get_enum_str) - return (*prset->get_enum_str)(paddr, to); + if (prset && prset->get_enum_str) + return (*prset->get_enum_str)(paddr, to); - status = S_db_noRSET; - recGblRecSupError(status, paddr, "dbGetField", "get_enum_str"); + status = S_db_noRSET; + recGblRecSupError(status, paddr, "dbGetField", "get_enum_str"); - return(S_db_badDbrtype); - } + return S_db_badDbrtype; +} /* Put Enumerated to String */ -static long cvt_e_st_put( - epicsEnum16 *from, - char *to, - const dbAddr *paddr) - { cvtUshortToString(*from, to); return(0); } +static long cvt_e_st_put(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + char *to = (char *) t; + + cvtUshortToString(*from, to); + return 0; +} /* Get Menu to String */ -static long cvt_menu_st( - epicsEnum16 *from, - char *to, - const dbAddr *paddr) +static long cvt_menu_st(const void *f, void *t, const dbAddr *paddr) { + const epicsEnum16 *from = (const epicsEnum16 *) f; + char *to = (char *) t; dbFldDes *pdbFldDes; dbMenu *pdbMenu; @@ -1358,15 +1599,14 @@ static long cvt_menu_st( /* Get Device to String */ -static long cvt_device_st( - epicsEnum16 *from, - char *to, - const dbAddr *paddr) - { - dbFldDes *pdbFldDes; - dbDeviceMenu *pdbDeviceMenu; - char **papChoice; - char *pchoice; +static long cvt_device_st(const void *f, void *t, const dbAddr *paddr) +{ + const epicsEnum16 *from = (const epicsEnum16 *) f; + char *to = (char *) t; + dbFldDes *pdbFldDes; + dbDeviceMenu *pdbDeviceMenu; + char **papChoice; + char *pchoice; if (!paddr || !(pdbFldDes = paddr->pfldDes)) { @@ -1382,11 +1622,11 @@ static long cvt_device_st( || !(papChoice= pdbDeviceMenu->papChoice) || !(pchoice=papChoice[*from])) { recGblDbaddrError(S_db_badChoice,paddr,"dbFastLinkConv(cvt_device_st)"); - return(S_db_badChoice); + return S_db_badChoice; } strncpy(to,pchoice,MAX_STRING_SIZE); - return(0); - } + return 0; +} /* * Get conversion routine lookup table From 2f730b8e9f64b677603f7ebf026fef848a805602 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 24 Dec 2023 17:58:27 +0000 Subject: [PATCH 37/46] Add arg's to function pointer typedefs and prototypes --- modules/database/src/ioc/db/dbAccess.c | 2 +- modules/database/src/ioc/db/dbEvent.c | 4 ++-- modules/database/src/ioc/db/dbScan.c | 4 ++-- modules/database/src/ioc/dbStatic/dbYacc.y | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/database/src/ioc/db/dbAccess.c b/modules/database/src/ioc/db/dbAccess.c index 4128cbe4e..42ce833ac 100644 --- a/modules/database/src/ioc/db/dbAccess.c +++ b/modules/database/src/ioc/db/dbAccess.c @@ -112,7 +112,7 @@ void dbSpcAsRegisterCallback(SPC_ASCALLBACK func) long dbPutSpecial(DBADDR *paddr,int pass) { - long int (*pspecial)()=NULL; + long int (*pspecial)(struct dbAddr *, int)=NULL; rset *prset; dbCommon *precord = paddr->precord; long status=0; diff --git a/modules/database/src/ioc/db/dbEvent.c b/modules/database/src/ioc/db/dbEvent.c index e7d0427fc..2d168f55f 100644 --- a/modules/database/src/ioc/db/dbEvent.c +++ b/modules/database/src/ioc/db/dbEvent.c @@ -98,8 +98,8 @@ struct event_user { unsigned char extra_labor; /* if set call extra labor func */ unsigned char flowCtrlMode; /* replace existing monitor */ unsigned char extraLaborBusy; - void (*init_func)(); - epicsThreadId init_func_arg; + void (*init_func)(void *); + void *init_func_arg; }; typedef struct { diff --git a/modules/database/src/ioc/db/dbScan.c b/modules/database/src/ioc/db/dbScan.c index 966db7c24..97619ab83 100644 --- a/modules/database/src/ioc/db/dbScan.c +++ b/modules/database/src/ioc/db/dbScan.c @@ -264,7 +264,7 @@ void scanAdd(struct dbCommon *precord) } else if (scan == menuScanI_O_Intr) { ioscan_head *piosh = NULL; int prio; - DEVSUPFUN get_ioint_info; + long (*get_ioint_info)(int, struct dbCommon *, IOSCANPVT*); if (precord->dset == NULL){ recGblRecordError(-1, (void *)precord, @@ -332,7 +332,7 @@ void scanDelete(struct dbCommon *precord) } else if (scan == menuScanI_O_Intr) { ioscan_head *piosh = NULL; int prio; - DEVSUPFUN get_ioint_info; + long (*get_ioint_info)(int, struct dbCommon *, IOSCANPVT*); if (precord->dset==NULL) { recGblRecordError(-1, (void *)precord, diff --git a/modules/database/src/ioc/dbStatic/dbYacc.y b/modules/database/src/ioc/dbStatic/dbYacc.y index 098144f05..5fff88a88 100644 --- a/modules/database/src/ioc/dbStatic/dbYacc.y +++ b/modules/database/src/ioc/dbStatic/dbYacc.y @@ -8,7 +8,7 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ %{ -static int yyerror(); +static int yyerror(char *str); static int yy_start; static long pvt_yy_parse(void); static int yyFailed = 0; From 918a188285f554f99f02bb8feccc36604fc41e51 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 24 Dec 2023 18:01:37 +0000 Subject: [PATCH 38/46] Define USE_TYPED_DRVET, use drvet * instead of struct drvet * --- modules/database/src/ioc/db/dbTest.c | 2 +- modules/database/src/ioc/dbStatic/Makefile | 2 ++ modules/database/src/ioc/dbStatic/dbBase.h | 3 ++- modules/database/src/ioc/dbStatic/link.h | 2 +- modules/database/src/ioc/misc/iocInit.c | 2 +- modules/database/src/ioc/registry/registryCommon.c | 2 +- modules/database/src/ioc/registry/registryCommon.h | 2 +- modules/database/src/ioc/registry/registryDriverSupport.c | 4 ++-- modules/database/src/ioc/registry/registryDriverSupport.h | 4 ++-- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/database/src/ioc/db/dbTest.c b/modules/database/src/ioc/db/dbTest.c index 3c52f93e1..583eb9af3 100644 --- a/modules/database/src/ioc/db/dbTest.c +++ b/modules/database/src/ioc/db/dbTest.c @@ -680,7 +680,7 @@ long dbtpf(const char *pname, const char *pvalue) long dbior(const char *pdrvName,int interest_level) { drvSup *pdrvSup; - struct drvet *pdrvet; + drvet *pdrvet; dbRecordType *pdbRecordType; if (!pdbbase) { diff --git a/modules/database/src/ioc/dbStatic/Makefile b/modules/database/src/ioc/dbStatic/Makefile index e9bd95b8d..bb178df41 100644 --- a/modules/database/src/ioc/dbStatic/Makefile +++ b/modules/database/src/ioc/dbStatic/Makefile @@ -11,6 +11,8 @@ SRC_DIRS += $(IOCDIR)/dbStatic +USR_CFLAGS += -DUSE_TYPED_DRVET + INC += dbBase.h INC += dbFldTypes.h INC += dbStaticLib.h diff --git a/modules/database/src/ioc/dbStatic/dbBase.h b/modules/database/src/ioc/dbStatic/dbBase.h index 9578d1fac..b69cceca0 100644 --- a/modules/database/src/ioc/dbStatic/dbBase.h +++ b/modules/database/src/ioc/dbStatic/dbBase.h @@ -21,6 +21,7 @@ #include "dbDefs.h" #include "recSup.h" #include "devSup.h" +#include "drvSup.h" typedef struct dbMenu { ELLNODE node; @@ -33,7 +34,7 @@ typedef struct dbMenu { typedef struct drvSup { ELLNODE node; char *name; - struct drvet *pdrvet; + drvet *pdrvet; }drvSup; typedef struct devSup { diff --git a/modules/database/src/ioc/dbStatic/link.h b/modules/database/src/ioc/dbStatic/link.h index 35f805ccf..a4aab8dd8 100644 --- a/modules/database/src/ioc/dbStatic/link.h +++ b/modules/database/src/ioc/dbStatic/link.h @@ -188,8 +188,8 @@ union value { struct vxiio vxiio; /* vxi io */ }; +struct dbCommon; struct lset; - struct link { struct dbCommon *precord; /* Pointer to record owning link */ short type; diff --git a/modules/database/src/ioc/misc/iocInit.c b/modules/database/src/ioc/misc/iocInit.c index 14291808a..ac89495f0 100644 --- a/modules/database/src/ioc/misc/iocInit.c +++ b/modules/database/src/ioc/misc/iocInit.c @@ -388,7 +388,7 @@ static void initDrvSup(void) /* Locate all driver support entry tables */ for (pdrvSup = (drvSup *)ellFirst(&pdbbase->drvList); pdrvSup; pdrvSup = (drvSup *)ellNext(&pdrvSup->node)) { - struct drvet *pdrvet = registryDriverSupportFind(pdrvSup->name); + drvet *pdrvet = registryDriverSupportFind(pdrvSup->name); if (!pdrvet) { errlogPrintf("iocInit: driver %s not found\n", pdrvSup->name); diff --git a/modules/database/src/ioc/registry/registryCommon.c b/modules/database/src/ioc/registry/registryCommon.c index 273e4d5ec..be5c4e347 100644 --- a/modules/database/src/ioc/registry/registryCommon.c +++ b/modules/database/src/ioc/registry/registryCommon.c @@ -65,7 +65,7 @@ void registerDevices(DBBASE *pbase, int nDevices, } void registerDrivers(DBBASE *pbase, int nDrivers, - const char * const * driverSupportNames, struct drvet * const *drvsl) + const char * const * driverSupportNames, drvet * const *drvsl) { int i; for (i = 0; i < nDrivers; i++) { diff --git a/modules/database/src/ioc/registry/registryCommon.h b/modules/database/src/ioc/registry/registryCommon.h index b2ff5eb07..5f062a4a1 100644 --- a/modules/database/src/ioc/registry/registryCommon.h +++ b/modules/database/src/ioc/registry/registryCommon.h @@ -29,7 +29,7 @@ DBCORE_API void registerDevices( const char * const *deviceSupportNames, const dset * const *devsl); DBCORE_API void registerDrivers( DBBASE *pbase, int nDrivers, - const char * const *driverSupportNames, struct drvet * const *drvsl); + const char * const *driverSupportNames, drvet * const *drvsl); DBCORE_API void registerJLinks( DBBASE *pbase, int nDrivers, jlif * const *jlifsl); diff --git a/modules/database/src/ioc/registry/registryDriverSupport.c b/modules/database/src/ioc/registry/registryDriverSupport.c index 36ac0a82e..5fb84a48b 100644 --- a/modules/database/src/ioc/registry/registryDriverSupport.c +++ b/modules/database/src/ioc/registry/registryDriverSupport.c @@ -18,12 +18,12 @@ static void *registryID = "driver support"; DBCORE_API int registryDriverSupportAdd( - const char *name, struct drvet *pdrvet) + const char *name, drvet *pdrvet) { return registryAdd(registryID, name, pdrvet); } -DBCORE_API struct drvet * registryDriverSupportFind( +DBCORE_API drvet * registryDriverSupportFind( const char *name) { return registryFind(registryID, name); diff --git a/modules/database/src/ioc/registry/registryDriverSupport.h b/modules/database/src/ioc/registry/registryDriverSupport.h index 8857d97b2..90815e8ed 100644 --- a/modules/database/src/ioc/registry/registryDriverSupport.h +++ b/modules/database/src/ioc/registry/registryDriverSupport.h @@ -19,8 +19,8 @@ extern "C" { #endif DBCORE_API int registryDriverSupportAdd( - const char *name, struct drvet *pdrvet); -DBCORE_API struct drvet * registryDriverSupportFind( + const char *name, drvet *pdrvet); +DBCORE_API drvet * registryDriverSupportFind( const char *name); #ifdef __cplusplus From 7890e67d378ba3a0909e44d2be11fbe1b5e58711 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 24 Dec 2023 18:02:28 +0000 Subject: [PATCH 39/46] Various misc warnings --- modules/database/src/ioc/db/dbLink.h | 4 ++-- .../database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp | 2 +- modules/database/src/ioc/rsrv/cast_server.c | 5 +---- modules/database/test/ioc/db/dbStressLock.c | 3 +++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/database/src/ioc/db/dbLink.h b/modules/database/src/ioc/db/dbLink.h index 4e7862479..b8a819b98 100644 --- a/modules/database/src/ioc/db/dbLink.h +++ b/modules/database/src/ioc/db/dbLink.h @@ -307,7 +307,7 @@ typedef struct lset { * * @param plink the link * @param dbrType data type code - * @param pbuffer where to put the value + * @param pbuffer where the data is * @param nRequest number of elements to send * @returns status value */ @@ -324,7 +324,7 @@ typedef struct lset { * * @param plink the link * @param dbrType data type code - * @param pbuffer where to put the value + * @param pbuffer where the data is * @param nRequest number of elements to send * @returns status value */ diff --git a/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp b/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp index f6a21dc77..c7df5f1bc 100644 --- a/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp +++ b/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp @@ -36,7 +36,7 @@ struct compareLoc { return true; else if(lhs.prset>rhs.prset) return false; - return lhs.sizeOffsetchanListLock ); -# ifdef DEBUG - if(ndelete){ + if (CASDEBUG>1 && ndelete){ epicsPrintf ("CAS: %d CA channels have expired after %f sec\n", ndelete, maxdelay); } -# endif - } /* diff --git a/modules/database/test/ioc/db/dbStressLock.c b/modules/database/test/ioc/db/dbStressLock.c index 6cac59fe2..f5722cd32 100644 --- a/modules/database/test/ioc/db/dbStressLock.c +++ b/modules/database/test/ioc/db/dbStressLock.c @@ -120,6 +120,9 @@ void doMulti(workerPriv *p) } dbScanUnlockMany(locker); + if (0) + testDiag("sum = %d", sum); + dbLockerFree(locker); } From 437320926ba312e8802f7268ddb3db642b58f847 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 9 Jan 2024 21:42:38 -0600 Subject: [PATCH 40/46] Move declaration back --- modules/database/test/ioc/db/jlinkz.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/database/test/ioc/db/jlinkz.c b/modules/database/test/ioc/db/jlinkz.c index 50aca7789..fc53a4eb5 100644 --- a/modules/database/test/ioc/db/jlinkz.c +++ b/modules/database/test/ioc/db/jlinkz.c @@ -119,11 +119,12 @@ long z_putval(struct link *plink, short dbrType, { long ret; zpriv *priv = CONTAINER(plink->value.json.jlink, zpriv, base); + FASTCONVERTFUNC pconv; if(INVALID_DB_REQ(dbrType)) return S_db_badDbrtype; - FASTCONVERTFUNC pconv = dbFastPutConvertRoutine[DBF_LONG][dbrType]; + pconv = dbFastPutConvertRoutine[DBF_LONG][dbrType]; if(nRequest==0) return 0; From 916b17ef3f504a5ac208617e76204e0801e301e3 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 10 Jan 2024 10:27:54 -0600 Subject: [PATCH 41/46] Fix review comment --- modules/database/test/ioc/db/dbStressLock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/database/test/ioc/db/dbStressLock.c b/modules/database/test/ioc/db/dbStressLock.c index f5722cd32..d71fca8ac 100644 --- a/modules/database/test/ioc/db/dbStressLock.c +++ b/modules/database/test/ioc/db/dbStressLock.c @@ -59,6 +59,9 @@ static unsigned int nrecords; #define MAXLOCK 20 +/* Verbose output from test if you set this to 1 */ +#define MULTI_DIAG 0 + static dbCommon **precords; typedef struct { @@ -120,7 +123,7 @@ void doMulti(workerPriv *p) } dbScanUnlockMany(locker); - if (0) + if (MULTI_DIAG) testDiag("sum = %d", sum); dbLockerFree(locker); From 31b22fd2535b2ff0c950ac870a956a229679c8bc Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 10 Jul 2024 23:06:53 -0500 Subject: [PATCH 42/46] Add test of jlinkz::putValue() to dbPutLinkTest Add OUTP link field to xRecord xRecord::process() puts VAL to the OUTP link jlinkz writes the output value to the record's own PHAS field Correct the dbFastPutConvertRoutine lookup Test sets OUTP link, processes record and confirms that PHAS was set --- modules/database/test/ioc/db/dbPutLinkTest.c | 6 +++++- modules/database/test/ioc/db/jlinkz.c | 3 ++- modules/database/test/ioc/db/xRecord.c | 1 + modules/database/test/ioc/db/xRecord.dbd | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/database/test/ioc/db/dbPutLinkTest.c b/modules/database/test/ioc/db/dbPutLinkTest.c index db947b9eb..2b7d3a518 100644 --- a/modules/database/test/ioc/db/dbPutLinkTest.c +++ b/modules/database/test/ioc/db/dbPutLinkTest.c @@ -597,8 +597,12 @@ void testJLink(void) testNumZ(6); testdbPutFieldOk("j1.INP", DBF_STRING, "{\"z\":{\"good\":4}}"); + testdbPutFieldOk("j1.PHAS", DBF_LONG, 0); + testdbPutFieldOk("j1.OUTP", DBF_STRING, "{z:{good:99}}"); testdbPutFieldOk("j1.PROC", DBF_LONG, 1); testdbGetFieldEqual("j1.VAL", DBF_LONG, 4); + testdbGetFieldEqual("j1.PHAS", DBF_LONG, 4); + testdbPutFieldOk("j1.OUTP", DBF_STRING, ""); testdbPutFieldOk("j2.TSEL", DBF_STRING, "{'z':{good:0}}"); testdbPutFieldOk("j2.PROC", DBF_LONG, 1); @@ -701,7 +705,7 @@ void testTSEL(void) MAIN(dbPutLinkTest) { - testPlan(348); + testPlan(352); testLinkParse(); testLinkFailParse(); testCADBSet(); diff --git a/modules/database/test/ioc/db/jlinkz.c b/modules/database/test/ioc/db/jlinkz.c index fc53a4eb5..968f9f648 100644 --- a/modules/database/test/ioc/db/jlinkz.c +++ b/modules/database/test/ioc/db/jlinkz.c @@ -124,13 +124,14 @@ long z_putval(struct link *plink, short dbrType, if(INVALID_DB_REQ(dbrType)) return S_db_badDbrtype; - pconv = dbFastPutConvertRoutine[DBF_LONG][dbrType]; + pconv = dbFastPutConvertRoutine[dbrType][DBF_LONG]; if(nRequest==0) return 0; epicsMutexLock(priv->lock); ret = pconv(pbuffer, &priv->value, NULL); epicsMutexUnlock(priv->lock); + plink->precord->phas = priv->value; return ret; } diff --git a/modules/database/test/ioc/db/xRecord.c b/modules/database/test/ioc/db/xRecord.c index cd8fa74df..9f934746a 100644 --- a/modules/database/test/ioc/db/xRecord.c +++ b/modules/database/test/ioc/db/xRecord.c @@ -71,6 +71,7 @@ static long process(struct dbCommon *pcommon) ret = (*xset->process)(prec); monitor(prec); recGblGetTimeStamp(prec); + dbPutLink(&prec->outp, DBR_LONG, &prec->val, 1); recGblFwdLink(prec); prec->pact = FALSE; return ret; diff --git a/modules/database/test/ioc/db/xRecord.dbd b/modules/database/test/ioc/db/xRecord.dbd index 620deac61..494ea349a 100644 --- a/modules/database/test/ioc/db/xRecord.dbd +++ b/modules/database/test/ioc/db/xRecord.dbd @@ -49,6 +49,9 @@ recordtype(x) { prompt("Input Link") special(SPC_MOD) } + field(OUTP, DBF_OUTLINK) { + prompt("Output Link") + } field(CLBK, DBF_NOACCESS) { prompt("Processing callback") special(SPC_NOMOD) From 1e8d49f2a616c583187c796855e6b10bf0637e98 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 10 Jul 2024 23:07:54 -0500 Subject: [PATCH 43/46] Drop debugging diagnostics --- modules/database/test/ioc/db/jlinkz.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/database/test/ioc/db/jlinkz.c b/modules/database/test/ioc/db/jlinkz.c index 968f9f648..673391617 100644 --- a/modules/database/test/ioc/db/jlinkz.c +++ b/modules/database/test/ioc/db/jlinkz.c @@ -35,7 +35,6 @@ void z_open(struct link *plink) if(priv->isopen) testDiag("lsetZ re-open"); priv->isopen = 1; - testDiag("Open jlinkz %p", priv); } static @@ -50,8 +49,6 @@ void z_remove(struct dbLocker *locker, struct link *plink) epicsMutexUnlock(priv->lock); - testDiag("Remove/free jlinkz %p", priv); - epicsAtomicDecrIntT(&numzalloc); epicsMutexDestroy(priv->lock); @@ -169,8 +166,6 @@ jlink* z_alloc(short dbfType) epicsAtomicIncrIntT(&numzalloc); - testDiag("Alloc jlinkz %p", priv); - return &priv->base; fail: if(priv && priv->lock) epicsMutexDestroy(priv->lock); @@ -186,8 +181,6 @@ void z_free(jlink *pj) if(priv->isopen) testDiag("lsetZ jlink free after open()"); - testDiag("Free jlinkz %p", priv); - epicsAtomicDecrIntT(&numzalloc); epicsMutexDestroy(priv->lock); From 3f4d080260b094e63b27ea804948a2308857e37c Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 10 Jul 2024 23:29:17 -0500 Subject: [PATCH 44/46] Make dbFastGet/PutConvertRoutine arrays const Also added Doxygen annotations for them. --- modules/database/src/ioc/db/dbConvertFast.h | 25 ++++++++++++++++---- modules/database/src/ioc/db/dbFastLinkConv.c | 4 ++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/modules/database/src/ioc/db/dbConvertFast.h b/modules/database/src/ioc/db/dbConvertFast.h index 0980b6b19..470cedbdd 100644 --- a/modules/database/src/ioc/db/dbConvertFast.h +++ b/modules/database/src/ioc/db/dbConvertFast.h @@ -7,7 +7,20 @@ * EPICS Base is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ -/* dbConvertFast.h */ +/** @file dbConvertFast.h + * @brief Data conversion for scalar values + * + * The typedef FASTCONVERTFUNC is defined in link.h as: + * @code + * long convert(const void *from, void *to, const struct dbAddr *paddr); + * @endcode + * + * The arrays declared here provide pointers to the fast conversion + * routine where the first array index is the data type for the first + * "from" pointer arg, and the second array index is the data type for + * the second "to" pointer arg. The array index values are a subset of + * the DBF_ enum values defined in dbFldTypes.h + */ #ifndef INCdbConvertFasth #define INCdbConvertFasth @@ -20,10 +33,12 @@ extern "C" { #endif -/* typedef FASTCONVERTFUNC is now defined in link.h */ - -DBCORE_API extern FASTCONVERTFUNC dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1]; -DBCORE_API extern FASTCONVERTFUNC dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1]; +/** Function pointers for get conversions */ +DBCORE_API extern const FASTCONVERTFUNC + dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1]; +/** Function pointers for put conversions */ +DBCORE_API extern const FASTCONVERTFUNC + dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1]; #ifdef __cplusplus } diff --git a/modules/database/src/ioc/db/dbFastLinkConv.c b/modules/database/src/ioc/db/dbFastLinkConv.c index fc229605f..7d463d4d1 100644 --- a/modules/database/src/ioc/db/dbFastLinkConv.c +++ b/modules/database/src/ioc/db/dbFastLinkConv.c @@ -1639,7 +1639,7 @@ static long cvt_device_st(const void *f, void *t, const dbAddr *paddr) * NULL implies the conversion is not supported. */ -FASTCONVERTFUNC dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = { +FASTCONVERTFUNC const dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = { /* Convert DBF_STRING to ... */ { cvt_st_st, cvt_st_c, cvt_st_uc, cvt_st_s, cvt_st_us, cvt_st_l, cvt_st_ul, cvt_st_q, cvt_st_uq, cvt_st_f, cvt_st_d, cvt_st_e }, @@ -1695,7 +1695,7 @@ FASTCONVERTFUNC dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = { * NULL implies the conversion is not supported. */ -FASTCONVERTFUNC dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1] = { +FASTCONVERTFUNC const dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1] = { /* Convert DBR_STRING to ... */ { cvt_st_st, cvt_st_c, cvt_st_uc, cvt_st_s, cvt_st_us, cvt_st_l, cvt_st_ul, cvt_st_q, cvt_st_uq, cvt_st_f, cvt_st_d, cvt_st_e, cvt_st_menu, cvt_st_device}, From 856f345d2c01770235ceba4c08d0afe95b80fefe Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 10 Jul 2024 23:56:22 -0500 Subject: [PATCH 45/46] Fix Codacy complaint about C-style casts --- .../src/ioc/misc/registerAllRecordDeviceDrivers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp b/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp index c7df5f1bc..f6ef353f1 100644 --- a/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp +++ b/modules/database/src/ioc/misc/registerAllRecordDeviceDrivers.cpp @@ -32,11 +32,12 @@ namespace { struct compareLoc { bool operator()(const recordTypeLocation& lhs, const recordTypeLocation& rhs) const { - if(lhs.prsetrhs.prset) + if (lhs.prset > rhs.prset) return false; - return (char *)lhs.sizeOffset < (char *)rhs.sizeOffset; + return reinterpret_cast(lhs.sizeOffset) + < reinterpret_cast(rhs.sizeOffset); } }; From a5c3330c8eb42b6a7c117cd8130dde49033621bd Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 3 Aug 2024 17:02:37 -0500 Subject: [PATCH 46/46] Update .ci module, disable CentOS-7 build --- .ci | 2 +- .github/workflows/ci-scripts-build.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci b/.ci index 20f8e0539..0e93b7085 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 20f8e053931fdef8a9413cc6229286c5d9ed152f +Subproject commit 0e93b708551cb7bb212fda7029eccdf872dabc81 diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 4d85d120b..e175a3b7c 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -237,10 +237,10 @@ jobs: matrix: # Job names also name artifacts, character limitations apply include: - - name: "CentOS-7" - image: centos:7 - cmp: gcc - configuration: default + #- name: "CentOS-7" + # image: centos:7 + # cmp: gcc + # configuration: default - name: "Fedora-33" image: fedora:33