summaryrefslogtreecommitdiff
path: root/backend/qcam.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-16 10:20:08 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-16 10:20:08 +0100
commit778ebf8ee9cb22ea5727844333bcd5a6ee6bc0de (patch)
treea754e785b286ed82b45fe4e50b980714ad80e0a7 /backend/qcam.c
parent7d8aac1f3634dc58785bec7acf097dd6bac8c394 (diff)
parent32cb765f681299af226ca0520993cbe47ba5ecd0 (diff)
Merge branch 'release/debian/1.2.1-1'debian/1.2.1-1
Diffstat (limited to 'backend/qcam.c')
-rw-r--r--backend/qcam.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/backend/qcam.c b/backend/qcam.c
index 9d55055..8e302e9 100644
--- a/backend/qcam.c
+++ b/backend/qcam.c
@@ -191,23 +191,13 @@ static const SANE_Range odd_bw_x_range = { 1, 335, 2 };
static const SANE_Range bw_y_range = { 0, 241, 1 };
static const SANE_Range odd_bw_y_range = { 1, 242, 1 };
-#if defined(HAVE_SYS_IO_H) || defined(HAVE_ASM_IO_H) || defined (HAVE_SYS_HW_H)
-
-#ifdef HAVE_SYS_IO_H
-# include <sys/io.h> /* GNU libc based OS */
-#elif HAVE_ASM_IO_H
-# include <asm/io.h> /* older Linux */
-#elif HAVE_SYS_HW_H
-# include <sys/hw.h> /* OS/2 */
-#endif
-
-#endif /* <sys/io.h> || <asm/io.h> || <sys/hw.h> */
+#include "../include/sane/sanei_directio.h"
-#define read_lpdata(d) inb ((d)->port)
-#define read_lpstatus(d) inb ((d)->port + 1)
-#define read_lpcontrol(d) inb ((d)->port + 2)
-#define write_lpdata(d,v) outb ((v), (d)->port)
-#define write_lpcontrol(d,v) outb ((v), (d)->port + 2)
+#define read_lpdata(d) sanei_inb ((d)->port)
+#define read_lpstatus(d) sanei_inb ((d)->port + 1)
+#define read_lpcontrol(d) sanei_inb ((d)->port + 2)
+#define write_lpdata(d,v) sanei_outb ((d)->port, (v))
+#define write_lpcontrol(d,v) sanei_outb ((d)->port + 2, (v))
static SANE_Status
@@ -217,7 +207,7 @@ enable_ports (QC_Device * q)
if (q->port < 0x278 || q->port > 0x3bc)
return SANE_STATUS_INVAL;
- if (ioperm (q->port, 3, 1) < 0)
+ if (sanei_ioperm (q->port, 3, 1) < 0)
return SANE_STATUS_INVAL;
return SANE_STATUS_GOOD;
@@ -226,7 +216,7 @@ enable_ports (QC_Device * q)
static SANE_Status
disable_ports (QC_Device * q)
{
- if (ioperm (q->port, 3, 0) < 0)
+ if (sanei_ioperm (q->port, 3, 0) < 0)
return SANE_STATUS_INVAL;
return SANE_STATUS_GOOD;
@@ -1454,7 +1444,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
char dev_name[PATH_MAX], *str;
size_t len;
FILE *fp;
- authorize = authorize; /* silence compilation warnings */
+ (void) authorize; /* silence compilation warnings */
DBG_INIT ();
@@ -1521,7 +1511,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
DBG (5, "sane_get_devices: enter\n");
- local_only = local_only; /* silence compilation warnings */
+ (void) local_only; /* silence compilation warnings */
if (devlist)
free (devlist);
@@ -2129,7 +2119,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
len = s->bytes_per_frame - s->num_bytes;
DBG (8, "read(buf=%p,num_bytes=%ld,max_len=%d,len=%ld)\n",
- buf, (long) s->num_bytes, max_len, (long) len);
+ (void *) buf, (long) s->num_bytes, max_len, (long) len);
nread = read (s->read_fd, buf, len);
if (nread <= 0)