packages/utils/sane-backends/patches/101-fix_uclibc_std_rand.patch
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00

16 lines
663 B
Diff

https://gitlab.com/sane-project/backends/issues/237
--- a/backend/genesys/image_pipeline.cpp
+++ b/backend/genesys/image_pipeline.cpp
@@ -754,7 +754,11 @@ bool ImagePipelineNodeCalibrate::get_nex
float value_f = static_cast<float>(value) / max_value;
value_f = (value_f - offset_[curr_calib_i]) * multiplier_[curr_calib_i];
+#if defined(__UCLIBC__)
+ value_f = round(value_f * max_value);
+#else
value_f = std::round(value_f * max_value);
+#endif
value = clamp<std::int32_t>(static_cast<std::int32_t>(value_f), 0, max_value);
set_raw_channel_to_row(out_data, x, ch, value, format);