The substitute completely ignores the fdtype argument and only works
correctly for S_IFSOCK values. This happened to be the only way the
function was invoked but for safety's sake this has been replaced by
a local implementation that does pretty much the same thing, without
the misleading bit.
Found courtesy of a [-Wunused-parameter] compiler warning on Alpine.
The sanei_thread implementation assumes an integer type in case of
pthread based thread support. As anything else is unlikely to work
correctly, it's safer to just fall back to forked processes.
Not all pthreads implementations use an integer type for pthread_t.
As a matter of fact, POSIX has explicitly withdrawn the requirement
that it must be an arithmatic type.
The musl C library uses a `struct __pthread *` which triggered the
warnings. As of this change, sanei_thread.h works around this by
providing two new macros to help keep this issue out of sight. All
backends have been changed to use these macros.
The readdir_r() using loop in sanei_scsi_find_devices() has been
modified to use readdir().
With the exception of sane_cancel(), the SANE API is not re-entrant.
The sanei_scsi_find_devices() function is referenced neither directly
nor indirectly from any of the sane_cancel() implementations so there
is no inherent need to use readdir_r().
The warning reads:
enumerator value for '_PS_INP_MIO6' is not an integer constant
expression
and that comes about as _PS_INP_MIO6 evaluates to 0x8000000, which
does not fit in the *signed* integer range which has been allotted
to enumeration constants by ISO C99.
Seeing that the _PS_INP* values appear to be bitflags (despite the
arithmatic additions in backend/plustek-usbdev.c!) it is safer to
use #defines instead of an enum.
The indentation has been aligned what is used inside the while loop.
The function appears to have been copied from elsewhere and slightly
modified.
The msg variable is set to NULL inside the if branch for efficiency
only.
The u8_range and threshold_percentage_range constants have not been
used for anything ever since the backend's addition. They probable
ended up in the code as a result of copy-and-paste.
The const variables' definition has been #ifdef'd to prevent loss of
protocol info.
Neither scsi_area_and_windows nor scsi_lookup_table appear to have
been used for anything.