Remove the global variable 'capabilities' which is set to 0 by the
get_capabilities() function but not used anywhere else. Remove the
'type' and 'flags' local variables from get_capabilities() which are set
to the return values of comedi_get_subdevice_type() and
comedi_get_subdevice_flags() but never used. Remove the 'tmp' local
variable from test_segfault(); it was involved in a volatile memory
access to test for segmentation faults. Still do the volatile memory
access but don't use the variable.
Remove the cmd_timed and cmd_timed_errno members from the internal
struct subdevice_struct.
cmd_timed_errno is checked but never set, so it will always be 0 and the
code that uses it is buggy as it returns the value of s->cmd_mask_errno
if s->cmd_timed_errno is non-zero and sets s->cmd_mask_errno on failure.
It shouldn't be setting s->cmd_mask_errno at all.
Since the generic timed command could depend on the length of the
channel list, don't bother caching the result, and don't set
s->cmd_mask_errno on failure.
Some calls to malloc(), realloc() or calloc() do not check the result.
Do so. Also call internal function libc_error() if they fail to set the
result for comedi_errno().
Move the comedi_parse_calibration_file() function definition to the
bottom of the file. It calls calib_yyparse() and the declaration might
not be in scope since we removed the declaration from
"lib/libinternal.h", but we know it will be declared somewhere above the
bottom of the generated "lib/calib_yacc.c" above the new location of
comedi_parse_calibration_file().
For newer versions of Bison, the declaration of our calib_yyparse()
function in "lib/libinternal.h" clashes with that in the generated
"lib/calib_yacc.h".
Remove the declarations of calib_yyerror() and calib_yyparse() from
"lib/libinternal.h" and declare them in "lib/calib_yacc.c".
Move the call to AS_LIBTOOL() to avoid warnings from automake 1.12.6.
Move SCXI_SO_VERSION as it is nearby!
On Gentoo Linux:
$ WANT_AUTOMAKE=1.12 ./autogen.sh
configure.ac:101: warning: LT_INIT was called before AM_PROG_AR
/usr/share/aclocal-1.12/ar-lib.m4:13: AM_PROG_AR is expanded from...
configure.ac:101: the top level
configure.ac:101: warning: AC_PROG_LIBTOOL was called before AM_PROG_AR
/usr/share/aclocal-1.12/ar-lib.m4:13: AM_PROG_AR is expanded from...
configure.ac:101: the top level
configure.ac:101: warning: LT_INIT was called before AM_PROG_AR
aclocal.m4:8669: AM_PROG_AR is expanded from...
configure.ac:101: the top level
configure.ac:101: warning: AC_PROG_LIBTOOL was called before AM_PROG_AR
aclocal.m4:8669: AM_PROG_AR is expanded from...
configure.ac:101: the top level
This is what automake told me to do:
$ ./autogen.sh
...
automake: warnings are treated as errors
/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libcomedi.la': linking libtool libraries using a non-POSIX
/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
lib/Makefile.am:2: while processing Libtool library 'libcomedi.la'
...
autoreconf-2.69: automake failed with exit status: 1
AM_PROG_AR is new in automake-1.11.2. For further details, see:
http://lists.gnu.org/archive/html/bug-automake/2012-05/msg00009.html
The units for a range with internal unit code `RF_EXTERNAL | UNIT_volt` is currently
displayed as " (unknown unit 256)", for example an external bipolar
voltage range -1 to 1 is displayed as:
[-1 (unknown unit 256),1 (unknown unit 256)]
Change it to be displayed as:
[-1*EXT V,1*EXT V]
Add variable `def_n_chans_for_generic_timed` to hold the preferred
number of channels to use in calls to `comedi_get_cmd_generic_timed()`.
Reset the `n_chans_for_generic_timed` variable to this value each time
around the loop for each subdevice before clipping the value to the
number of channels the subdevice has.
`strtmp` is currently declared as `char strtmp[16]`, but that may be too
short for the calls to `unit_to_desc()` when the type of unit is
unknown. Increase its length to 32.
There is already a commented out rule in the example udev rules file
"z99_comedi.rules" to set the mode to 0660 and set the group owner to
"comedi". Add an almost identical commented out rule to set the group
owner to "iocard" as this is favoured by Debian.
The comedilib manual version is usually only updated if the manual has
changed since the previous release (although it ought to change anyway
if any library interfaces have changed). Allow a lower-case letter (or
sequence of letters) to be appended to the comedilib package version if
the only changes are outside the library sources and language bindings.
If something fails after a succesful open, cleanup fails to close the file.
The code
cleanup:
if(it)
free(it);
needs to be replaced with something like:
cleanup:
if (it) {
if (it->fd >= 0) {
close(it->fd);
}
free(it);
Regards
Anders Blomdell
The comedilib manual mentions the version of comedilib it applies to.
This is not done automatically; it is done by editing
"doc/comedilib.ent". Add a comment to configure.ac as a reminder.
In "comedilib.ent", Add an XML entity 'comedilib_version' expanding to
the Comedilib version '0.10.0'. This is hard-edited in rather than set
dynamically. Setting it dynamically would be nice but producing it from
an AC_OUTPUT() file isn't all that nice as it would end up in the
'build' tree and we'd some ugly 'make' rule to copy it to the 'source'
tree. For now, just edit it manually as required. At least having it
as an entity means it only needs to be set in a single documentation
file!
In "comedilib.xml", change the subtitle to mention Comedilib and the
version number, using the comediliv_version entity.
"Selecting master clock %d for channel %d on subdevice %d.\n"
The %d after subdevice was missing although the corresponding parameter
in the argument list was present.
I'm not sure if all man pages should go in the general 'man'
subdirectory or a more specific subdirectory, but as the general 'man'
subdirectory already contained a man page for comedi_config (which has
its own source subdirectory), I moved the man page for comedi_board_info
there for consistency.
Also changed the EXTRA_DIST line in man/Makefile.am.
There was a stray space before the "Returns:" heading so it wasn't
processed as intended. Also, there was an empty line above it leading
to an empty paragraph in the DocBook funcref.xml.
section. Both comedi_to_phys and comedi_to_physical complement
each other. Comedi_to_phys is linear and very fast whereas
comedi_to_physical is more precise but requires polynomials
and calibration data.
Change DocBook XSL parameters for HTML output to use numbered sections
(like it was before we switched from SGML to XML) and to use just the
numbers in cross references, rather than number and/or title.