kopia lustrzana https://gitlab.com/sane-project/backends
Remove useless conditionals which cause compiler warnings
These always evaluate to true in the context of the surrounding code.merge-requests/701/head
rodzic
b3d105cba5
commit
0d032cd982
10
backend/hp.c
10
backend/hp.c
|
@ -581,13 +581,9 @@ hp_get_dev (const char *devname, HpDevice* devp)
|
|||
DBG(3, "hp_get_dev: New device %s, connect-%s, scsi-request=%lu\n",
|
||||
devname, connect, (unsigned long)info->config.use_scsi_request);
|
||||
|
||||
if (!ptr)
|
||||
{
|
||||
status = sanei_hp_device_new (&new, devname);
|
||||
|
||||
if ( status != SANE_STATUS_GOOD )
|
||||
return status;
|
||||
}
|
||||
status = sanei_hp_device_new (&new, devname);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return status;
|
||||
|
||||
if (devp)
|
||||
*devp = new;
|
||||
|
|
|
@ -1523,19 +1523,16 @@ static SANE_Int hp3800_checkstable(SANE_Int lamp, struct st_checkstable *check)
|
|||
|
||||
SANE_Int rst = ERROR;
|
||||
|
||||
if (reg != NULL)
|
||||
{
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
|
||||
for (a = 0; a < count; a++)
|
||||
for (a = 0; a < count; a++)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1560,19 +1557,16 @@ static SANE_Int hp3970_checkstable(SANE_Int lamp, struct st_checkstable *check)
|
|||
|
||||
SANE_Int rst = ERROR;
|
||||
|
||||
if (reg != NULL)
|
||||
{
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
|
||||
for (a = 0; a < count; a++)
|
||||
for (a = 0; a < count; a++)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1597,19 +1591,16 @@ static SANE_Int hp4370_checkstable(SANE_Int lamp, struct st_checkstable *check)
|
|||
|
||||
SANE_Int rst = ERROR;
|
||||
|
||||
if (reg != NULL)
|
||||
{
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
|
||||
for (a = 0; a < count; a++)
|
||||
for (a = 0; a < count; a++)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1634,19 +1625,16 @@ static SANE_Int ua4900_checkstable(SANE_Int lamp, struct st_checkstable *check)
|
|||
|
||||
SANE_Int rst = ERROR;
|
||||
|
||||
if (reg != NULL)
|
||||
{
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
SANE_Int a;
|
||||
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
|
||||
|
||||
for (a = 0; a < count; a++)
|
||||
for (a = 0; a < count; a++)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
if (reg[a].lamp == lamp)
|
||||
{
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
memcpy(check, ®[a].values, sizeof(struct st_checkstable));
|
||||
rst = OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue