From f3162bafa837d43d0e987c060523b1566e7be0a7 Mon Sep 17 00:00:00 2001 From: David Ward Date: Tue, 8 Mar 2022 19:00:00 -0500 Subject: [PATCH] Replace variable self-assignments to avoid Clang warnings These were intended to suppress GCC warnings about unused variables. However, this leads to different warnings from Clang instead. Use another approach that suppresses warnings from both compilers. --- backend/abaton.c | 16 ++++----- backend/agfafocus.c | 10 +++--- backend/apple.c | 14 ++++---- backend/avision.c | 8 ++--- backend/bh.c | 10 +++--- backend/canon630u-common.c | 2 +- backend/canon630u.c | 56 +++++++++++++++---------------- backend/canon_dr.c | 10 +++--- backend/canon_lide70.c | 4 +-- backend/cardscan.c | 4 +-- backend/coolscan.c | 14 ++++---- backend/coolscan2.c | 10 +++--- backend/coolscan3.c | 10 +++--- backend/dmc.c | 12 +++---- backend/epjitsu.c | 4 +-- backend/epson.c | 12 +++---- backend/epson2_scsi.c | 4 +-- backend/epson_scsi.c | 4 +-- backend/epsonds-cmd.c | 6 ++-- backend/fujitsu.c | 10 +++--- backend/hp3500.c | 8 ++--- backend/hp3900_config.c | 2 +- backend/hp3900_debug.c | 18 +++++----- backend/hp3900_rts8822.c | 12 +++---- backend/hp3900_sane.c | 18 +++++----- backend/hp4200.c | 8 ++--- backend/hp5400_internal.c | 8 ++--- backend/hp5400_sane.c | 10 +++--- backend/hs2p.c | 4 +-- backend/kodak.c | 10 +++--- backend/kvs1025.c | 8 ++--- backend/microtek.c | 8 ++--- backend/mustek_usb2_asic.c | 10 +++--- backend/mustek_usb2_high.c | 16 ++++----- backend/mustek_usb2_reflective.c | 2 +- backend/mustek_usb2_transparent.c | 2 +- backend/nec.c | 16 ++++----- backend/net.c | 12 +++---- backend/p5.c | 8 ++--- backend/pieusb.c | 4 +-- backend/qcam.c | 4 +-- backend/ricoh.c | 12 +++---- backend/rts8891.c | 2 +- backend/s9036.c | 16 ++++----- backend/sm3600-scanusb.c | 6 ++-- backend/sm3600.c | 6 ++-- backend/sm3840_lib.c | 10 +++--- backend/sp15c.c | 24 ++++++------- backend/st400.c | 6 ++-- backend/stv680.c | 12 +++---- backend/tamarack.c | 8 ++--- backend/umax-usb.c | 6 ++-- backend/umax1220u.c | 44 ++++++++++++------------ backend/v4l.c | 2 +- frontend/saned.c | 6 ++-- sanei/sanei_jpeg.c | 24 ++++++------- sanei/sanei_magic.c | 4 +-- 57 files changed, 298 insertions(+), 298 deletions(-) diff --git a/backend/abaton.c b/backend/abaton.c index 1abb3a5d1..3aaf7ce47 100644 --- a/backend/abaton.c +++ b/backend/abaton.c @@ -236,8 +236,8 @@ wait_ready (int fd) static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg) { - scsi_fd = scsi_fd; /* silence gcc */ - arg = arg; /* silence gcc */ + (void) scsi_fd; /* silence gcc */ + (void) arg; /* silence gcc */ switch (result[2] & 0x0F) { @@ -850,7 +850,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; /* silence gcc */ + (void) authorize; /* silence gcc */ DBG_INIT (); @@ -915,7 +915,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) Abaton_Device *dev; int i; - local_only = local_only; /* silence gcc */ + (void) local_only; /* silence gcc */ if (devlist) free (devlist); @@ -1472,8 +1472,8 @@ sane_cancel (SANE_Handle handle) SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { - handle = handle; /* silence gcc */ - non_blocking = non_blocking; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) non_blocking; /* silence gcc */ DBG (FLOW_CONTROL, "sane_set_io_mode: Don't call me please. " "Unimplemented function\n"); @@ -1483,8 +1483,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; /* silence gcc */ - fd = fd; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) fd; /* silence gcc */ DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. " "Unimplemented function\n"); diff --git a/backend/agfafocus.c b/backend/agfafocus.c index d972f5946..f297e41e3 100644 --- a/backend/agfafocus.c +++ b/backend/agfafocus.c @@ -236,8 +236,8 @@ test_ready (int fd) static SANE_Status sense_handler (int scsi_fd, u_char *result, void *arg) { - scsi_fd = scsi_fd; /* silence gcc */ - arg = arg; /* silence gcc */ + (void) scsi_fd; /* silence gcc */ + (void) arg; /* silence gcc */ if (result[0]) { @@ -253,7 +253,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg) static SANE_Status stop_scan (int fd) { - fd = fd; /* silence gcc */ + (void) fd; /* silence gcc */ /* XXX don't know how to stop the scanner. To be tested ! */ #if 0 @@ -1280,7 +1280,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; /* silence gcc */ + (void) authorize; /* silence gcc */ DBG_INIT (); @@ -1335,7 +1335,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) AgfaFocus_Device *dev; int i; - local_only = local_only; /* silence gcc */ + (void) local_only; /* silence gcc */ if (devlist) free (devlist); diff --git a/backend/apple.c b/backend/apple.c index 7b372480d..b360e5c46 100644 --- a/backend/apple.c +++ b/backend/apple.c @@ -328,8 +328,8 @@ return SANE_STATUS_GOOD; static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg) { - scsi_fd = scsi_fd; /* silence gcc */ - arg = arg; /* silence gcc */ + (void) scsi_fd; /* silence gcc */ + (void) arg; /* silence gcc */ switch (result[2] & 0x0F) { @@ -1866,7 +1866,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; /* silence gcc */ + (void) authorize; /* silence gcc */ DBG_INIT (); @@ -1930,7 +1930,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) Apple_Device *dev; int i; - local_only = local_only; /* silence gcc */ + (void) local_only; /* silence gcc */ if (devlist) free (devlist); @@ -2667,7 +2667,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { DBG (FLOW_CONTROL,"sane_set_io_mode: Entering.\n"); - handle = handle; /* silence gcc */ + (void) handle; /* silence gcc */ if (non_blocking) { @@ -2682,8 +2682,8 @@ return SANE_STATUS_GOOD; SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; /* silence gcc */ - fd = fd; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) fd; /* silence gcc */ DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. " "Unimplemented function\n"); diff --git a/backend/avision.c b/backend/avision.c index ce9028486..592aeb15f 100644 --- a/backend/avision.c +++ b/backend/avision.c @@ -2158,8 +2158,8 @@ sense_handler (int fd, u_char* sense, void* arg) uint8_t sense_key = sense[2] & 0xf; uint8_t additional_sense = sense[7]; - fd = fd; /* silence gcc */ - arg = arg; /* silence gcc */ + (void) fd; /* silence gcc */ + (void) arg; /* silence gcc */ DBG (3, "sense_handler:\n"); @@ -8451,7 +8451,7 @@ sane_reload_devices (void) SANE_Status sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize) { - authorize = authorize; /* silence gcc */ + (void) authorize; /* silence gcc */ DBG_INIT(); @@ -8500,7 +8500,7 @@ sane_get_devices (const SANE_Device*** device_list, SANE_Bool local_only) Avision_Device* dev; int i; - local_only = local_only; /* silence gcc */ + (void) local_only; /* silence gcc */ DBG (3, "sane_get_devices:\n"); diff --git a/backend/bh.c b/backend/bh.c index 0f2e70e59..5a6308db7 100644 --- a/backend/bh.c +++ b/backend/bh.c @@ -1979,7 +1979,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg) SANE_Status status = SANE_STATUS_INVAL; SANE_Char print_sense[(16 * 3) + 1]; - scsi_fd = scsi_fd; /* get rid of compiler warning */ + (void) scsi_fd; /* get rid of compiler warning */ ErrorCode = result[0] & 0x7F; ValidData = (result[0] & 0x80) != 0; sense = result[2] & 0x0f; /* Key */ @@ -3145,7 +3145,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize) char devnam[PATH_MAX] = "/dev/scanner"; FILE *fp; - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ DBG_INIT(); DBG(3, "sane_init called\n"); @@ -3233,7 +3233,7 @@ sane_get_devices (const SANE_Device ***device_list, SANE_Bool local) int i; DBG(3, "sane_get_devices called\n"); - local = local; /* get rid of compiler warning */ + (void) local; /* get rid of compiler warning */ if (devlist) free (devlist); devlist = malloc ((num_devices + 1) * sizeof (devlist[0])); @@ -3806,7 +3806,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) return SANE_STATUS_GOOD; #else - handle = handle; /* get rid of compiler warning */ + (void) handle; /* get rid of compiler warning */ return (non_blocking == 1) ? SANE_STATUS_UNSUPPORTED : SANE_STATUS_GOOD; #endif } @@ -3828,7 +3828,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int *fd) return SANE_STATUS_GOOD; #else - handle = handle; fd = fd; /* get rid of compiler warning */ + (void) handle; (void) fd; /* get rid of compiler warning */ return SANE_STATUS_UNSUPPORTED; #endif } diff --git a/backend/canon630u-common.c b/backend/canon630u-common.c index e6fcf3366..ef264a989 100644 --- a/backend/canon630u-common.c +++ b/backend/canon630u-common.c @@ -1546,7 +1546,7 @@ CANON_open_device (CANON_Handle * scan, const char *dev) static const char * CANON_get_device_name (CANON_Handle * scanner) { - scanner = scanner; /* Eliminate warning about unused parameters */ + (void) scanner; /* Eliminate warning about unused parameters */ return "Canoscan FB630U"; } diff --git a/backend/canon630u.c b/backend/canon630u.c index 659c31ffc..25c59d6cd 100644 --- a/backend/canon630u.c +++ b/backend/canon630u.c @@ -133,9 +133,9 @@ static SANE_Status optionNumOptionsCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - option = option; - handle = handle; - info = info; /* Eliminate warning about unused parameters */ + (void) option; + (void) handle; + (void) info; /* Eliminate warning about unused parameters */ if (action != SANE_ACTION_GET_VALUE) return SANE_STATUS_INVAL; @@ -168,8 +168,8 @@ static SANE_Status optionCalibrateCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - handle = handle; - option = option; /* Eliminate warning about unused parameters */ + (void) handle; + (void) option; /* Eliminate warning about unused parameters */ switch (action) { @@ -221,7 +221,7 @@ optionResolutionCallback (SANE_Option * option, SANE_Handle handle, SANE_Status status; SANE_Word autoValue = 75; - handle = handle; /* Eliminate warning about unused parameters */ + (void) handle; /* Eliminate warning about unused parameters */ switch (action) { @@ -268,8 +268,8 @@ static SANE_Status optionGrayscaleCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - handle = handle; - option = option; /* Eliminate warning about unused parameters */ + (void) handle; + (void) option; /* Eliminate warning about unused parameters */ switch (action) { @@ -315,9 +315,9 @@ static SANE_Status optionAGainCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - option = option; - handle = handle; - info = info; /* Eliminate warning about unused parameters */ + (void) option; + (void) handle; + (void) info; /* Eliminate warning about unused parameters */ switch (action) { @@ -357,9 +357,9 @@ static SANE_Status optionGammaCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - option = option; - handle = handle; - info = info; /* Eliminate warning about unused parameters */ + (void) option; + (void) handle; + (void) info; /* Eliminate warning about unused parameters */ switch (action) { @@ -418,9 +418,9 @@ static SANE_Status optionTopLeftXCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - option = option; - handle = handle; - value = value; /* Eliminate warning about unused parameters */ + (void) option; + (void) handle; + (void) value; /* Eliminate warning about unused parameters */ switch (action) { @@ -462,8 +462,8 @@ optionTopLeftYCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; + (void) option; + (void) handle; switch (action) { @@ -506,8 +506,8 @@ optionBotRightXCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; + (void) option; + (void) handle; switch (action) { @@ -550,8 +550,8 @@ optionBotRightYCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; + (void) option; + (void) handle; switch (action) { @@ -912,7 +912,7 @@ sane_close (SANE_Handle handle) const SANE_Option_Descriptor * sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) { - handle = handle; /* Eliminate compiler warning */ + (void) handle; /* Eliminate compiler warning */ DBG (3, "sane_get_option_descriptor: option = %d\n", option); if (option < 0 || option >= NELEMS (so)) @@ -924,7 +924,7 @@ SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int * info) { - handle = handle; /* Eliminate compiler warning */ + (void) handle; /* Eliminate compiler warning */ DBG (3, "sane_control_option: handle=%p, opt=%d, act=%d, val=%p, info=%p\n", @@ -945,7 +945,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) SANE_UNFIX (optionBotRightYValue - optionTopLeftYValue) / MM_IN_INCH * optionResolutionValue; - handle = handle; /* Eliminate compiler warning */ + (void) handle; /* Eliminate compiler warning */ DBG (3, "sane_get_parameters\n"); parms.depth = 8; @@ -1035,7 +1035,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; /* silence gcc */ - fd = fd; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) fd; /* silence gcc */ return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/canon_dr.c b/backend/canon_dr.c index dfe36bc19..2efd8e7e0 100644 --- a/backend/canon_dr.c +++ b/backend/canon_dr.c @@ -494,7 +494,7 @@ static struct scanner *scanner_devList = NULL; SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ DBG_INIT (); DBG (10, "sane_init: start\n"); @@ -547,7 +547,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) int num_devices=0; int i=0; - local_only = local_only; /* get rid of compiler warning */ + (void) local_only; /* get rid of compiler warning */ DBG (10, "sane_get_devices: start\n"); @@ -7233,7 +7233,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg) DBG (5, "sense_handler: start\n"); /* kill compiler warning */ - fd = fd; + (void) fd; /* copy the rs return data into the scanner struct so that the caller can use it if he wants @@ -7494,8 +7494,8 @@ do_scsi_cmd(struct scanner *s, int runRS, int timeout, int ret; /*shut up compiler*/ - runRS=runRS; - timeout=timeout; + (void) runRS; + (void) timeout; DBG(10, "do_scsi_cmd: start\n"); diff --git a/backend/canon_lide70.c b/backend/canon_lide70.c index 4cc89995b..c7463fea4 100644 --- a/backend/canon_lide70.c +++ b/backend/canon_lide70.c @@ -956,7 +956,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; /* silence gcc */ - fd = fd; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) fd; /* silence gcc */ return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/cardscan.c b/backend/cardscan.c index 2adad7c68..8984f7a91 100644 --- a/backend/cardscan.c +++ b/backend/cardscan.c @@ -271,7 +271,7 @@ static struct scanner *scanner_devList = NULL; SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ DBG_INIT (); DBG (10, "sane_init: start\n"); @@ -323,7 +323,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) int num_devices=0; int i=0; - local_only = local_only; /* get rid of compiler warning */ + (void) local_only; /* get rid of compiler warning */ DBG (10, "sane_get_devices: start\n"); diff --git a/backend/coolscan.c b/backend/coolscan.c index e51b499d5..2aaef4e34 100644 --- a/backend/coolscan.c +++ b/backend/coolscan.c @@ -1853,8 +1853,8 @@ hexdump (int level, char *comment, unsigned char *p, int l) static SANE_Status sense_handler (int scsi_fd, unsigned char * result, void *arg) { - scsi_fd = scsi_fd; - arg = arg; + (void) scsi_fd; + (void) arg; if (result[0] != 0x70) { @@ -2155,7 +2155,7 @@ attach_one (const char *devName) static void sigterm_handler (int signal) { - signal = signal; + (void) signal; sanei_scsi_req_flush_all (); /* flush SCSI queue */ _exit (SANE_STATUS_GOOD); } @@ -2360,7 +2360,7 @@ static int RGBIfix16(Coolscan_t * scanner, unsigned short *opr,*opg,*opb,*opi; int x; - scanner = scanner; lutr = lutr; lutg = lutg; lutb = lutb; luti = luti; + (void) scanner; (void) lutr; (void) lutg; (void) lutb; (void) luti; for(x=0;x= 11) { debug_token(DBG_LEVEL, __func__, token, len); @@ -816,7 +816,7 @@ static SANE_Status resa_cb(void *userdata, char *token, int len) { /* epsonds_scanner *s = (epsonds_scanner *)userdata; */ - userdata = userdata; + (void) userdata; if (DBG_LEVEL >= 11) { debug_token(DBG_LEVEL, __func__, token, len); @@ -838,7 +838,7 @@ static SANE_Status para_cb(void *userdata, char *token, int len) debug_token(DBG_LEVEL, __func__, token, len); } - userdata = userdata; + (void) userdata; if (strncmp("par", token, 3) == 0) { if (strncmp("FAIL", token + 3, 4) == 0) { diff --git a/backend/fujitsu.c b/backend/fujitsu.c index d17e01525..f451ab42c 100644 --- a/backend/fujitsu.c +++ b/backend/fujitsu.c @@ -764,7 +764,7 @@ static struct fujitsu *fujitsu_devList = NULL; SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ DBG_INIT (); DBG (10, "sane_init: start\n"); @@ -819,7 +819,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) int num_devices=0; int i=0; - local_only = local_only; /* get rid of compiler warning */ + (void) local_only; /* get rid of compiler warning */ DBG (10, "sane_get_devices: start\n"); @@ -9270,7 +9270,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg) DBG (5, "sense_handler: start\n"); /* kill compiler warning */ - fd = fd; + (void) fd; /* copy the rs return data into the scanner struct so that the caller can use it if he wants */ @@ -9605,8 +9605,8 @@ do_scsi_cmd(struct fujitsu *s, int runRS, int shortTime, int ret; /*shut up compiler*/ - runRS=runRS; - shortTime=shortTime; + (void) runRS; + (void) shortTime; DBG(10, "do_scsi_cmd: start\n"); diff --git a/backend/hp3500.c b/backend/hp3500.c index bf07b3678..e73bc1f90 100644 --- a/backend/hp3500.c +++ b/backend/hp3500.c @@ -265,7 +265,7 @@ static const SANE_Device **devlist = 0; SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ DBG_INIT (); DBG (10, "sane_init\n"); @@ -1117,7 +1117,7 @@ init_options (struct hp3500_data *scanner) static void do_reset (struct hp3500_data *scanner) { - scanner = scanner; /* kill warning */ + (void) scanner; /* kill warning */ } static void @@ -2774,7 +2774,7 @@ rts8801_doscan (unsigned width, int result = 0; unsigned rows_supplied = 0; - calib_info = calib_info; /* Kill warning */ + (void) calib_info; /* Kill warning */ if (cancelled_scan) return -1; rt_start_moving (); @@ -3784,7 +3784,7 @@ writefunc (struct hp3500_write_info *winfo, int bytes, char *data) static void sigtermHandler (int signal) { - signal = signal; /* get rid of compiler warning */ + (void) signal; /* get rid of compiler warning */ cancelled_scan = 1; } #endif diff --git a/backend/hp3900_config.c b/backend/hp3900_config.c index daeb58359..c48cb513b 100644 --- a/backend/hp3900_config.c +++ b/backend/hp3900_config.c @@ -2719,7 +2719,7 @@ static SANE_Int bq5550_scanmodes(SANE_Int usb, SANE_Int sm, struct st_scanmode * SANE_Int rst = ERROR; /* silence compiler */ - usb = usb; + (void) usb; if (mymode != NULL) { diff --git a/backend/hp3900_debug.c b/backend/hp3900_debug.c index 25254dbe3..881f400db 100644 --- a/backend/hp3900_debug.c +++ b/backend/hp3900_debug.c @@ -600,15 +600,15 @@ dbg_tiff_save (char *sFile, SANE_Int width, SANE_Int height, SANE_Int depth, } #else /* silent gcc */ - sFile = sFile; - width = width; - height = height; - depth = depth; - colortype = colortype; - res_x = res_x; - res_y = res_y; - buffer = buffer; - size = size; + (void) sFile; + (void) width; + (void) height; + (void) depth; + (void) colortype; + (void) res_x; + (void) res_y; + (void) buffer; + (void) size; DBG (DBG_ERR, "- dbg_tiff_save: tiffio not supported\n"); #endif diff --git a/backend/hp3900_rts8822.c b/backend/hp3900_rts8822.c index 823abc23b..f74d58689 100644 --- a/backend/hp3900_rts8822.c +++ b/backend/hp3900_rts8822.c @@ -7703,7 +7703,7 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, "+ Scan_Read_BufferA(buffer_size=%i, arg2, *pBuffer, *bytes_transferred):\n", buffer_size); - arg2 = arg2; /* silence gcc */ + (void) arg2; /* silence gcc */ *bytes_transferred = 0; if (pBuffer != NULL) @@ -11364,7 +11364,7 @@ Calib_CreateBuffers (struct st_device *dev, struct st_calibration *buffer, SANE_Int ebp, ret, channel; ret = ERROR; - dev = dev; + (void) dev; buffer->shadinglength = scan.coord.width; ebp = 0x14; @@ -12602,9 +12602,9 @@ Calib_BWShading (struct st_calibration_config *calibcfg, /*falta codigo */ /*silence gcc */ - calibcfg = calibcfg; - myCalib = myCalib; - gainmode = gainmode; + (void) calibcfg; + (void) myCalib; + (void) gainmode; return OK; } @@ -13624,7 +13624,7 @@ Calibration (struct st_device *dev, SANE_Byte * Regs, DBG (DBG_FNC, "> Calibration\n"); dbg_ScanParams (scancfg); - value = value; /*silence gcc */ + (void) value; /*silence gcc */ memcpy (&calibdata->Regs, Regs, sizeof (SANE_Byte) * RT_BUFFER_LEN); diff --git a/backend/hp3900_sane.c b/backend/hp3900_sane.c index eae99e092..5face5e4d 100644 --- a/backend/hp3900_sane.c +++ b/backend/hp3900_sane.c @@ -380,7 +380,7 @@ bknd_colormodes (TScanner * scanner, SANE_Int model) { SANE_VALUE_SCAN_MODE_COLOR, SANE_VALUE_SCAN_MODE_GRAY, SANE_VALUE_SCAN_MODE_LINEART, 0 }; /* silence gcc */ - model = model; + (void) model; colormode = (SANE_String_Const *) malloc (sizeof (mycolormode)); if (colormode != NULL) @@ -460,7 +460,7 @@ bknd_depths (TScanner * scanner, SANE_Int model) SANE_Int mydepth[] = { 2, 8, 16 }; /*{3, 8, 12, 16}; */ /* silence gcc */ - model = model; + (void) model; depth = (SANE_Int *) malloc (sizeof (mydepth)); if (depth != NULL) @@ -1760,7 +1760,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) DBG (DBG_FNC, "> sane_init\n"); /* silence gcc */ - authorize = authorize; + (void) authorize; /* Initialize usb */ sanei_usb_init (); @@ -1816,7 +1816,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { SANE_Status rst = SANE_STATUS_GOOD; - local_only = local_only; + (void) local_only; if (_pSaneDevList) free (_pSaneDevList); @@ -2654,7 +2654,7 @@ sane_cancel (SANE_Handle h) DBG (DBG_FNC, "> sane_cancel\n"); /* silence gcc */ - h = h; + (void) h; device->status->cancel = TRUE; } @@ -2665,8 +2665,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) DBG (DBG_FNC, "> sane_set_io_mode\n"); /* silence gcc */ - handle = handle; - non_blocking = non_blocking; + (void) handle; + (void) non_blocking; return SANE_STATUS_UNSUPPORTED; } @@ -2677,8 +2677,8 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) DBG (DBG_FNC, "> sane_get_select_fd\n"); /* silence gcc */ - handle = handle; - fd = fd; + (void) handle; + (void) fd; return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/hp4200.c b/backend/hp4200.c index 5b21b47d8..cd43ee3d8 100644 --- a/backend/hp4200.c +++ b/backend/hp4200.c @@ -2369,7 +2369,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) char dev_name[PATH_MAX]; FILE *fp; - authorize = authorize; /* keep gcc quiet */ + (void) authorize; /* keep gcc quiet */ DBG_INIT (); @@ -2939,7 +2939,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) HP4200_Scanner *dev = handle; SANE_Status status; - non_blocking = non_blocking; /* silence gcc */ + (void) non_blocking; /* silence gcc */ if (dev->scanning == SANE_FALSE) { @@ -2965,8 +2965,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd) { static char me[] = "sane_get_select_fd"; - h = h; /* keep gcc quiet */ - fd = fd; /* keep gcc quiet */ + (void) h; /* keep gcc quiet */ + (void) fd; /* keep gcc quiet */ DBG (DBG_proc, "%s\n", me); return SANE_STATUS_UNSUPPORTED; diff --git a/backend/hp5400_internal.c b/backend/hp5400_internal.c index 322359a70..95866c4ed 100644 --- a/backend/hp5400_internal.c +++ b/backend/hp5400_internal.c @@ -483,7 +483,7 @@ void CircBufferInit (int iHandle, TDataPipe * p, int iBytesPerLine, int bpp, int iMisAlignment, int blksize, int iTransferSize) { - iHandle = iHandle; /* to avoid compilation warning */ + (void) iHandle; /* to avoid compilation warning */ p->buffersize = max (BUFFER_SIZE, 3 * blksize); if (p->buffer) @@ -746,7 +746,7 @@ HP5400_SANE_STATIC int hp5400_test_scan_response (struct ScanResponse *resp, struct ScanRequest *req) { - req = req; /* to avoid compilation warning */ + (void) req; /* to avoid compilation warning */ HP5400_DBG (DBG_MSG, "Scan response:\n"); HP5400_DBG (DBG_MSG, " transfersize=%d htonl-> %d\n", resp->transfersize, htonl (resp->transfersize)); @@ -828,7 +828,7 @@ DoScan (int iHandle, struct ScanRequest *req, const char *filename, int code, /* int bpp, planes; */ int i; - code = code; /*to avoid compilation warning*/ + (void) code; /*to avoid compilation warning*/ if (res == NULL) res = &res_temp; @@ -1011,7 +1011,7 @@ hp5400_scan (int iHandle, TScanParams * params, THWParams * pHWParams, struct ScanResponse res; int result; - pHWParams = pHWParams; /*to avoid compilation warning*/ + (void) pHWParams; /*to avoid compilation warning*/ HP5400_DBG (DBG_MSG, "\n"); HP5400_DBG (DBG_MSG, "Scanning :\n"); diff --git a/backend/hp5400_sane.c b/backend/hp5400_sane.c index 5043dad3b..5e716a200 100644 --- a/backend/hp5400_sane.c +++ b/backend/hp5400_sane.c @@ -611,7 +611,7 @@ sane_init (SANE_Int * piVersion, SANE_Auth_Callback pfnAuth) int nline = 0; /* prevent compiler from complaining about unused parameters */ - pfnAuth = pfnAuth; + (void) pfnAuth; strcpy(usb_devfile, "/dev/usb/scanner0"); _pFirstSaneDev = 0; @@ -712,7 +712,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) HP5400_DBG (DBG_MSG, "sane_get_devices\n"); - local_only = local_only; + (void) local_only; if (_pSaneDevList) { @@ -1333,7 +1333,7 @@ sane_set_io_mode (SANE_Handle h, SANE_Bool m) HP5400_DBG (DBG_MSG, "sane_set_io_mode %s\n", m ? "non-blocking" : "blocking"); /* prevent compiler from complaining about unused parameters */ - h = h; + (void) h; if (m) { @@ -1349,8 +1349,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd) HP5400_DBG (DBG_MSG, "sane_select_fd\n"); /* prevent compiler from complaining about unused parameters */ - h = h; - fd = fd; + (void) h; + (void) fd; return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/hs2p.c b/backend/hs2p.c index 529ea8b49..b2c6d76b5 100644 --- a/backend/hs2p.c +++ b/backend/hs2p.c @@ -3322,8 +3322,8 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) *fd = s->fd; return SANE_STATUS_GOOD; #else - handle = handle; - fd = fd; /* get rid of compiler warning */ + (void) handle; + (void) fd; /* get rid of compiler warning */ DBG (DBG_proc, "<< sane_get_select_fd\n"); return SANE_STATUS_UNSUPPORTED; #endif diff --git a/backend/kodak.c b/backend/kodak.c index c41f08811..b46ab2e97 100644 --- a/backend/kodak.c +++ b/backend/kodak.c @@ -175,7 +175,7 @@ static struct scanner *scanner_devList = NULL; SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ DBG_INIT (); DBG (10, "sane_init: start\n"); @@ -225,7 +225,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) int num_devices=0; int i=0; - local_only = local_only; /* get rid of compiler warning */ + (void) local_only; /* get rid of compiler warning */ DBG (10, "sane_get_devices: start\n"); @@ -2550,7 +2550,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg) DBG (5, "sense_handler: start\n"); /* kill compiler warning */ - fd = fd; + (void) fd; /* save for later */ s->rs_info = get_RS_information (sensed_data); @@ -2754,8 +2754,8 @@ do_cmd(struct scanner *s, int runRS, int shortTime, SANE_Status ret = SANE_STATUS_GOOD; /*shut up compiler*/ - runRS=runRS; - shortTime=shortTime; + (void) runRS; + (void) shortTime; DBG(10, "do_cmd: start\n"); diff --git a/backend/kvs1025.c b/backend/kvs1025.c index 9d53690b6..9c8b56f57 100644 --- a/backend/kvs1025.c +++ b/backend/kvs1025.c @@ -442,15 +442,15 @@ sane_cancel (SANE_Handle handle) SANE_Status sane_set_io_mode (SANE_Handle h, SANE_Bool m) { - h=h; - m=m; + (void) h; + (void) m; return SANE_STATUS_UNSUPPORTED; } SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) { - h=h; - fd=fd; + (void) h; + (void) fd; return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/microtek.c b/backend/microtek.c index f4213e3a5..f1f4566d3 100644 --- a/backend/microtek.c +++ b/backend/microtek.c @@ -3060,7 +3060,7 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; + (void) authorize; DBG_INIT(); DBG(1, "sane_init: MICROTEK says hello! (v%d.%d.%d)\n", MICROTEK_MAJOR, MICROTEK_MINOR, MICROTEK_PATCH); @@ -3111,7 +3111,7 @@ sane_get_devices(const SANE_Device ***device_list, Microtek_Device *dev; int i; - local_only = local_only; + (void) local_only; DBG(10, "sane_get_devices\n"); /* we keep an internal copy */ if (devlist) @@ -4166,7 +4166,7 @@ SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { DBG(10, "sane_set_io_mode...\n"); - handle = handle; + (void) handle; if (non_blocking) return SANE_STATUS_UNSUPPORTED; else @@ -4182,6 +4182,6 @@ SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { DBG(10, "sane_get_select_fd...\n"); - handle = handle, fd = fd; + (void) handle, (void) fd; return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/mustek_usb2_asic.c b/backend/mustek_usb2_asic.c index da2b53eba..c69120554 100644 --- a/backend/mustek_usb2_asic.c +++ b/backend/mustek_usb2_asic.c @@ -2092,7 +2092,7 @@ SetMotorCurrent (PAsic chip, unsigned short dwMotorSpeed, STATUS status = STATUS_GOOD; DBG (DBG_ASIC, "SetMotorCurrent:Enter\n"); - chip = chip; + (void) chip; if (dwMotorSpeed < 2000) { @@ -4596,7 +4596,7 @@ static STATUS Asic_SetMotorType (PAsic chip, SANE_Bool isMotorMove, SANE_Bool isUniformSpeed) { STATUS status = STATUS_GOOD; - isUniformSpeed = isUniformSpeed; + (void) isUniformSpeed; DBG (DBG_ASIC, "Asic_SetMotorType:Enter\n"); if (isMotorMove) @@ -4680,7 +4680,7 @@ Asic_CarriageHome (PAsic chip, SANE_Bool isTA) { STATUS status = STATUS_GOOD; SANE_Bool LampHome, TAHome; - isTA = isTA; + (void) isTA; DBG (DBG_ASIC, "Asic_CarriageHome:Enter\n"); @@ -4705,7 +4705,7 @@ Asic_SetShadingTable (PAsic chip, unsigned short * lpWhiteShading, double dbXRatioAdderDouble; unsigned int wShadingTableSize; - wX = wX; + (void) wX; DBG (DBG_ASIC, "Asic_SetShadingTable:Enter\n"); if (chip->firmwarestate < FS_OPENED) @@ -4807,7 +4807,7 @@ Asic_WaitCarriageHome (PAsic chip, SANE_Bool isTA) SANE_Bool LampHome, TAHome; int i; - isTA = isTA; + (void) isTA; DBG (DBG_ASIC, "Asic_WaitCarriageHome:Enter\n"); diff --git a/backend/mustek_usb2_high.c b/backend/mustek_usb2_high.c index 5119d55bd..ff0db9c18 100644 --- a/backend/mustek_usb2_high.c +++ b/backend/mustek_usb2_high.c @@ -2132,7 +2132,7 @@ MustScanner_GetMono16BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, unsigned short wLinePos = 0; unsigned short i; - isOrderInvert = isOrderInvert; + (void) isOrderInvert; DBG (DBG_FUNC, "MustScanner_GetMono16BitLine: call in\n"); @@ -2228,7 +2228,7 @@ MustScanner_GetMono16BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert unsigned short i; SANE_Byte * lpTemp = lpLine; - isOrderInvert = isOrderInvert; + (void) isOrderInvert; DBG (DBG_FUNC, "MustScanner_GetMono16BitLine1200DPI: call in\n"); TotalXferLines = 0; @@ -2407,7 +2407,7 @@ MustScanner_GetMono8BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, unsigned short i; unsigned short wLinePos = 0; - isOrderInvert = isOrderInvert; + (void) isOrderInvert; DBG (DBG_FUNC, "MustScanner_GetMono8BitLine: call in\n"); TotalXferLines = 0; @@ -2502,7 +2502,7 @@ MustScanner_GetMono8BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, unsigned short i; SANE_Byte bNextPixel = 0; - isOrderInvert = isOrderInvert; + (void) isOrderInvert; DBG (DBG_FUNC, "MustScanner_GetMono8BitLine1200DPI: call in\n"); TotalXferLines = 0; @@ -2660,7 +2660,7 @@ MustScanner_GetMono1BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, unsigned short wLinePos; unsigned short i; - isOrderInvert = isOrderInvert; + (void) isOrderInvert; DBG (DBG_FUNC, "MustScanner_GetMono1BitLine: call in\n"); @@ -2752,7 +2752,7 @@ MustScanner_GetMono1BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, unsigned short wLinePosOdd; unsigned short wLinePosEven; - isOrderInvert = isOrderInvert; + (void) isOrderInvert; DBG (DBG_FUNC, "MustScanner_GetMono1BitLine1200DPI: call in\n"); @@ -2919,7 +2919,7 @@ MustScanner_CalculateMaxMin (SANE_Byte * pBuffer, unsigned short * lpMaxValue, unsigned short *wSecData = NULL, *wDarkSecData = NULL; int i, j; - wResolution = wResolution; + (void) wResolution; wSecData = (unsigned short *) malloc (sizeof (unsigned short) * g_nSecNum); if (wSecData == NULL) @@ -3001,7 +3001,7 @@ MustScanner_ReadDataFromScanner (void * dummy) unsigned short wScanLinesThisBlock; unsigned short wBufferLines = g_wLineDistance * 2 + g_wPixelDistance; - dummy = dummy; + (void) dummy; DBG (DBG_FUNC, "MustScanner_ReadDataFromScanner: call in, and in new thread\n"); diff --git a/backend/mustek_usb2_reflective.c b/backend/mustek_usb2_reflective.c index baf80e413..468867d0c 100644 --- a/backend/mustek_usb2_reflective.c +++ b/backend/mustek_usb2_reflective.c @@ -362,7 +362,7 @@ Reflective_SetupScan (COLORMODE ColorMode, unsigned short YDpi, SANE_Bool isInvert, unsigned short X, unsigned short Y, unsigned short Width, unsigned short Height) { - isInvert = isInvert; + (void) isInvert; DBG (DBG_FUNC, "Reflective_SetupScan: Call in\n"); if (g_bOpened) { diff --git a/backend/mustek_usb2_transparent.c b/backend/mustek_usb2_transparent.c index 21c773427..edab3d4aa 100644 --- a/backend/mustek_usb2_transparent.c +++ b/backend/mustek_usb2_transparent.c @@ -305,7 +305,7 @@ Transparent_SetupScan (COLORMODE ColorMode, unsigned short XDpi, unsigned short SANE_Bool hasTA; unsigned short wTAShadingMinus = 0; - isInvert = isInvert; + (void) isInvert; DBG (DBG_FUNC, "Transparent_SetupScan: call in\n"); if (g_bOpened) diff --git a/backend/nec.c b/backend/nec.c index 66bfc9bee..6de89a8d0 100644 --- a/backend/nec.c +++ b/backend/nec.c @@ -290,7 +290,7 @@ sense_handler(int fd, u_char *sense_buffer, void *ss) int sense_key; NEC_Sense_Data *sdat = (NEC_Sense_Data *) ss; - fd = fd; /* silence compilation warnings */ + (void) fd; /* silence compilation warnings */ #define add_sense_code sense_buffer[12] #define add_sense_qual sense_buffer[13] @@ -1890,7 +1890,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) NEC_New_Device *np; int i; - authorize = authorize; /* silence compilation warnings */ + (void) authorize; /* silence compilation warnings */ DBG_INIT (); DBG (10, "<< sane_init "); @@ -2079,7 +2079,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) int i; DBG (10, "<< sane_get_devices "); - local_only = local_only; /* silence compilation warnings */ + (void) local_only; /* silence compilation warnings */ if (devlist) free (devlist); @@ -2714,7 +2714,7 @@ send_binary_g_table(NEC_Scanner *s, SANE_Word *a, int dtq) SANE_Status status; unsigned int i, j; - dtq = dtq; /* silence compilation warnings */ + (void) dtq; /* silence compilation warnings */ DBG(11, "<< send_binary_g_table\n"); @@ -3696,8 +3696,8 @@ sane_cancel (SANE_Handle handle) SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { - handle = handle; - non_blocking = non_blocking; /* silence compilation warnings */ + (void) handle; + (void) non_blocking; /* silence compilation warnings */ DBG (10, "<< sane_set_io_mode"); DBG (10, ">>\n"); @@ -3708,8 +3708,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; - fd = fd; /* silence compilation warnings */ + (void) handle; + (void) fd; /* silence compilation warnings */ DBG (10, "<< sane_get_select_fd"); DBG (10, ">>\n"); diff --git a/backend/net.c b/backend/net.c index c659821cb..70a1bdc07 100644 --- a/backend/net.c +++ b/backend/net.c @@ -705,9 +705,9 @@ net_avahi_resolve_callback (AvahiServiceResolver *r, AvahiIfIndex interface, Ava char *t; /* unused */ - interface = interface; - protocol = protocol; - userdata = userdata; + (void) interface; + (void) protocol; + (void) userdata; if (!r) return; @@ -759,8 +759,8 @@ net_avahi_browse_callback (AvahiServiceBrowser *b, AvahiIfIndex interface, Avahi AvahiProtocol proto; /* unused */ - flags = flags; - userdata = userdata; + (void) flags; + (void) userdata; if (!b) return; @@ -808,7 +808,7 @@ net_avahi_callback (AvahiClient *c, AvahiClientState state, void * userdata) int error; /* unused */ - userdata = userdata; + (void) userdata; if (!c) return; diff --git a/backend/p5.c b/backend/p5.c index 558d9d219..26d78c6fc 100644 --- a/backend/p5.c +++ b/backend/p5.c @@ -157,7 +157,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { SANE_Status status; - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ init_count++; @@ -459,8 +459,8 @@ SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fdp) { /* make compiler happy ... */ - handle = handle; - fdp = fdp; + (void) handle; + (void) fdp; DBG (DBG_proc, "sane_get_select_fd: start\n"); DBG (DBG_warn, "sane_get_select_fd: unsupported ...\n"); @@ -1595,7 +1595,7 @@ config_attach (SANEI_Config __sane_unused__ * config, const char *devname, /* currently, the config is a global variable so config is useless here */ /* the correct thing would be to have a generic sanei_attach_matching_devices * using an attach function with a config parameter */ - config = config; + (void) config; /* the devname has been processed and is ready to be used * directly. The config struct contains all the configuration data for diff --git a/backend/pieusb.c b/backend/pieusb.c index f8dc07398..ec787d136 100644 --- a/backend/pieusb.c +++ b/backend/pieusb.c @@ -1436,7 +1436,7 @@ SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { DBG(DBG_info_sane,"sane_get_select_fd(): not supported (only for non-blocking IO)\n"); - handle = handle; - fd = fd; + (void) handle; + (void) fd; return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/qcam.c b/backend/qcam.c index d3799d79f..40813f7a6 100644 --- a/backend/qcam.c +++ b/backend/qcam.c @@ -1444,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 (); @@ -1511,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); diff --git a/backend/ricoh.c b/backend/ricoh.c index 110d19a4c..c4dd6411e 100644 --- a/backend/ricoh.c +++ b/backend/ricoh.c @@ -485,7 +485,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) char devnam[PATH_MAX] = "/dev/scanner"; FILE *fp; - authorize = authorize; /* silence gcc */ + (void) authorize; /* silence gcc */ DBG_INIT (); DBG (11, ">> sane_init\n"); @@ -551,7 +551,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) Ricoh_Device *dev; int i; - local_only = local_only; /* silence gcc */ + (void) local_only; /* silence gcc */ DBG (11, ">> sane_get_devices\n"); @@ -1008,8 +1008,8 @@ sane_cancel (SANE_Handle handle) SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { - handle = handle; /* silence gcc */ - non_blocking = non_blocking; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) non_blocking; /* silence gcc */ DBG (5, ">> sane_set_io_mode\n"); DBG (5, "<< sane_set_io_mode\n"); @@ -1020,8 +1020,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; /* silence gcc */ - fd = fd; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) fd; /* silence gcc */ DBG (5, ">> sane_get_select_fd\n"); DBG (5, "<< sane_get_select_fd\n"); diff --git a/backend/rts8891.c b/backend/rts8891.c index 4921d31dc..27328716a 100644 --- a/backend/rts8891.c +++ b/backend/rts8891.c @@ -307,7 +307,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { SANE_Status status; - authorize = authorize; /* get rid of compiler warning */ + (void) authorize; /* get rid of compiler warning */ /* init ASIC libraries */ sanei_rts88xx_lib_init (); diff --git a/backend/s9036.c b/backend/s9036.c index 8f84ecfdd..cc8a205e2 100644 --- a/backend/s9036.c +++ b/backend/s9036.c @@ -124,8 +124,8 @@ test_ready (int fd) static SANE_Status sense_handler (int scsi_fd, u_char *result, void *arg) { - scsi_fd = scsi_fd; - arg = arg; /* silence compilation warnings */ + (void) scsi_fd; + (void) arg; /* silence compilation warnings */ if (result[0]) { @@ -141,7 +141,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg) static SANE_Status stop_scan (int fd) { - fd = fd; /* silence compilation warnings */ + (void) fd; /* silence compilation warnings */ /* XXX don't know how to stop the scanner. To be tested ! */ #if 0 @@ -829,7 +829,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; /* silence compilation warnings */ + (void) authorize; /* silence compilation warnings */ DBG_INIT (); @@ -882,7 +882,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) S9036_Device *dev; int i; - local_only = local_only; /* silence compilation warnings */ + (void) local_only; /* silence compilation warnings */ if (devlist) free (devlist); @@ -1327,7 +1327,7 @@ sane_cancel (SANE_Handle handle) SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { - handle = handle; /* silence compilation warnings */ + (void) handle; /* silence compilation warnings */ DBG (1, "sane_set_io_mode(%d)\n", non_blocking); @@ -1338,8 +1338,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { - handle = handle; - fd = fd; /* silence compilation warnings */ + (void) handle; + (void) fd; /* silence compilation warnings */ return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/sm3600-scanusb.c b/backend/sm3600-scanusb.c index dc9b8d57a..997b8ee62 100644 --- a/backend/sm3600-scanusb.c +++ b/backend/sm3600-scanusb.c @@ -66,7 +66,7 @@ static int TransferControlMsg(TInstance *this, { SANE_Status err; - cJiffiesTimeout = cJiffiesTimeout; + (void) cJiffiesTimeout; err = sanei_usb_control_msg (this->hScanner, nReqType, @@ -95,8 +95,8 @@ static int TransferBulkRead(TInstance *this, int err; size_t sz = cchMax; - nEndPoint = nEndPoint; - cJiffiesTimeout = cJiffiesTimeout; + (void) nEndPoint; + (void) cJiffiesTimeout; err = sanei_usb_read_bulk(this->hScanner, pBuffer, diff --git a/backend/sm3600.c b/backend/sm3600.c index e1df6b0c2..0644b5d58 100644 --- a/backend/sm3600.c +++ b/backend/sm3600.c @@ -385,7 +385,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authCB) DBG_INIT(); - authCB=authCB; /* compiler */ + (void) authCB; /* compiler */ DBG(DEBUG_VERBOSE,"SM3600 init\n"); if (version_code) @@ -783,7 +783,7 @@ sane_cancel (SANE_Handle handle) SANE_Status sane_set_io_mode(SANE_Handle h, SANE_Bool m) { - h=h; + (void) h; if (m==SANE_TRUE) /* no non-blocking-mode */ return SANE_STATUS_UNSUPPORTED; return SANE_STATUS_GOOD; @@ -792,6 +792,6 @@ sane_set_io_mode(SANE_Handle h, SANE_Bool m) SANE_Status sane_get_select_fd(SANE_Handle handle, SANE_Int *fd) { - handle=handle; fd=fd; + (void) handle; (void) fd; return SANE_STATUS_UNSUPPORTED; /* we have no file IO */ } diff --git a/backend/sm3840_lib.c b/backend/sm3840_lib.c index 97976a601..80fcec75e 100644 --- a/backend/sm3840_lib.c +++ b/backend/sm3840_lib.c @@ -64,8 +64,8 @@ my_usb_bulk_write (p_usb_dev_handle dev, int ep, SANE_Status status; size_t my_size; - timeout = timeout; - ep = ep; + (void) timeout; + (void) ep; my_size = size; status = sanei_usb_write_bulk ((SANE_Int) dev, (SANE_Byte *) bytes, &my_size); @@ -81,8 +81,8 @@ my_usb_bulk_read (p_usb_dev_handle dev, int ep, SANE_Status status; size_t my_size; - timeout = timeout; - ep = ep; + (void) timeout; + (void) ep; my_size = size; status = sanei_usb_read_bulk ((SANE_Int) dev, (SANE_Byte *) bytes, &my_size); @@ -98,7 +98,7 @@ my_usb_control_msg (p_usb_dev_handle dev, int requesttype, { SANE_Status status; - timeout = timeout; + (void) timeout; status = sanei_usb_control_msg ((SANE_Int) dev, (SANE_Int) requesttype, (SANE_Int) request, (SANE_Int) value, (SANE_Int) index, (SANE_Int) size, diff --git a/backend/sp15c.c b/backend/sp15c.c index a3ad5c20a..bf3ce292d 100644 --- a/backend/sp15c.c +++ b/backend/sp15c.c @@ -273,7 +273,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) char dev_name[PATH_MAX]; size_t len; FILE *fp; - authorize = authorize; /* silence compilation warnings */ + (void) authorize; /* silence compilation warnings */ DBG_INIT (); DBG (10, "sane_init\n"); @@ -310,7 +310,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) struct sp15c *dev; int i; - local_only = local_only; /* silence compilation warnings */ + (void) local_only; /* silence compilation warnings */ DBG (10, "sane_get_devices\n"); @@ -335,7 +335,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) { struct sp15c *dev = first_dev; - name = name; /* silence compilation warnings */ + (void) name; /* silence compilation warnings */ /* Strange, name is not used? */ DBG (10, "sane_open\n"); @@ -388,8 +388,8 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) SANE_Status sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) { - h = h; - non_blocking = non_blocking; /* silence compilation warnings */ + (void) h; + (void) non_blocking; /* silence compilation warnings */ DBG (10, "sane_set_io_mode\n"); return SANE_STATUS_UNSUPPORTED; @@ -399,8 +399,8 @@ sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fdp) { - h = h; - fdp = fdp; /* silence compilation warnings */ + (void) h; + (void) fdp; /* silence compilation warnings */ DBG (10, "sane_get_select_fd\n"); return SANE_STATUS_UNSUPPORTED; @@ -1080,8 +1080,8 @@ attach_one (const char *name) static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg) { - scsi_fd = scsi_fd; - arg = arg; /* silence compilation warnings */ + (void) scsi_fd; + (void) arg; /* silence compilation warnings */ return request_sense_parse (result); } /* sense_handler */ @@ -1783,7 +1783,7 @@ do_cancel (struct sp15c *scanner) static void swap_res (struct sp15c *s) { - s = s; /* silence compilation warnings */ + (void) s; /* silence compilation warnings */ /* for the time being, do nothing */ } /* swap_res */ @@ -1815,7 +1815,7 @@ sp15c_set_window_param (struct sp15c *s, int prescan) int ret; int active_buffer_size; - prescan = prescan; /* silence compilation warnings */ + (void) prescan; /* silence compilation warnings */ wait_scanner (s); DBG (10, "set_window_param\n"); @@ -1950,7 +1950,7 @@ sp15c_start_scan (struct sp15c *s) static void sigterm_handler (int signal) { - signal = signal; /* silence compilation warnings */ + (void) signal; /* silence compilation warnings */ sanei_scsi_req_flush_all (); /* flush SCSI queue */ _exit (SANE_STATUS_GOOD); diff --git a/backend/st400.c b/backend/st400.c index a75807fe8..8d849df29 100644 --- a/backend/st400.c +++ b/backend/st400.c @@ -439,8 +439,8 @@ st400_sense_handler( int fd, SANE_Byte *result, void *arg ) /* ST400_Device *dev = arg; */ SANE_Status status; - fd = fd; - arg = arg; /* silence compilation warnings */ + (void) fd; + (void) arg; /* silence compilation warnings */ switch( result[0] & 0x0f ) { case 0x0: @@ -563,7 +563,7 @@ st400_config_get_arg(char **optP, unsigned long *argP, size_t linenum) { int n; - linenum = linenum; /* silence compilation warnings */ + (void) linenum; /* silence compilation warnings */ if( sscanf(*optP, "%lu%n", argP, &n) == 1 ) { *optP += n; diff --git a/backend/stv680.c b/backend/stv680.c index a86cc855f..02ff39d6f 100644 --- a/backend/stv680.c +++ b/backend/stv680.c @@ -1520,7 +1520,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) DBG (DBG_sane_init, "sane_init\n"); - authorize = authorize; /* silence gcc */ + (void) authorize; /* silence gcc */ DBG (DBG_error, "This is sane-stv680 version %d.%d-%d\n", SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD); @@ -1584,7 +1584,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) DBG (DBG_proc, "sane_get_devices: enter\n"); - local_only = local_only; /* silence gcc */ + (void) local_only; /* silence gcc */ if (devlist) free (devlist); @@ -2073,8 +2073,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) DBG (DBG_proc, "sane_set_io_mode: enter\n"); - handle = handle; /* silence gcc */ - non_blocking = non_blocking; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) non_blocking; /* silence gcc */ DBG (DBG_proc, "sane_set_io_mode: exit\n"); @@ -2087,8 +2087,8 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { DBG (DBG_proc, "sane_get_select_fd: enter\n"); - handle = handle; /* silence gcc */ - fd = fd; /* silence gcc */ + (void) handle; /* silence gcc */ + (void) fd; /* silence gcc */ DBG (DBG_proc, "sane_get_select_fd: exit\n"); diff --git a/backend/tamarack.c b/backend/tamarack.c index 38cc7ea58..916c9ead6 100644 --- a/backend/tamarack.c +++ b/backend/tamarack.c @@ -182,8 +182,8 @@ wait_ready (int fd) static SANE_Status sense_handler (int scsi_fd, u_char *result, void *arg) { - scsi_fd = scsi_fd; - arg = arg; /* silence compilation warnings */ + (void) scsi_fd; + (void) arg; /* silence compilation warnings */ switch (result[0]) { @@ -909,7 +909,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; /* silence compilation warnings */ + (void) authorize; /* silence compilation warnings */ DBG_INIT(); @@ -962,7 +962,7 @@ sane_get_devices (const SANE_Device ***device_list, SANE_Bool local_only) Tamarack_Device *dev; int i; - local_only = local_only; /* silence compilation warnings */ + (void) local_only; /* silence compilation warnings */ if (devlist) free (devlist); diff --git a/backend/umax-usb.c b/backend/umax-usb.c index 05019c775..ab772fe2b 100644 --- a/backend/umax-usb.c +++ b/backend/umax-usb.c @@ -261,8 +261,8 @@ sanei_umaxusb_open (const char *dev, int *fdp, { SANE_Status status; - handler = handler; /* silence gcc */ - handler_arg = handler_arg; /* silence gcc */ + (void) handler; /* silence gcc */ + (void) handler_arg; /* silence gcc */ status = sanei_usb_open (dev, fdp); if (status != SANE_STATUS_GOOD) { @@ -306,7 +306,7 @@ static SANE_Status sanei_umaxusb_open_extended (const char *dev, int *fdp, SANEI_SCSI_Sense_Handler handler, void *handler_arg, int *buffersize) { - buffersize = buffersize; + (void) buffersize; return(sanei_umaxusb_open(dev, fdp, handler, handler_arg)); } diff --git a/backend/umax1220u.c b/backend/umax1220u.c index 8c6098c51..e5ecbef10 100644 --- a/backend/umax1220u.c +++ b/backend/umax1220u.c @@ -131,9 +131,9 @@ static SANE_Status optionNumOptionsCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - option = option; - handle = handle; - info = info; /* Eliminate warning about unused parameters */ + (void) option; + (void) handle; + (void) info; /* Eliminate warning about unused parameters */ if (action != SANE_ACTION_GET_VALUE) return SANE_STATUS_INVAL; @@ -173,7 +173,7 @@ optionResolutionCallback (SANE_Option * option, SANE_Handle handle, SANE_Status status; SANE_Word autoValue = 75; - handle = handle; /* Eliminate warning about unused parameters */ + (void) handle; /* Eliminate warning about unused parameters */ switch (action) { @@ -217,8 +217,8 @@ static SANE_Status optionGrayscaleCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - handle = handle; - option = option; /* Eliminate warning about unused parameters */ + (void) handle; + (void) option; /* Eliminate warning about unused parameters */ switch (action) { @@ -261,10 +261,10 @@ optionLampOffCallback (SANE_Option * option, SANE_Handle handle, SANE_Status res = SANE_STATUS_GOOD; /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; - info = info; - value = value; + (void) option; + (void) handle; + (void) info; + (void) value; if (action != SANE_ACTION_SET_VALUE) return SANE_STATUS_INVAL; @@ -308,9 +308,9 @@ static SANE_Status optionTopLeftXCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { - option = option; - handle = handle; - value = value; /* Eliminate warning about unused parameters */ + (void) option; + (void) handle; + (void) value; /* Eliminate warning about unused parameters */ switch (action) { @@ -351,8 +351,8 @@ optionTopLeftYCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; + (void) option; + (void) handle; switch (action) { @@ -394,8 +394,8 @@ optionBotRightXCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; + (void) option; + (void) handle; switch (action) { @@ -437,8 +437,8 @@ optionBotRightYCallback (SANE_Option * option, SANE_Handle handle, SANE_Action action, void *value, SANE_Int * info) { /* Eliminate warnings about unused parameters */ - option = option; - handle = handle; + (void) option; + (void) handle; switch (action) { @@ -780,7 +780,7 @@ sane_close (SANE_Handle handle) const SANE_Option_Descriptor * sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) { - handle = handle; /* Eliminate compiler warning */ + (void) handle; /* Eliminate compiler warning */ DBG (3, "sane_get_option_descriptor: option = %d\n", option); if (option < 0 || option >= NELEMS (so)) @@ -792,7 +792,7 @@ SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int * info) { - handle = handle; /* Eliminate compiler warning */ + (void) handle; /* Eliminate compiler warning */ DBG (3, "sane_control_option: handle=%p, opt=%d, act=%d, val=%p, info=%p\n", @@ -812,7 +812,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) SANE_UNFIX (optionBotRightYValue - optionTopLeftYValue) / MM_IN_INCH * optionResolutionValue; - handle = handle; /* Eliminate compiler warning */ + (void) handle; /* Eliminate compiler warning */ DBG (3, "sane_get_parameters\n"); parms.depth = 8; diff --git a/backend/v4l.c b/backend/v4l.c index bce3c3a12..ea80fb3db 100644 --- a/backend/v4l.c +++ b/backend/v4l.c @@ -434,7 +434,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) size_t len; FILE *fp; - authorize = authorize; /* stop gcc from complaining */ + (void) authorize; /* stop gcc from complaining */ DBG_INIT (); DBG (2, "SANE v4l backend version %d.%d build %d from %s\n", SANE_CURRENT_MAJOR, diff --git a/frontend/saned.c b/frontend/saned.c index 5b16980d3..bd58ffb25 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -2449,7 +2449,7 @@ void sig_int_term_handler (int signum) { /* unused */ - signum = signum; + (void) signum; signal (SIGINT, NULL); signal (SIGTERM, NULL); @@ -2543,7 +2543,7 @@ saned_avahi_group_callback (AvahiEntryGroup *g, AvahiEntryGroupState state, void char *n; /* unused */ - userdata = userdata; + (void) userdata; if ((!g) || (g != avahi_group)) return; @@ -2657,7 +2657,7 @@ saned_avahi_callback (AvahiClient *c, AvahiClientState state, void *userdata) int error; /* unused */ - userdata = userdata; + (void) userdata; if (!c) return; diff --git a/sanei/sanei_jpeg.c b/sanei/sanei_jpeg.c index 7b66daebf..d27701f43 100644 --- a/sanei/sanei_jpeg.c +++ b/sanei/sanei_jpeg.c @@ -57,8 +57,8 @@ typedef ppm_dest_struct *ppm_dest_ptr; METHODDEF (void) sanei_jpeg_start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) { - cinfo = cinfo; - dinfo = dinfo; + (void) cinfo; + (void) dinfo; /* header image is supplied for us */ } @@ -66,8 +66,8 @@ sanei_jpeg_start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) METHODDEF (void) sanei_jpeg_finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) { - cinfo = cinfo; - dinfo = dinfo; + (void) cinfo; + (void) dinfo; /* nothing to do */ } @@ -85,9 +85,9 @@ sanei_jpeg_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied, char *data) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; - cinfo = cinfo; - dinfo = dinfo; - rows_supplied = rows_supplied; + (void) cinfo; + (void) dinfo; + (void) rows_supplied; memcpy (data, dest->iobuffer, dest->buffer_width); } @@ -107,9 +107,9 @@ sanei_jpeg_copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, register JSAMPROW ptr; register JDIMENSION col; - cinfo = cinfo; - dinfo = dinfo; - rows_supplied = rows_supplied; + (void) cinfo; + (void) dinfo; + (void) rows_supplied; ptr = dest->pub.buffer[0]; bufferptr = dest->iobuffer; @@ -140,7 +140,7 @@ sanei_jpeg_put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, register JSAMPROW color_map2 = cinfo->colormap[2]; register JDIMENSION col; - rows_supplied = rows_supplied; + (void) rows_supplied; ptr = dest->pub.buffer[0]; bufferptr = dest->iobuffer; @@ -165,7 +165,7 @@ sanei_jpeg_put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, register JSAMPROW color_map = cinfo->colormap[0]; register JDIMENSION col; - rows_supplied = rows_supplied; + (void) rows_supplied; ptr = dest->pub.buffer[0]; bufferptr = dest->iobuffer; diff --git a/sanei/sanei_magic.c b/sanei/sanei_magic.c index f5d1ac011..e62c56a42 100644 --- a/sanei/sanei_magic.c +++ b/sanei/sanei_magic.c @@ -527,7 +527,7 @@ sanei_magic_findSkew(SANE_Parameters * params, SANE_Byte * buffer, DBG (10, "sanei_magic_findSkew: start\n"); - dpiX=dpiX; + (void) dpiX; /* get buffers for edge detection */ topBuf = sanei_magic_getTransY(params,dpiY,buffer,1); @@ -1406,7 +1406,7 @@ getLine (int height, int width, int * buff, minSlope,maxSlope,minOffset,maxOffset); /*silence compiler*/ - height = height; + (void) height; if(absMaxSlope < absMinSlope) absMaxSlope = absMinSlope;