Wykres commitów

12505 Commity (9ce70f06c844a11616044f9cf0b43316d3aa7ccc)

Autor SHA1 Wiadomość Data
David Ward 2efdd5a334 plustek: Adjust gain calculation to avoid calling labs()
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.
2022-03-08 19:00:00 -05:00
David Ward 5576d03afd genesys: Fix forward declaration for type UsbDeviceEntry
This did not match the definition, causing a compiler warning.
2022-03-08 19:00:00 -05:00
David Ward 6048724f22 coolscan2, coolscan3: Fix initialization of enum members in struct
GCC warns when setting an enum member to 0 without an explicit cast.
Use the corresponding value in the enum type instead.
2022-03-08 19:00:00 -05:00
David Ward 47fd7538bc Remove set but unused variables which cause compiler warnings 2022-03-08 19:00:00 -05:00
David Ward a82a312d85 Remove unused functions which cause compiler warnings 2022-03-08 19:00:00 -05:00
David Ward 0d032cd982 Remove useless conditionals which cause compiler warnings
These always evaluate to true in the context of the surrounding code.
2022-03-08 19:00:00 -05:00
David Ward b3d105cba5 Use snprintf() instead of strncpy() for space-padded strings
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.
2022-03-08 19:00:00 -05:00
David Ward 6a16e78788 Use strdup()/strndup() instead of direct allocation and string copy
Otherwise, GCC warns about possible string truncation. This simplifies
the code here as well.
2022-03-08 19:00:00 -05:00
David Ward 3c3a247d25 Replace deprecated uint32 with uint32_t 2022-03-08 19:00:00 -05:00
David Ward db573b74ed Fix format specifiers to match arguments' data types 2022-03-08 19:00:00 -05:00
David Ward 1a933bba7e Cast pointer arguments if needed when using "%p" format specifier
Pointer arguments must have type (void *) when printed with the format
specifier "%p".
2022-03-08 19:00:00 -05:00
David Ward f3162bafa8 Replace variable self-assignments to avoid Clang warnings
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.
2022-03-08 19:00:00 -05:00
David Ward 6be83f469b Resolve compiler warnings about misleading indentation
This change is targeted at specific lines of code reported by GCC or
Clang as potentially causing unintended behavior.
2022-03-08 19:00:00 -05:00
David Ward 6cc15e2b81 Adjust conditional expressions to resolve compiler warnings 2022-03-08 19:00:00 -05:00
David Ward 2955089cd9 Fix conditional expressions with unintended behavior 2022-03-08 19:00:00 -05:00
David Ward 1458d23c42 umax: Fix unintended string concatenation in array definition
This causes the wrong error message to be used in the log.
2022-03-08 19:00:00 -05:00
David Ward bfa69c26e6 snapscan: Fix debug logging in sense_handler()
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.
2022-03-08 19:00:00 -05:00
David Ward 23addf5590 sm3840: Fix argument types for variadic function
Values of type unsigned char are automatically promoted to a larger
integer type, so they cannot be used as variadic function arguments.
2022-03-08 19:00:00 -05:00
David Ward 4cf3b09e49 rts8822, rts8891: Replace abs() with fabs() where needed
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.
2022-03-08 19:00:00 -05:00
David Ward e859ea4d89 pieusb: Add missing calls to sanei_pieusb_convert_status()
Fix cases where values of type PIEUSB_Status were used or returned when
the expected type was SANE_Status.
2022-03-08 19:00:00 -05:00
David Ward f8785fb6a8 mustek_pp: Handle status argument correctly in pa4s2_init()
Currently the pointer itself is overwritten, when it is intended that
the pointer be derefenced first.
2022-03-08 19:00:00 -05:00
David Ward f651d6f098 microtek: Fix null termination of string, and adjust buffer lengths
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.
2022-03-08 19:00:00 -05:00
Ordissimo 9cd8f475eb Merge branch 'escl-add-canon-ts-3400-series' into 'master'
escl: Add canon TS-3400 series

See merge request sane-project/backends!700
2022-03-08 08:59:43 +00:00
Ordissimo 84a39145e4 escl: Add canon TS-3400 series 2022-03-08 08:59:43 +00:00
David Ward a519a3529a mustek_usb2: Replace STATUS type with SANE_Status
In some cases, a return value with type SANE_Status was assigned to a
variable with type STATUS. It is easiest to remove the redundant type
here.
2022-03-02 21:16:47 -05:00
David Ward e1a319e729 descriptions: Resolve multiple warnings from sane-desc
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".
2022-03-02 21:16:33 -05:00
Ralph Little 41866df6e1 genesys: fix for computation of total file size exceeding unsigned
Large scans that exceed 32-bits need cast to allow 64-bit size.
2022-02-27 18:55:26 -08:00
Ralph Little 4091619e07 Merge branch '577-add-plustek' into 'master'
Resolve "Issues making on osx"

