labs() has a signed parameter. However the argument to it here was the
difference between two unsigned values, which itself remains unsigned.
GCC warned that using this in labs() might not have the intended result.
By definition though, dwInc >= m_dwIdealGain >= dwDec, so labs() is not
even needed in this expression.
The output from the SCSI inquiry command uses fixed-length space-padded
strings, which are copied into null-terminated strings before use.
This is currently done using strncpy(), with the count parameter set to
the string's fixed length. Because a null terminator is not encountered
in the input, strncpy() does not write one in the output, and GCC warns
about potential string truncation. A null terminator is added manually,
but this is error prone (as shown by the fix for the microtek backend).
Use snprintf() instead, which guarantees a null-terminated result and
resolves the warnings from GCC.
These were intended to suppress GCC warnings about unused variables.
However, this leads to different warnings from Clang instead.
Use another approach that suppresses warnings from both compilers.
Remove an extraneous log message.
Ensure that a separate log message is only printed when the preceding
if-statement is true (and its string argument has actually been set).
Both issues were identified from GCC warnings about indentation.
abs() has an integer parameter and returns an integer value. Floating-
point values should be passed to fabs() instead.
In particular, this affected calculations for gain and offset, where a
value with floating-point precision is clearly expected.
The Product Revision Level field in the SCSI inquiry data has a fixed
length of 4 bytes. When copying it as a null-terminated string, place
the null terminator in the correct position; currently the string has
an extra character that is never initialized in memory.
Reduce the length of each string buffer, so it does not extend beyond
the null terminator.
Fix the USB VID/PID in device descriptions to use lowercase hex digits.
Remove an extraneous description, having no name or USB VID, from the
epsonds file. Remove an extraneous interface in the description for the
Brother MFC-J1300DW.
Additionally, fix mispellings of "Flatbed" and "WiFi".
When using Automake variables like sanelib* to install files in a custom
directory, the files are assumed to be platform-independent, unless these
variables contain "exec" in the name. This affects whether the files are
installed during "make install-data" or "make install-exec". It does not
matter whether a suffix like _DATA or _LTLIBRARIES is added to this name.
The packaging scripts for Debian call those Makefile targets separately
and are affected by this behavior. Since the backend libraries themselves
are platform-dependent files, rename these variables to execsanelib*.