genesys: Don't use std identifiers from global scope

merge-requests/209/head
Povilas Kanapickas 2019-10-01 12:09:48 +03:00
rodzic bb84d6d9e4
commit 9c7199c09e
3 zmienionych plików z 10 dodań i 11 usunięć

Wyświetl plik

@ -3675,7 +3675,6 @@ static std::string calibration_filename(Genesys_Device *currdev)
std::string ret;
ret.resize(PATH_MAX);
char *ptr;
char filename[80];
unsigned int count;
unsigned int i;
@ -3688,15 +3687,15 @@ static std::string calibration_filename(Genesys_Device *currdev)
* 5 - temp dir
* 6 - then resort to current dir
*/
ptr = getenv ("HOME");
char* ptr = std::getenv("HOME");
if (ptr == nullptr) {
ptr = getenv ("USERPROFILE");
ptr = std::getenv("USERPROFILE");
}
if (ptr == nullptr) {
ptr = getenv ("TMPDIR");
ptr = std::getenv("TMPDIR");
}
if (ptr == nullptr) {
ptr = getenv ("TMP");
ptr = std::getenv("TMP");
}
/* now choose filename:
@ -4978,9 +4977,9 @@ sane_close_impl(SANE_Handle handle)
s->dev->already_initialized = false;
/* for an handful of bytes .. */
free ((void *)(size_t)s->opt[OPT_RESOLUTION].constraint.word_list);
free ((void *)(size_t)s->opt[OPT_TL_X].constraint.range);
free ((void *)(size_t)s->opt[OPT_TL_Y].constraint.range);
std::free((void *)(size_t)s->opt[OPT_RESOLUTION].constraint.word_list);
std::free((void *)(size_t)s->opt[OPT_TL_X].constraint.range);
std::free((void *)(size_t)s->opt[OPT_TL_Y].constraint.range);
s->dev->clear();

Wyświetl plik

@ -450,7 +450,7 @@ private:
std::size_t height_ = 0;
std::size_t current_line_ = 0;
std::vector<uint8_t> cached_line_;
std::vector<std::uint8_t> cached_line_;
};
// A pipeline node that scales rows to the specified width by using a point filter
@ -471,7 +471,7 @@ private:
ImagePipelineNode& source_;
std::size_t width_ = 0;
std::vector<uint8_t> cached_line_;
std::vector<std::uint8_t> cached_line_;
};
// A pipeline node that mimics the calibration behavior on Genesys chips

Wyświetl plik

@ -205,7 +205,7 @@ void set_pixel_to_row(std::uint8_t* data, std::size_t x, Pixel pixel, PixelForma
float val = (pixel.r >> 8) * 0.3f;
val += (pixel.g >> 8) * 0.59;
val += (pixel.b >> 8) * 0.11;
data[x] = static_cast<uint16_t>(val);
data[x] = static_cast<std::uint16_t>(val);
return;
}
case PixelFormat::I16: {