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 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: Patch file for Records which use consistent epics data types
From: Michael Davidsaver <mdavidsaver@gmail.com>
To: Jeong Han Lee <citadel.lee@gmail.com>
Cc: core-talk@aps.anl.gov
Date: Thu, 27 Apr 2017 20:41:19 -0400
On 04/27/2017 07:38 PM, Jeong Han Lee wrote:
> Hi,
> 
>    I did modify the records, which I mentioned in tech-talks as below:
>    http://www.aps.anl.gov/epics/tech-talk/2017/msg00690.php
> 
>    Main focus are the following three items
>    1. recGblResetAlarms returns unsigned short / epicsUInt16
>    2. recGblCheckDeadband uses "unsigned (int) / epicsUInt32
>    3. db_post_events uses "unsigned int / epicsUInt32
> 
>    So, I decided to minimize any changes on the monitor functions.
> 
>    Please let me know what you think.

A couple of points.

* The recGblCheckDeadband() function accepts monitor mask as
(unsigned*), which happens to be the same as (epicsUInt32*).  In my mind
though this should be explicit and the 'monitor_mask' local in
aiRecord.c should be 'unsigned'.

* Changing a local loop index from 'int i' to 'epicsInt32 i' doesn't
seem to me so useful.  Better to check if it can be made unsigned or size_t.

* In permissiveRecord.c you change some locals from 'unsigned short' to
epicsUInt16 which is fine, but you also initialize them to zero when
they were previously not initialized.  In this case it's a no-op as the
zeros are immediately replaced.  In general I think it's better to leave
locals uninitialized unless the value will be used.

gcc at least will in many cases warn about possible unconditional use of
uninitialized locals.  I like to give the compiler an opportunity to
tell me when I'm making a mistake :)

Also, I'd rather not see the type repeated four times.  So better to
make this:

> epicsUInt16 val  = prec->val,
>             oval = prec->oval,
>             wflg = prec->wflg;
>             oflg = prec->oflg;


Replies:
Re: Patch file for Records which use consistent epics data types Jeong Han Lee
References:
Patch file for Records which use consistent epics data types Jeong Han Lee

Navigate by Date:
Prev: Re: Patch file for Records which use consistent epics data types Michael Davidsaver
Next: Re: Patch file for Records which use consistent epics data types Jeong Han Lee
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: Patch file for Records which use consistent epics data types Michael Davidsaver
Next: Re: Patch file for Records which use consistent epics data types Jeong Han Lee
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 28 Apr 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·