genesys: Switch session startx and starty to unsigned

The sources and destinations are integer in most cases for these
variables.
merge-requests/215/head
Povilas Kanapickas 2019-10-13 06:18:48 +03:00
rodzic 0840c6e9d9
commit a694002364
3 zmienionych plików z 7 dodań i 11 usunięć

Wyświetl plik

@ -1043,11 +1043,7 @@ static void gl843_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
Genesys_Register_Set* reg, unsigned int exposure,
const ScanSession& session)
{
DBG_HELPER_ARGS(dbg, "exposure=%d, used_res=%d, start=%f, pixels=%d, channels=%d, depth=%d, "
"ccd_size_divisor=%d",
exposure, session.output_resolution, session.params.startx,
session.optical_pixels, session.params.channels, session.params.depth,
session.ccd_size_divisor);
DBG_HELPER_ARGS(dbg, "exposure=%d", exposure);
unsigned int dpihw;
unsigned int tgtime; /**> exposure time multiplier */
GenesysRegister *r;
@ -2370,8 +2366,8 @@ void CommandSetGl843::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
ScanSession session;
session.params.xres = dev->settings.xres;
session.params.yres = dev->settings.yres;
session.params.startx = start;
session.params.starty = move;
session.params.startx = static_cast<unsigned>(start);
session.params.starty = static_cast<unsigned>(move);
session.params.pixels = dev->settings.pixels;
session.params.requested_pixels = dev->settings.requested_pixels;
session.params.lines = dev->settings.lines;

Wyświetl plik

@ -2517,7 +2517,7 @@ void debug_dump(unsigned level, const SetupParams& params)
"Pixels per line (requested) : %u\n"
"Depth : %u\n"
"Channels : %u\n"
"Start position X/Y : %g / %g\n"
"Start position X/Y : %u / %u\n"
"Scan mode : %d\n"
"Color filter : %d\n"
"Flags : %x\n",

Wyświetl plik

@ -114,9 +114,9 @@ struct SetupParams {
// resolution in y direction
unsigned yres = NOT_SET;
// start pixel in X direction, from dummy_pixel + 1
float startx = -1;
unsigned startx = NOT_SET;
// start pixel in Y direction, counted according to base_ydpi
float starty = -1;
unsigned starty = NOT_SET;
// the number of pixels in X direction. Note that each logical pixel may correspond to more
// than one CCD pixel, see CKSEL and GenesysSensor::ccd_pixels_per_system_pixel()
unsigned pixels = NOT_SET;
@ -153,7 +153,7 @@ struct SetupParams {
void assert_valid() const
{
if (xres == NOT_SET || yres == NOT_SET || startx < 0 || starty < 0 ||
if (xres == NOT_SET || yres == NOT_SET || startx == NOT_SET || starty == NOT_SET ||
pixels == NOT_SET || lines == NOT_SET ||depth == NOT_SET || channels == NOT_SET ||
scan_method == static_cast<ScanMethod>(NOT_SET) ||
scan_mode == static_cast<ScanColorMode>(NOT_SET) ||