From 58912f68c2489bcee787599837447e0d64dfd61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 24 May 2017 21:03:56 +0200 Subject: New upstream version 1.0.27 --- backend/dc25.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'backend/dc25.c') diff --git a/backend/dc25.c b/backend/dc25.c index 2c9e78c..fd7a0db 100644 --- a/backend/dc25.c +++ b/backend/dc25.c @@ -1308,7 +1308,7 @@ convert_pic (char *base_name, int format) { FILE *ifp; unsigned char pic[MAX_IMAGE_SIZE]; - int res, image_size, image_width, net_width, camera_header, components; + int res, image_width, net_width, components; struct pixmap *pp2; DBG (127, "convert_pic() called\n"); @@ -1374,10 +1374,8 @@ convert_pic (char *base_name, int format) * Setup image size with resolution */ - image_size = IMAGE_SIZE (res); image_width = WIDTH (res); net_width = image_width - LEFT_MARGIN - RIGHT_MARGIN (res); - camera_header = CAMERA_HEADER (res); components = (format & SAVE_24BITS) ? 3 : 1; /* @@ -1833,7 +1831,7 @@ change_res (int fd, unsigned char res) } SANE_Status -sane_init (SANE_Int * version_code, SANE_Auth_Callback UNUSEDARG authorize) +sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize) { char dev_name[PATH_MAX], *p; size_t len; @@ -1980,7 +1978,7 @@ static const SANE_Device dev[] = { SANE_Status sane_get_devices (const SANE_Device *** device_list, - SANE_Bool UNUSEDARG local_only) + SANE_Bool __sane_unused__ local_only) { static const SANE_Device *devlist[] = { dev + 0, 0 @@ -2555,7 +2553,7 @@ sane_start (SANE_Handle handle) SANE_Status -sane_read (SANE_Handle UNUSEDARG handle, SANE_Byte * data, +sane_read (SANE_Handle __sane_unused__ handle, SANE_Byte * data, SANE_Int max_length, SANE_Int * length) { DBG (127, "sane_read called, maxlen=%d\n", max_length); @@ -2724,15 +2722,15 @@ sane_read (SANE_Handle UNUSEDARG handle, SANE_Byte * data, } void -sane_cancel (SANE_Handle UNUSEDARG handle) +sane_cancel (SANE_Handle __sane_unused__ handle) { DBG (127, "sane_cancel() called\n"); started = SANE_FALSE; } SANE_Status -sane_set_io_mode (SANE_Handle UNUSEDARG handle, - SANE_Bool UNUSEDARG non_blocking) +sane_set_io_mode (SANE_Handle __sane_unused__ handle, + SANE_Bool __sane_unused__ non_blocking) { /* sane_set_io_mode() is only valid during a scan */ if (started) @@ -2754,7 +2752,7 @@ sane_set_io_mode (SANE_Handle UNUSEDARG handle, } SANE_Status -sane_get_select_fd (SANE_Handle UNUSEDARG handle, SANE_Int UNUSEDARG * fd) +sane_get_select_fd (SANE_Handle __sane_unused__ handle, SANE_Int __sane_unused__ * fd) { return SANE_STATUS_UNSUPPORTED; } -- cgit v1.2.3 From 1687222e1b9e74c89cafbb5910e72d8ec7bfd40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 31 Jul 2019 16:59:49 +0200 Subject: New upstream version 1.0.28 --- backend/dc25.c | 62 ++++++++++++++++++++++++++-------------------------------- 1 file changed, 28 insertions(+), 34 deletions(-) (limited to 'backend/dc25.c') diff --git a/backend/dc25.c b/backend/dc25.c index fd7a0db..3bb81f5 100644 --- a/backend/dc25.c +++ b/backend/dc25.c @@ -1,7 +1,7 @@ /*************************************************************************** * SANE - Scanner Access Now Easy. - dc25.c + dc25.c $Id$ @@ -43,13 +43,13 @@ If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. - If you do not wish that, delete this exception notice. + If you do not wish that, delete this exception notice. *************************************************************************** - This file implements a SANE backend for the Kodak DC-25 (and + This file implements a SANE backend for the Kodak DC-25 (and probably the DC-20) digital cameras. THIS IS EXTREMELY ALPHA CODE! - USE AT YOUR OWN RISK!! + USE AT YOUR OWN RISK!! (feedback to: dc25-devel@fales-lorenz.net) @@ -73,7 +73,7 @@ * conversion routine written by YOSHIDA Hideki * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published + * it under the terms of the GNU General Public License as published * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * @@ -148,12 +148,6 @@ static SANE_Byte contrast_table[256]; static struct pixmap *pp; -static const SANE_Range percentage_range = { - -100 << SANE_FIXED_SCALE_SHIFT, /* minimum */ - 100 << SANE_FIXED_SCALE_SHIFT, /* maximum */ - 0 << SANE_FIXED_SCALE_SHIFT /* quantization */ -}; - static const SANE_Range contrast_range = { 0 << SANE_FIXED_SCALE_SHIFT, /* minimum */ 3 << SANE_FIXED_SCALE_SHIFT, /* maximum */ @@ -352,9 +346,9 @@ static SANE_Parameters parms = { static unsigned char init_pck[] = INIT_PCK; /* - * List of speeds to try to establish connection with the camera. + * List of speeds to try to establish connection with the camera. * Check 9600 first, as it's the speed the camera comes up in, then - * 115200, as that is the one most likely to be configured from a + * 115200, as that is the one most likely to be configured from a * previous run */ static struct pkt_speed speeds[] = { {B9600, {0x96, 0x00}}, @@ -468,8 +462,8 @@ init_dc20 (char *device, speed_t speed) if (send_pck (tfd, init_pck) == -1) { /* - * The camera always powers up at 9600, so we try - * that first. However, it may be already set to + * The camera always powers up at 9600, so we try + * that first. However, it may be already set to * a different speed. Try the entries in the table: */ @@ -594,7 +588,7 @@ get_info (int fd) { /* Not sure where the previous line came from. All the * information I have says that even on the DC20 the number of - * standard res pics left is in byte 23 and the number of high res + * standard res pics left is in byte 23 and the number of high res * pics left is in byte 21. It seems to me that the conservative * approach is to report the number of high res pics left. */ @@ -1114,7 +1108,7 @@ if (verbose) printf ("%s: determine_limits: low_i = %d, high_i = %d\n", __progna /* * The original dc20ctrl program used a default gamma of 0.35, but I thougt - * 0.45 looks better. In addition, since xscanimage seems to always force + * 0.45 looks better. In addition, since xscanimage seems to always force * a resolution of 0.1, I multiply everything by 10 and make the default * 4.5. */ @@ -1689,8 +1683,8 @@ shoot (int fd) cfsetispeed (&tty_temp, B9600); cfsetospeed (&tty_temp, B9600); - /* - * Apparently there is a bug in the DC20 where the response to + /* + * Apparently there is a bug in the DC20 where the response to * the shoot request is always at 9600. The DC25 does not have * this bug, so we skip this block. */ @@ -1728,7 +1722,7 @@ shoot (int fd) { if (CameraInfo.model == 0x25) { - /* + /* * If we don't put this in, the next read will time out * and return failure. Does the DC-20 need it too? */ @@ -1771,7 +1765,7 @@ erase (int fd) * This block may really apply to the DC20 also, but since I * don't have one, it's hard to say for sure. On the DC25, erase * takes long enought that the read may timeout without returning - * any data before the erase is complete. We let this happen + * any data before the erase is complete. We let this happen * up to 4 times, then give up. */ while (count < 4) @@ -2121,7 +2115,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (dc25_opt_thumbnails) { - /* + /* * DC20 thumbnail are 80x60 grayscale, DC25 * thumbnails are color. */ @@ -2200,7 +2194,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, /* * erase and erase_one are mutually exclusive. If - * this one is turned on, the other must be off + * this one is turned on, the other must be off */ if (dc25_opt_erase && dc25_opt_erase_one) { @@ -2214,7 +2208,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, /* * erase and erase_one are mutually exclusive. If - * this one is turned on, the other must be off + * this one is turned on, the other must be off */ if (dc25_opt_erase_one && dc25_opt_erase) { @@ -2350,7 +2344,7 @@ sane_start (SANE_Handle handle) { /* - * Don't allow picture unless there is room in the + * Don't allow picture unless there is room in the * camera. */ if (CameraInfo.pic_left == 0) @@ -2359,7 +2353,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_INVAL; } - /* + /* * DC-20 can only change resolution when camer is empty. * DC-25 can do it any time. */ @@ -2403,7 +2397,7 @@ sane_start (SANE_Handle handle) /* * For thumbnails, we can do things right where we - * start the download, and grab the first block + * start the download, and grab the first block * from the camera. The reamining blocks will be * fetched as necessary by sane_read(). */ @@ -2421,7 +2415,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_INVAL; } - /* + /* * DC20 thumbnail are 80x60 grayscale, DC25 * thumbnails are color. */ @@ -2439,10 +2433,10 @@ sane_start (SANE_Handle handle) { /* * We do something a little messy, and violates the SANE - * philosophy. However, since it is fairly tricky to + * philosophy. However, since it is fairly tricky to * convert the DC2x "comet" files on the fly, we read in * the entire data stream in sane_open(), and use convert_pic - * to convert it to an in-memory pixpmap. Then when + * to convert it to an in-memory pixpmap. Then when * sane_read() is called, we fill the requests from * memory. A good project for me (or some kind volunteer) * would be to rewrite this and move the actual download @@ -2450,7 +2444,7 @@ sane_start (SANE_Handle handle) * this way is that the data comes down pretty fast, and * it helps to dedicate the processor to this task. We * might get serial port overruns if we try to do other - * things at the same time. + * things at the same time. * * Also, as a side note, I was constantly getting serial * port overruns on a 90MHz pentium until I used hdparm @@ -2634,7 +2628,7 @@ sane_read (SANE_Handle __sane_unused__ handle, SANE_Byte * data, int i; int filesize = parms.bytes_per_line * parms.lines; - /* + /* * If outbytes is zero, then this is the first time * we've been called, so update the contrast table. * The formula is something I came up with that has the @@ -2642,10 +2636,10 @@ sane_read (SANE_Handle __sane_unused__ handle, SANE_Byte * data, * 1) It's a smooth curve that provides the effect I wanted * (bright pixels are made brighter, dim pixels are made * dimmer) - * 2) The contrast parameter can be adjusted to provide + * 2) The contrast parameter can be adjusted to provide * different amounts of contrast. * 3) A parameter of 1.0 can be used to pass the data - * through unchanged (but values around 1.75 look + * through unchanged (but values around 1.75 look * a lot better */ if (outbytes == 0) -- cgit v1.2.3 From ffa8801644a7d53cc1c785e3450f794c07a14eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 2 Feb 2020 17:13:01 +0100 Subject: New upstream version 1.0.29 --- backend/dc25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/dc25.c') diff --git a/backend/dc25.c b/backend/dc25.c index 3bb81f5..6188608 100644 --- a/backend/dc25.c +++ b/backend/dc25.c @@ -2030,7 +2030,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) if (tmpname == NULL) { tmpname = tmpnamebuf; - if (mktemp (tmpname) == NULL) + if (!mkstemp (tmpname)) { DBG (1, "Unable to make temp file %s\n", tmpname); return SANE_STATUS_INVAL; -- cgit v1.2.3