From d6789dfbd0710f250566437238952dafd1877890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Voltz?= Date: Tue, 5 Nov 2002 05:40:03 +0000 Subject: [PATCH] umax_pp_low.c: build fix for OS/2 umax_pp_mid.c: indent --- ChangeLog | 5 +++++ backend/umax_pp_low.c | 31 ++++++++++++++++++------------- backend/umax_pp_mid.c | 24 ++++++++++++------------ 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4a122762..a0af0eb2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Stéphane Voltz + + * backend/umax_pp.c backend/umax_pp_mid.c : OS/2 compile fix, indent + correction + 2002-11-03 Karl Heinz Kremer * sanei/sanei_usb.c: Use endpoint address with direction information diff --git a/backend/umax_pp_low.c b/backend/umax_pp_low.c index f3f798845..439ce8f18 100644 --- a/backend/umax_pp_low.c +++ b/backend/umax_pp_low.c @@ -402,9 +402,9 @@ int sanei_umax_pp_InitPort (int port, char *name) { int fd, ectr; - int found = 0; + int found = 0, ecp = 0; #if ((defined HAVE_IOPERM)||(defined HAVE_LINUX_PPDEV_H)) - int mode,ecp=0; + int mode; #endif #ifdef HAVE_LINUX_PPDEV_H char strmodes[160]; @@ -433,7 +433,8 @@ sanei_umax_pp_InitPort (int port, char *name) { /* ppdev opening and configuration */ found = 0; - fd = open (name, O_RDWR | O_NOCTTY | O_NONBLOCK); + /*fd = open (name, O_RDWR | O_NOCTTY | O_NONBLOCK); */ + fd = open (name, O_RDWR | O_NOCTTY); if (fd < 0) { switch (errno) @@ -536,7 +537,7 @@ sanei_umax_pp_InitPort (int port, char *name) } else { - ecp=1; + ecp = 1; DBG (16, "umax_pp: mode set to PARPORT_MODE_ECP for '%s'\n", name); @@ -632,15 +633,15 @@ sanei_umax_pp_InitPort (int port, char *name) /* frob_econtrol (port, 0xe0, 4 << 5); unsigned char ectr = inb (ECONTROL (pb)); outb ((ectr & ~m) ^ v, ECONTROL (pb)); */ - if(ecp) - { - ectr = Inb (ECPCONTROL); - if (ectr != 0xFF) + if (ecp) { - ectr = (ectr & ~(0xE0)) ^ (4 << 5); - Outb (ECPCONTROL, ectr); + ectr = Inb (ECPCONTROL); + if (ectr != 0xFF) + { + ectr = (ectr & ~(0xE0)) ^ (4 << 5); + Outb (ECPCONTROL, ectr); + } } - } #endif /* IO_SUPPORT_MISSING */ @@ -1655,6 +1656,8 @@ EPPRegisterRead (int reg) DBG (0, "ppdev ioctl returned <%s> (%s:%d)\n", strerror (errno), __FILE__, __LINE__); rc = write (fd, &breg, 1); + if (rc != 1) + DBG (0, "ppdev short write (%s:%d)\n", __FILE__, __LINE__); mode = 1; /* data_reverse */ rc = ioctl (fd, PPDATADIR, &mode); @@ -1665,6 +1668,8 @@ EPPRegisterRead (int reg) DBG (0, "ppdev ioctl returned <%s> (%s:%d)\n", strerror (errno), __FILE__, __LINE__); rc = read (fd, &bval, 1); + if (rc != 1) + DBG (0, "ppdev short read (%s:%d)\n", __FILE__, __LINE__); value = bval; mode = 0; /* forward */ @@ -7808,7 +7813,7 @@ sanei_umax_pp_StartScan (int x, int y, int width, int height, int dpi, 0x41, 0xA0, 0x0A, 0x8B, 0x49, 0x2A, 0xE9, 0x68, 0xDF, 0x33, 0x1A, 0x00, -1 }; - +#define UMAX_PP_DANGEROUS_EXPERIMENT 666 #ifdef UMAX_PP_DANGEROUS_EXPERIMENT FILE *f = NULL; char line[1024], *ptr; @@ -8213,7 +8218,7 @@ sanei_umax_pp_StartScan (int x, int y, int width, int height, int dpi, } printf ("CMD%d BEFORE: ", channel); for (i = 0; i < max; i++) - printf ("%02x ", base[i]); + printf ("%02X ", base[i]); printf ("\n"); if (channel > 0) { diff --git a/backend/umax_pp_mid.c b/backend/umax_pp_mid.c index e75639713..2ff61ac62 100644 --- a/backend/umax_pp_mid.c +++ b/backend/umax_pp_mid.c @@ -345,18 +345,18 @@ sanei_umax_pp_start (int x, int y, int width, int height, int dpi, int color, else sanei_umax_pp_setauto (0); - switch(color) - { - case 0: - col = BW2_MODE; - break; - case 1: - col = BW_MODE; - break; - case 2: - col = RGB_MODE; - break; - } + switch (color) + { + case 0: + col = BW2_MODE; + break; + case 1: + col = BW_MODE; + break; + case 2: + col = RGB_MODE; + break; + } if (sanei_umax_pp_StartScan (x + 144, y, width, height, dpi, col, gain, highlight, rbpp, rtw,