From 1330d2289ba081d1ac11e83ef5644332ba1e5884 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Sat, 17 Aug 2019 11:48:59 +0300 Subject: [PATCH] genesys: Correctly initialize Sensor_Master struct --- backend/genesys_gl646.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/backend/genesys_gl646.h b/backend/genesys_gl646.h index 039db2c60..797c2469e 100644 --- a/backend/genesys_gl646.h +++ b/backend/genesys_gl646.h @@ -281,26 +281,23 @@ typedef struct */ struct Sensor_Master { - /* key */ - SANE_Int sensor; /**< sensor identifier */ - SANE_Int dpi; /**< required dpi */ - unsigned channels; // 3 channels if color scan, 1 channel for gray scan + int sensor = 0; // sensor identifier */ + int dpi = 0; // required dpi */ + unsigned channels = 0; // 3 channels if color scan, 1 channel for gray scan - /* settings */ - SANE_Int xdpi; /**< real sensor dpi, may be different from the required resolution */ - SANE_Int exposure; /**< exposure time */ - SANE_Int dpiset; /**< set sensor dpi */ - SANE_Int cksel; /**< dpiset 'divisor', part of reg 18h */ - SANE_Int dummy; /**< dummy exposure time */ - /* uint8_t regs_0x10_0x15[6];*/ - uint8_t *regs_0x10_0x15; /**< per color exposure time for CIS scanners */ + int xdpi = 0; // real sensor dpi, may be different from the required resolution */ + int exposure = 0; // exposure time */ + int dpiset = 0; // set sensor dpi */ + int cksel = 0; // dpiset 'divisor', part of reg 18h + int dummy = 0; // dummy exposure time + uint8_t *regs_0x10_0x15 = nullptr; // per color exposure time for CIS scanners // selects manual CCD/2 clock programming. I.e. we're scanning at high DPI, but clock is setup // such that we acquire only every 2nd pixel data - unsigned ccd_size_divisor; + unsigned ccd_size_divisor = 0; - uint8_t r18; /**> content of register 18h */ - uint8_t r1d; /**> content of register 1dh */ + uint8_t r18 = 0; // content of register 18h */ + uint8_t r1d = 0; // content of register 1dh */ }; /**