Building with --enable-silent-rules makes it easier to identify errors
or warnings in the build output. Automake provides macros for custom
rules to use, so that they will print a similar message to rules which
run the compiler or linker:
...
CC libpieusb_la-pieusb.lo
CCLD libpieusb.la
CCLD libsane-pieusb.la
CC libsane_pixma_la-pixma-s.lo
GEN pixma/pixma_sane_options.h
GEN pixma/pixma_sane_options.c
CC pixma/libpixma_la-pixma.lo
...
This does not change the current output if silent rules are disabled.
malloc returns NULL on error, but this code errors out on the non-NULL pointer
indicating success (which essentially makes this function always fail).
Signed-off-by: Raphael Isemann <teemperor@gmail.com>
Windows does not allow filenames ending in a period ("."), preventing
this git repository from even being checked out on a Windows system.
Drop the trailing period in these two filenames. Both files will still
be skipped during the build, since they are not included in DESC_FILES
or DESC_EXT_FILES in doc/Makefile.am.
Mainly consists of removing code for #ifdef __KERNEL__
In order to keep it really clear what code has been removed, I have
not corrected any formatting issues.
GCC warns that an unsigned value is passed to abs(), which may not be
intended. To resolve this warning, adjust the code so abs() is not used
and the behavior is more explicit.
If the weights file pathname is longer than PATH_MAX, it may be written
past the end of the buffer on the stack; or it may be truncated when it
is written to allocated memory (such that it is not null-terminated).
Adjust the code to fix both issues. Dynamically allocate memory for the
actual length of the pathname so that it is not constrained by PATH_MAX.
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.