Wykres commitów

52 Commity (2ae58b0e6f15fca44984839c4e7dd6a9bb854b0b)

Autor SHA1 Wiadomość Data
Ralph Little 31a09f5500 various: convert pre-ANSI declarations to ANSI
Newer clang deprecates the pre-ANSI way to declare functions with no args.
This breaks recent Fedora CI images.
2024-09-05 22:17:27 -07:00
Ralph Little 6fc47c4c14 test: added validation checks for config string option saelections.
This will avoid a reported buffer overflow issue related to invalid (long) options being specified.
2023-10-02 16:23:07 -07:00
Ralph Little 3f45d4d19e test: fix type issue. proper type for usleep() is useconds_t. 2022-06-19 16:02:18 -07:00
Christian Theis 1aead16faf enable test backend to scan high res images 2022-05-29 20:52:51 +01: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
Ralph Little 3a5f128e8a Add int_inexact option to test SANE_INFO_INEXACT. 2021-10-14 14:47:51 +00:00
Wolfram Sang eb42ad08d5 treewide: use SANE_CURRENT_* macros consistently
Backends use a mixture of SANE_CURRENT_{MAJOR | MINOR} and V_{MAJOR |
MINOR} with all kind of permutations. I was confused by this and one
comment in pieusb.c tells me I was not alone. Some items in old
changelogs suggest to use the SANE_CURRENT_ macros in backends, so let's
switch to do that with the exception of net.c and dll.c. Done with:

$ find backend -name '*.[ch]' | xargs sed -i '/nearly every/ ! { s/\<V_M/SANE_CURRENT_M/g }'
$ git checkout backend/net.c backend/dll.c

And manually removing the comment from pieusb.c. Everything still builds
fine.
2021-06-08 19:01:41 +02:00
Olaf Meeuwissen e79adde8b2
Use URL to refer users to copies of the GPL and LGPL
With the exception of use in three quotes as well as our inlcuded copy
of the GPL, all use of the Free Software Foundation's postal address
has been removed.

Re #320.
2021-02-12 17:41:38 +09:00
Fletcher Woodruff 6fe222ed29 test: do not leak initial values of string options
The default values for string options are set using static (i.e.
non-malloced) strings. Later, if new values are loaded from the config
file, those SANE_Strings will then point to dynamically allocated memory
which is eventually leaked.

Change the initial values for the string options to NULL, and initialize
them to the proper values within sane_init() using strdup(). This way,
whenever the value for the string is changed, we can safely free() the
previous value.

This eliminates the other main source of memory leaks in the test backend.

This patch also updates sane_init for the test backend to properly cleanup
memory if it fails.
2020-10-19 09:48:49 -06:00
Fletcher Woodruff f71ac6126f test: free memory used for string options
Inside Test_Device, track whether we've already called init_options().
If we have, don't call it again when calling sane_open() again.

Add a function cleanup_options() which frees the memory used for these
options, and call it in sane_exit() if we previously called
init_options().

Change Test_Devices to be initialized with calloc instead of malloc,
so that we can assume that uninitialized fields are NULL, and can safely
call free() on them unconditionally.

