Wykres commitów

25 Commity (1458d23c4229a9d9fa46f93a3859d501ec7aa149)

Autor SHA1 Wiadomość Data
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
Wolfram Sang 911be8af68 Merge branch 'cleanup_major_minor' into 'master'
treewide: use SANE_CURRENT_* macros consistently

See merge request sane-project/backends!632
2021-06-19 19:43:38 +00:00
Peter Seiderer 145e16008e backend/microtek: fix uclibc compile (include stdarg.h for va_list/va_start/va_end)
Fixes:

  microtek.c: In function ‘MDBG_INIT’:
  microtek.c:163:3: error: unknown type name ‘va_list’
    163 |   va_list ap;
        |   ^~~~~~~
  microtek.c:78:1: note: ‘va_list’ is defined in header ‘<stdarg.h>’; did you forget to ‘#include <stdarg.h>’?
     77 | #include "microtek.h"
    +++ |+#include <stdarg.h>
     78 |
  microtek.c:164:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration]
    164 |   va_start(ap, format);
        |   ^~~~~~~~
        |   sane_start
  microtek.c:165:54: warning: passing argument 4 of ‘vsnprintf’ makes pointer from integer without a cast [-Wint-conversion]
    165 |   vsnprintf(_mdebug_string, MAX_MDBG_LENGTH, format, ap);
        |                                                      ^~
        |                                                      |
        |                                                      int
  In file included from ../include/sane/sanei_config.h:50,
                   from microtek.c:70:
  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:359:57: note: expected ‘__va_list_tag *’ but argument is of type ‘int’
    359 |         const char *__restrict __format, __gnuc_va_list __arg)
        |                                          ~~~~~~~~~~~~~~~^~~~~
  microtek.c:166:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration]
    166 |   va_end(ap);
        |   ^~~~~~

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2021-06-18 19:51:45 +02: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
Povilas Kanapickas e40596c2a5 Fix -Wimplicit-fallthrough warnings by adding standard annotations 2019-06-30 11:58:32 +03:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
m. allan noah dbbcb61f09 microtek.c: add missing break (#314408) 2013-09-17 21:34:25 -04:00
Julien BLACHE 0cc56aa5bf microtek: fix signed/unsigned type mismatches 2010-06-23 18:21:32 +02: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
Alessandro Zummo b39c12dd7b Define MM_PER_INCH once for all 2009-06-18 15:54:49 +02: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 994bef3b16 reduce gcc pedantic/ansi warnings from 690 to 280 lines, mostly via casts in
str*() calls, also update hpljm1005 sane_cancel code
2008-02-04 01:20:01 +00:00
Mattias Ellert 49d756ca44 Fixing compiler warnings 2007-01-20 23:02:53 +00:00
Henning Geinitz af58065746 64 bit platform fixes (bug #300799). 2004-10-03 17:34:36 +00:00
Henning Geinitz 0e70e29baf Moved union Option_Value from backend header files to sanei_backend.h. No need
to copy it over and over again. Changed header inclusion order in backend
files to include backend.h after sanei_backend.h. Based on a patch from stef
<stef-listes@wanadoo.fr>.
2003-09-12 16:10:33 +00:00
Matto Marjanovic e1c7205510 2002-10-02 Matto Marjanovic <maddog@mir.com>
* doc/descriptions/microtek.desc: Updated version number.
	* backend/microtek.c:
	  Fixed bug in sane_read() [had failed to set return length to zero
           in non-STATUS_GOOD conditions].
	  Fixed bug in sane_set_io_mode() [had returned SANE_STATUS_UNSUPPORTED
           if blocking mode was requested].
	  Bumped version up to 0.13.1.
2002-10-02 05:05:15 +00:00
Matto Marjanovic 1e36da44df * doc/descriptions/microtek.desc:
Updated (status keywords, mostly).
	* backend/microtek.c:
	* backend/microtek.h:
	  Replaced fprintf()/printf() with various DBG() statements.
	  Removed #include <stdio.h>!
	  Eliminated a few "unused parameter" compiler warnings.
	  Updated the copyright date.
	  Bumped version up to lucky 0.13.0
2002-07-22 19:53:08 +00:00
Matto Marjanovic 8df583caba o Added support for Agfa StudioStar (weird pixel packing)
o A couple of small fixes (missing 'static' declarations)
o Upped version to 0.12.3
2001-05-23 22:50:26 +00:00
Matto Marjanovic 34f44f87cd Small fixes to microtek backend:
o Use 'expanded contrast/exposure settings' inquiry data to dynamically
   set ranges for those options.
 o Incorporate patches for Polaroid SprintScan 35LE  (from Dick Bruijn)
    - added "Polaroid" vendor string
    - screwed around with 'brightness' setting
    - attached 'negative scan' button
 o sane_exit() now frees the devlist allocated by sane_get_devices()
 o upped version to 0.12.2
2001-05-23 16:51:41 +00:00
Petter Reinholdtsen b4a1a513c9 Merge devel (v1.0.3) into head branch. 2000-08-12 15:11:46 +00:00
Petter Reinholdtsen 760423d864 Merged main branch with current DEVEL_1_9. 2000-03-05 13:57:25 +00:00
Petter Reinholdtsen 30ab5e718a Initial revision 1999-08-09 18:06:01 +00:00