Closes #577

See merge request sane-project/backends!696
2022-02-25 02:31:18 +00:00
Ralph Little 9512d05fe6 genesys: added conf entry for Plustek OpticFilm 7600i
User reports scanner works fine, but entry missing from config.
2022-02-22 16:22:23 -08:00
Ralph Little aa153e52c8 Merge branch '577-issues-making-on-osx' into 'master'
Resolve "Issues making on osx"

Closes #577

See merge request sane-project/backends!694
2022-02-22 17:37:48 +00:00
Ralph Little 047fa8498f Resolve "Issues making on osx" 2022-02-22 17:37:48 +00:00
Ralph Little f6594ed040 Merge branch '573-hp5590-read-only-values-aren-t-accessible-via-cli-options-unrecognized-option' into 'master'
Resolve "[hp5590] Read only values aren't accessible via CLI options (unrecognized option)"

Closes #573

See merge request sane-project/backends!693
2022-02-21 22:13:28 +00:00
Ralph Little a0ca5a4fc4 Resolve "[hp5590] Read only values aren't accessible via CLI options (unrecognized option)" 2022-02-21 22:13:28 +00:00
Ralph Little 0a3b043e8e doc: additional small changes to man pages. 2022-02-21 13:19:53 -08:00
Ralph Little d6419c2490 doc: cosmetic corrections to man pages from translator review 2022-02-20 18:23:59 -08:00
Ralph Little 312edd6d5f doc: Added Plustek OpticSlim 550 description, unsupported as yet 2022-02-19 14:25:13 -08:00
Ralph Little b701c499c9 Merge branch 'sane-find-scanner-output' into 'master'
sane-find-scanner: Improve output for possible USB scanners

Closes #575

See merge request sane-project/backends!691
2022-02-17 16:48:23 +00:00
David Ward 9daadb8512 sane-find-scanner: Improve output for possible USB scanners
Closes #575
2022-02-17 09:16:30 -05:00
Ralph Little 3c3e898c5e Merge branch 'fix-install-exec-target' into 'master'
backend/Makefile: Fix installation of backend libraries

See merge request sane-project/backends!690
2022-02-07 20:58:45 +00:00
David Ward ba07a8a7f5 backend/Makefile: Fix installation of backend libraries
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*.
2022-02-06 23:02:01 -05:00
Povilas Kanapickas b68172cbd2 Merge branch 'release-1.1.x-genesys-gl845-crash' into 'release-1.1.x'
[Release 1.1.x] genesys: GL845 has vector size 257 as well

See merge request sane-project/backends!689
2022-01-28 20:57:55 +00:00
Povilas Kanapickas e1f1273d23 Merge branch 'genesys_gl845_crash' into 'master'
genesys: GL845 has vector size 257 as well

See merge request sane-project/backends!688
2022-01-28 20:54:52 +00:00
Povilas Kanapickas 1a8a86bade genesys: Simplify gamma buffer setup
This also makes sure that we never access the source gamma tables out of
bounds which was possible previously.
2022-01-28 22:42:31 +02:00
Povilas Kanapickas fb41d3ca04 genesys: Simplify interface of generate_gamma_buffer() 2022-01-28 22:41:10 +02:00
Zdenek Dohnal aeb60735c1 genesys: GL845 has vector size 257 as well
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2042316
2022-01-28 22:39:56 +02:00
Povilas Kanapickas 2f17613dbb genesys: Simplify gamma buffer setup
This also makes sure that we never access the source gamma tables out of
bounds which was possible previously.
2022-01-28 22:39:26 +02:00
Povilas Kanapickas 188cf63627 genesys: Simplify interface of generate_gamma_buffer() 2022-01-28 22:39:26 +02:00
Zdenek Dohnal d8ebd5a4d7 genesys: GL845 has vector size 257 as well
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2042316
2022-01-28 22:31:09 +02:00
Povilas Kanapickas e3b5a9686f Merge branch 'release-notes-1.1.1' into 'master'
NEWS: Release notes for 1.1.1

See merge request sane-project/backends!687
2022-01-28 20:02:25 +00:00
Povilas Kanapickas c46f006209 NEWS: Release notes for 1.1.1
(cherry picked from commit a00a5f2f2c)
2022-01-20 00:08:17 +02:00