This eliminates some larger memory leaks within the test backend.
2020-10-19 09:48:36 -06:00
Kåre Särs 5683aab66b Add gamma test options 2020-07-26 09:39:23 +00:00
Olaf Meeuwissen df1aba21bc SANE_Pid: Fix [-Wint-conversion] issues
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.
2017-07-15 14:47:54 +09:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
Olaf Meeuwissen e094c5b43b Invert sense of sanei_thread validity check
Double negatives suck.
2015-11-24 18:19:31 +09:00
Olaf Meeuwissen fe12d31e68 Fix SANE_Pid related -Wsign-compare warnings
This may fix threading related issues on WIN32 platforms, BTW.
2015-11-24 18:19:31 +09:00
Stéphane Voltz 1f1385ea67 fix memleaks in pnm backend
- fix memleaks reported in bug #313553
2015-08-08 21:31:05 +02:00
Mark Buda c591d2b7da Correction of some spelling/grammatical errors in source code 2014-05-15 22:04:37 -04:00
m. allan noah ff048f4176 add three new SANE_VALUE macros and use mode name macros from saneopts.h 2010-02-10 23:48:21 -05:00
chris@cnpbagwell.com 4d9e8138af standardize including local sane/ include files.
Source code was inconsistent on how they were referencing
include files in include/sane.  In certain cases, sane/sane.h
and sane/saneopts.h was really including external copies (with
some preprocessor implementations anyways).
2009-05-07 22:06:20 -05:00
Chris Bagwell 70f3fdfba4 * acinclude.m4, backend/*.[ch], tools/*.[ch], frontend/*.[ch]:
Global replace of u_int??_t with C9x standard based uintxx_t
 in order to remove some tricky and overlapping portability logic
 from acinclude.m4 and leave it in only m4/stdint.m4.
2009-02-26 03:15:43 +00:00
m. allan noah 91598aa800 * backend/*.[ch]: nearly every backend used V_MAJOR
instead of SANE_CURRENT_MAJOR in sane_init()
* backend/snapscan.c: remove EXPECTED_VERSION check
since new SANE standard is forward compatible
2008-11-26 21:21:31 +00:00
m. allan noah 8733651c4b test backend checks for options that have not been loaded before being controlled 2008-06-26 13:14:23 +00:00
Mattias Ellert d5ae0bbc3d Fix for bug #306751: sanei-thread with pthreads on 64 bit 2008-05-15 12:50:25 +00:00
Mattias Ellert 7c6b4d6a99 Fix handling of valid "negative" PIDs 2007-11-18 10:59:18 +00:00
Mattias Ellert abd402ad51 Correct the test of the return value from sanei_thread_begin 2007-11-16 08:04:02 +00:00
Henning Geinitz 7b03fc2168 Added option "source" which can be used to simulate an Automatic Document Feeder
(ADF). Added copyright header to test.h.
2006-01-02 22:55:44 +00:00
Henning Geinitz 8e367bc2da Fixed typo. 2004-10-10 13:08:40 +00:00
Henning Geinitz af58065746 64 bit platform fixes (bug #300799). 2004-10-03 17:34:36 +00:00
Gerard Klaver a2f4f13f7a Some opt_groups and options have not the same menu values (od->cap):
For the opt_bool_group, opt_int_group and opt_fixed_group: changed od->cap = 0; to od->cap = SANE_CAP_ADVANCED;
2004-04-06 20:18:41 +00:00
Gerhard Jaeger 09153449b7 reader_process terminates now, when running as thread. 2004-01-21 19:02:52 +00:00
Henning Geinitz a16dfafd6a Fixed initial value for --fixed-constraint-range (bug #300388). 2003-12-21 20:59:59 +00:00
Gerhard Jaeger e36fac9d88 Removed blocking SIGPIPE, as this is now handled in sanei_thread library. 2003-10-17 11:06:43 +00:00
Henning Geinitz d63c6321a6 Reindented. 2003-10-17 09:44:20 +00:00
Henning Geinitz cc8a3875ca Fixed cancelling when threads are used. Only SIGPIPE is blocked now. Sleep
indefinetly after the reader_process has finished. Minor fixes of debug
messages.
2003-10-13 18:03:40 +00:00
Gerhard Jaeger 6dd1661a65 removed OS/2 section. 2003-10-12 15:39:38 +00:00
Gerhard Jaeger a1ec707aee added sanei_thread support 2003-10-08 20:32:39 +00:00
Henning Geinitz 345401d726 Fixed some missing or duplicated spaces in option descriptions. 2003-10-05 11:43:20 +00:00
Henning Geinitz 982ef90ed4 Some options had wrong constraints or didn't match their descriptions (bug
#300235).
2003-09-28 22:19:22 +00:00
Henning Geinitz 9a6faa5046 Check if sanei_config_get_string fails because of a single quotation mark
in the configuration file.
2003-09-21 10:42:15 +00:00
Henning Geinitz 04dd7d101f Added support for OS/2 (from Franz Bakan <fbakan@gmx.net>). 2003-04-10 08:36:10 +00:00
Henning Geinitz 85dddb6ca0 Use "Color pattern" consistantly. 2003-01-24 14:00:11 +00:00
Henning Geinitz f63abd633e Make sure that frontend bugs concerning the select fd are detected. 2002-12-30 13:44:27 +00:00
Henning Geinitz 61a9534ac0 Minor spelling and translation fixes. 2002-12-05 09:17:19 +00:00
Henning Geinitz 991bd09675 Fixed PACKAGE_VERSION breakage. PACKAGE_VERSION was redefined by autoconf 2.5
with a different meaning. Use PACKAGE_STRING instead.
2002-11-29 18:19:58 +00:00
Henning Geinitz ba484e4b21 Explicitely close the pipe and wait until reader_process is killed. 2002-10-27 14:17:17 +00:00
Henning Geinitz 2958f7a844 Fixed bytes_per_line in 1 bit mode. Fixed 1 bit color three-pass mode
(grid). Changed bit order for 1 bit color to most significant bit is first
pixel.
2002-09-30 13:54:02 +00:00
Henning Geinitz 2c16e3308b Added option invert-endianess to test 16 bit modes.
Henning Meier-Geinitz <henning@meier-geinitz.de>
2002-07-24 19:57:56 +00:00
Henning Geinitz 1e582217c0 Added support for lineart mode with pixels_per_line not divisible by 8. Added
support for padded image formats. Added documentation for all options.
Henning Meier-Geinitz <henning@meier-geinitz.de>
2002-06-09 17:44:20 +00:00
Henning Geinitz f28fc112e0 Check return value of waitpid. Don't evaluate status of children if waitpid
wasn't successful.
Henning Meier-Geinitz <henning@meier-geinitz.de>
2002-05-05 13:15:49 +00:00
Henning Geinitz f01f026fc4 Check if sane_init was called before any other SANE function.
Henning Meier-Geinitz <henning@meier-geinitz.de>
2002-04-21 12:56:54 +00:00