diff --git a/backend/genesys.cc b/backend/genesys.cc index 52a0cd3c3..9115c0e4d 100644 --- a/backend/genesys.cc +++ b/backend/genesys.cc @@ -182,7 +182,7 @@ sanei_genesys_init_structs (Genesys_Device * dev) { if (dev->model->gpo_type == Gpo[i].gpo_id) { - memcpy (&dev->gpo, &Gpo[i], sizeof (Genesys_Gpo)); + dev->gpo = Gpo[i]; gpo_ok = 1; } } @@ -220,7 +220,7 @@ sanei_genesys_init_fe (Genesys_Device * dev) { if (dev->model->dac_type == Wolfson[i].fe_id) { - memcpy (&dev->frontend, &Wolfson[i], sizeof (Genesys_Frontend)); + dev->frontend = Wolfson[i]; return; } } @@ -2968,7 +2968,7 @@ genesys_restore_calibration (Genesys_Device * dev) */ if (status == SANE_STATUS_GOOD) { - memcpy (&dev->frontend, &cache.frontend, sizeof (dev->frontend)); + dev->frontend = cache.frontend; /* we don't restore the gamma fields */ dev->sensor.exposure = cache.sensor.exposure; @@ -3054,9 +3054,9 @@ genesys_save_calibration (Genesys_Device * dev) found_cache_it->dark_average_data = dev->dark_average_data; found_cache_it->white_average_data = dev->white_average_data; - memcpy (&found_cache_it->used_setup, &dev->current_setup, sizeof (found_cache_it->used_setup)); - memcpy (&found_cache_it->frontend, &dev->frontend, sizeof (found_cache_it->frontend)); - memcpy (&found_cache_it->sensor, &dev->sensor, sizeof (found_cache_it->sensor)); + found_cache_it->used_setup = dev->current_setup; + found_cache_it->frontend = dev->frontend; + found_cache_it->sensor = dev->sensor; found_cache_it->calib_pixels = dev->calib_pixels; found_cache_it->calib_channels = dev->calib_channels; diff --git a/backend/genesys_low.h b/backend/genesys_low.h index 6dad4b91a..a053ace67 100644 --- a/backend/genesys_low.h +++ b/backend/genesys_low.h @@ -1198,10 +1198,10 @@ struct Genesys_Calibration_Cache ~Genesys_Calibration_Cache() = default; // used to check if entry is compatible - Genesys_Current_Setup used_setup = {}; + Genesys_Current_Setup used_setup; time_t last_calibration = 0; - Genesys_Frontend frontend = {}; + Genesys_Frontend frontend; Genesys_Sensor sensor; size_t calib_pixels = 0; @@ -1243,10 +1243,10 @@ struct Genesys_Device Genesys_Register_Set reg; Genesys_Register_Set calib_reg; - Genesys_Settings settings = {}; - Genesys_Frontend frontend = {}; + Genesys_Settings settings; + Genesys_Frontend frontend; Genesys_Sensor sensor; - Genesys_Gpo gpo = {}; + Genesys_Gpo gpo; Genesys_Motor motor; uint16_t slope_table0[256] = {}; uint16_t slope_table1[256] = {}; @@ -1301,7 +1301,7 @@ struct Genesys_Device size_t wpl = 0; // contains the real used values - Genesys_Current_Setup current_setup = {}; + Genesys_Current_Setup current_setup; // look up table used in dynamic rasterization unsigned char lineart_lut[256] = {};