EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Conversion from hex number string to LONG-type field
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Wed, 28 Feb 2018 12:47:21 -0600
Hi Bruno,

On 02/28/2018 10:27 AM, Bruno Martins wrote:
> I noticed that dbpf doesn't convert hex values to fields with type LONG.
> Digging through the code it seems that the culprit is in
> ioc/db/dbFastLinkConv.c: cvt_st_l (and a bunch others) calls strtol with
> base=10. Wouldn't it be better to call it with base=0 and let it figure
> out the proper base? Or, instead, to use epicsScanDouble like cvt_st_ul
> does?

The dbFastLinkConv.c routines are also used for data conversions between
records, and making this change could potentially break existing
databases that relied on the original behaviour. I admit it's an obscure
behaviour, but I am generally very reluctant to accept changes that
alter what existing IOC databases actually do.

In particular a database that gets a number from a string that has
leading zeros would then be converted as an octal number (010 → 8)
instead of the decimal that it currently uses (010 → 10).

I don't have a solution to that, discussion and ideas welcome.

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

References:
Conversion from hex number string to LONG-type field Bruno Martins

Navigate by Date:
Prev: Re: Named Event, TSE and GeneralTime Michael Davidsaver
Next: Re: Understanding the GIT organization and workflow for EPICS 7 Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Conversion from hex number string to LONG-type field Bruno Martins
Next: New/improved iocsh debug utility functions Dirk Zimoch
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 01 Mar 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·