From 6cc15e2b813e5d0cad54e76a39186f07182f8788 Mon Sep 17 00:00:00 2001 From: David Ward Date: Tue, 8 Mar 2022 19:00:00 -0500 Subject: [PATCH] Adjust conditional expressions to resolve compiler warnings --- backend/canon_pp-io.c | 4 ++-- backend/microtek2.h | 2 +- backend/mustek_usb2_asic.c | 8 ++++---- backend/stv680.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/canon_pp-io.c b/backend/canon_pp-io.c index 0b92b113a..9e6e006f6 100644 --- a/backend/canon_pp-io.c +++ b/backend/canon_pp-io.c @@ -178,8 +178,8 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode) usleep(100000); } - } while ((i < max_cycles) && (!expect(port,"Scanner wakeup reply 2", - 0x03, 0x1f, 100000) == 0)); + } while ((i < max_cycles) && expect(port, "Scanner wakeup reply 2", + 0x03, 0x1f, 100000)); /* Block just after chessboarding Reply 1 (S3 and S4 on, S5 and S7 off) */ diff --git a/backend/microtek2.h b/backend/microtek2.h index 3cd136501..e3bc493da 100644 --- a/backend/microtek2.h +++ b/backend/microtek2.h @@ -827,7 +827,7 @@ typedef struct Microtek2_Info { SANE_Byte nlens; SANE_Byte nwindows; SANE_Byte shtrnsferequ; -#define MI_WHITE_SHADING_ONLY(x) ((x) & 0x20) == 0 +#define MI_WHITE_SHADING_ONLY(x) (((x) & 0x20) == 0) #define MI_HAS_SCNBTTN SANE_TRUE SANE_Bool scnbuttn; #define MI_HAS_PIPOBUF SANE_TRUE diff --git a/backend/mustek_usb2_asic.c b/backend/mustek_usb2_asic.c index 039ffa189..da2b53eba 100644 --- a/backend/mustek_usb2_asic.c +++ b/backend/mustek_usb2_asic.c @@ -3901,12 +3901,12 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits, BytePerPixel = 2; chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2; } - else if ((bScanBits == 8)) + else if (bScanBits == 8) { BytePerPixel = 1; chip->dwBytesCountPerRow = (unsigned int) (wWidth); } - else if ((bScanBits < 8)) + else if (bScanBits < 8) { BytePerPixel = 1; chip->dwBytesCountPerRow = (unsigned int) (wWidth); @@ -4926,13 +4926,13 @@ Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution, BytePerPixel = 2; chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2; } - else if ((bScanBits == 8)) + else if (bScanBits == 8) { wPerLineNeedBufferSize = wWidth; BytePerPixel = 1; chip->dwBytesCountPerRow = (unsigned int) (wWidth); } - else if ((bScanBits < 8)) + else if (bScanBits < 8) { wPerLineNeedBufferSize = wWidth >> 3; BytePerPixel = 1; diff --git a/backend/stv680.c b/backend/stv680.c index eb9add5b6..a86cc855f 100644 --- a/backend/stv680.c +++ b/backend/stv680.c @@ -1439,7 +1439,7 @@ stv680_bayer_unshuffle (Stv680_Vidcam * dev, SANE_Byte * buf, size_t * size) "stv680_bayer_unshuffle: if needed, trim to size 160 done\n"); } /* reset to proper width */ - if ((dev->subsample == 160)) + if (dev->subsample == 160) { vw = 160; vh = 120;