diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2023-02-16 10:20:08 +0100 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2023-02-16 10:20:08 +0100 | 
| commit | 778ebf8ee9cb22ea5727844333bcd5a6ee6bc0de (patch) | |
| tree | a754e785b286ed82b45fe4e50b980714ad80e0a7 /backend/hp3900_config.c | |
| parent | 7d8aac1f3634dc58785bec7acf097dd6bac8c394 (diff) | |
| parent | 32cb765f681299af226ca0520993cbe47ba5ecd0 (diff) | |
Merge branch 'release/debian/1.2.1-1'debian/1.2.1-1
Diffstat (limited to 'backend/hp3900_config.c')
| -rw-r--r-- | backend/hp3900_config.c | 78 | 
1 files changed, 33 insertions, 45 deletions
| diff --git a/backend/hp3900_config.c b/backend/hp3900_config.c index daeb583..c40920f 100644 --- a/backend/hp3900_config.c +++ b/backend/hp3900_config.c @@ -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;  		}  	} @@ -2719,7 +2707,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)  	{ | 
