kopia lustrzana https://gitlab.com/sane-project/backends
Resolve compiler warnings about misleading indentation
This change is targeted at specific lines of code reported by GCC or Clang as potentially causing unintended behavior.escl-add-user-and-password
rodzic
6cc15e2b81
commit
6be83f469b
|
@ -1068,7 +1068,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
char *full_name;
|
||||
int i, num_devs;
|
||||
size_t len;
|
||||
#define ASSERT_SPACE(n) \
|
||||
#define ASSERT_SPACE(n) do \
|
||||
{ \
|
||||
if (devlist_len + (n) > devlist_size) \
|
||||
{ \
|
||||
|
@ -1080,7 +1080,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
if (!devlist) \
|
||||
return SANE_STATUS_NO_MEM; \
|
||||
} \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
DBG (3, "sane_get_devices\n");
|
||||
|
||||
|
|
|
@ -2847,7 +2847,8 @@ static void compute_averaged_planar(Genesys_Device * dev, const Genesys_Sensor&
|
|||
avgpixels = 15;
|
||||
|
||||
/* LiDE80 packs shading data */
|
||||
if (dev->model->sensor_id != SensorId::CIS_CANON_LIDE_80) {
|
||||
if (dev->model->sensor_id != SensorId::CIS_CANON_LIDE_80)
|
||||
{
|
||||
factor=1;
|
||||
fill=avgpixels;
|
||||
}
|
||||
|
@ -4888,23 +4889,23 @@ static void init_options(Genesys_Scanner* s)
|
|||
s->opt[OPT_EXTRA_SW].desc = SANE_I18N("Extra button");
|
||||
s->opt[OPT_EXTRA_SW].type = SANE_TYPE_BOOL;
|
||||
s->opt[OPT_EXTRA_SW].unit = SANE_UNIT_NONE;
|
||||
if (model->buttons & GENESYS_HAS_EXTRA_SW) {
|
||||
s->opt[OPT_EXTRA_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
|
||||
} else {
|
||||
if (model->buttons & GENESYS_HAS_EXTRA_SW)
|
||||
s->opt[OPT_EXTRA_SW].cap =
|
||||
SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
|
||||
else
|
||||
s->opt[OPT_EXTRA_SW].cap = SANE_CAP_INACTIVE;
|
||||
}
|
||||
|
||||
// transparency/scan_film button
|
||||
/* transparency/scan_film button */
|
||||
s->opt[OPT_TRANSP_SW].name = "transparency";
|
||||
s->opt[OPT_TRANSP_SW].title = SANE_I18N ("Transparency button");
|
||||
s->opt[OPT_TRANSP_SW].desc = SANE_I18N ("Transparency button");
|
||||
s->opt[OPT_TRANSP_SW].type = SANE_TYPE_BOOL;
|
||||
s->opt[OPT_TRANSP_SW].unit = SANE_UNIT_NONE;
|
||||
if (model->buttons & GENESYS_HAS_TRANSP_SW) {
|
||||
s->opt[OPT_TRANSP_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
|
||||
} else {
|
||||
if (model->buttons & GENESYS_HAS_TRANSP_SW)
|
||||
s->opt[OPT_TRANSP_SW].cap =
|
||||
SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
|
||||
else
|
||||
s->opt[OPT_TRANSP_SW].cap = SANE_CAP_INACTIVE;
|
||||
}
|
||||
|
||||
/* calibration needed */
|
||||
s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration";
|
||||
|
|
|
@ -568,7 +568,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
continue; /* ignore empty lines */
|
||||
|
||||
/* skip white space: */
|
||||
for (lp = line; isspace(*lp); ++lp);
|
||||
for (lp = line; isspace(*lp); ++lp)
|
||||
;
|
||||
strcpy (devnam, lp);
|
||||
}
|
||||
fclose (fp);
|
||||
|
|
|
@ -716,7 +716,6 @@ That is probably if the scanner disconnected the network connection
|
|||
/* pollreply is -ve */
|
||||
DBG(1, "net poll error\n");
|
||||
*status = SANE_STATUS_IO_ERROR;
|
||||
return read;
|
||||
}
|
||||
else if((fds[0].revents & POLLIN) && !(fds[0].revents & (POLLERR | POLLHUP | POLLNVAL))) {
|
||||
while (read < wanted) {
|
||||
|
@ -733,11 +732,10 @@ That is probably if the scanner disconnected the network connection
|
|||
*status = SANE_STATUS_IO_ERROR;
|
||||
|
||||
DBG(32, "net read %lu bytes:%x,%x,%x,%x,%x,%x,%x,%x\n",(unsigned long)read,buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7]);
|
||||
|
||||
return read;
|
||||
}
|
||||
else
|
||||
DBG(1, "Unknown problem with poll\n");
|
||||
|
||||
return read;
|
||||
}
|
||||
|
||||
|
|
|
@ -1201,7 +1201,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
char *full_name;
|
||||
int i, num_devs;
|
||||
size_t len;
|
||||
#define ASSERT_SPACE(n) \
|
||||
#define ASSERT_SPACE(n) do \
|
||||
{ \
|
||||
if (devlist_len + (n) > devlist_size) \
|
||||
{ \
|
||||
|
@ -1216,7 +1216,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
return SANE_STATUS_NO_MEM; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
DBG (3, "sane_get_devices: local_only = %d\n", local_only);
|
||||
|
||||
|
|
|
@ -432,10 +432,10 @@ step1 (pixma_t * s)
|
|||
int tmo = 10; /* like Windows driver, 10 sec CCD calibration ? */
|
||||
while (--tmo >= 0)
|
||||
{
|
||||
error = handle_interrupt (s, 1000); \
|
||||
if (s->cancel) \
|
||||
return PIXMA_ECANCELED; \
|
||||
if (error != PIXMA_ECANCELED && error < 0) \
|
||||
error = handle_interrupt (s, 1000);
|
||||
if (s->cancel)
|
||||
return PIXMA_ECANCELED;
|
||||
if (error != PIXMA_ECANCELED && error < 0)
|
||||
return error;
|
||||
PDBG (pixma_dbg (2, "CCD Calibration ends in %d sec.\n", tmo));
|
||||
}
|
||||
|
|
|
@ -3216,7 +3216,8 @@ _LOC void MotorP98003BackToHomeSensor( pScanData ps )
|
|||
MiscStartTimer( &timer, _SECOND * 2 );
|
||||
|
||||
while(!(IOGetScanState( ps, _TRUE ) & _SCANSTATE_STOP) &&
|
||||
!MiscCheckTimer( &timer ));
|
||||
!MiscCheckTimer( &timer ))
|
||||
;
|
||||
|
||||
_DODELAY( 1000UL );
|
||||
|
||||
|
@ -3324,7 +3325,8 @@ _LOC void MotorP98003PositionYProc( pScanData ps, ULong steps)
|
|||
MiscStartTimer( &timer, _SECOND * 5 );
|
||||
|
||||
while(!(IOGetScanState( ps, _TRUE ) & _SCANSTATE_STOP) &&
|
||||
(!MiscCheckTimer( &timer )));
|
||||
!MiscCheckTimer( &timer ))
|
||||
;
|
||||
|
||||
_DODELAY( 12 );
|
||||
|
||||
|
|
|
@ -514,7 +514,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
continue; /* ignore empty lines */
|
||||
|
||||
/* skip white space: */
|
||||
for (lp = line; isspace(*lp); ++lp);
|
||||
for (lp = line; isspace(*lp); ++lp)
|
||||
;
|
||||
strcpy (devnam, lp);
|
||||
}
|
||||
fclose (fp);
|
||||
|
|
Ładowanie…
Reference in New Issue