coolscan2, coolscan3: Fix initialization of enum members in struct

GCC warns when setting an enum member to 0 without an explicit cast.
Use the corresponding value in the enum type instead.
merge-requests/701/head
David Ward 2022-03-08 19:00:00 -05:00
rodzic 47fd7538bc
commit 6048724f22
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -468,7 +468,10 @@ sane_open (SANE_String_Const name, SANE_Handle * h)
for (i_option = 0; i_option < CS2_N_OPTIONS; i_option++)
{
o.name = o.title = o.desc = NULL;
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
o.type = SANE_TYPE_BOOL;
o.unit = SANE_UNIT_NONE;
o.size = o.cap = 0;
o.constraint_type = SANE_CONSTRAINT_NONE;
o.constraint.range = NULL; /* only one union member needs to be NULLed */
switch (i_option)
{

Wyświetl plik

@ -424,7 +424,10 @@ sane_open(SANE_String_Const name, SANE_Handle * h)
for (i_option = 0; i_option < CS3_N_OPTIONS; i_option++) {
o.name = o.title = o.desc = NULL;
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
o.type = SANE_TYPE_BOOL;
o.unit = SANE_UNIT_NONE;
o.size = o.cap = 0;
o.constraint_type = SANE_CONSTRAINT_NONE;
o.constraint.range = NULL; /* only one union member needs to be NULLed */
switch (i_option) {
case CS3_OPTION_NUM: