2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Problems with dbLinkIsConstant |
From: | "Johnson, Andrew N. via Core-talk" <core-talk at aps.anl.gov> |
To: | Torsten Bögershausen <torsten.bogershausen at ess.eu> |
Cc: | EPICS core-talk <core-talk at aps.anl.gov> |
Date: | Tue, 30 Jun 2020 15:55:02 +0000 |
Hi Torsten,
On Jun 30, 2020, at 3:09 AM, Torsten Bögershausen via Core-talk <core-talk at aps.anl.gov> wrote:
Yes, an empty or unpopulated link field has always been represented with
type==CONSTANT which is a macro with value 0 so this is also the default if the link field is not set at all. In 3.16.1 I introduced extensible links and the
dbLinkIsConstant() routine to Base because extensible links can also provide constant values, and they don’t have type==CONSTANT.
Note that recGblInitConstantLink() has always returned
TRUE if the link is a constant and provided a value (else
FALSE), so there is no actual need for the conditional around it – that was merely an optimization for earlier versions of Base but is no longer helpful. My suggested replacement for the code above is to not call dbLinkIsConstant()
at all, just do this instead:
if (recGblInitConstantLink(&pmr->dol, DBF_DOUBLE, &pmr->val)) { } That should be backwards compatible with older Base versions, and I believe all of the record types have now had that modification done already. This was documented in the Release
Notes for version 3.16.1, look for the section titled “Support Routine Modifications for Extensible Link Types”.
HTH,
- Andrew
--
Complexity comes for free, simplicity you have to work for.
|