package/sane-backends: fix gcc-4.8 compile
authorPeter Seiderer <ps.report@gmx.net>
Mon, 15 Mar 2021 20:13:45 +0000 (21:13 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 16 Mar 2021 21:00:26 +0000 (22:00 +0100)
Add patch to use legacy initializer variant to fix gcc-4.8 compile.

Fixes:

  - http://autobuild.buildroot.net/results/9d1cd0d0aa8c929c4b1b23b04075c331c1be80e0

  genesys/utilities.h:229:23: error: invalid initialization of non-const reference of type 'std::basic_ios<char>&' from an rvalue of type '<brace-enclosed initializer list>'
           stream_{stream}
                         ^
  genesys/image_pipeline.cpp:715:19: error: invalid initialization of non-const reference of type 'genesys::ImagePipelineNode&' from an rvalue of type '<brace-enclosed initializer list>'
       source_{source}
                     ^

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/sane-backends/0002-genesys-fix-gcc-4.8-compile.patch [new file with mode: 0644]

diff --git a/package/sane-backends/0002-genesys-fix-gcc-4.8-compile.patch b/package/sane-backends/0002-genesys-fix-gcc-4.8-compile.patch
new file mode 100644 (file)
index 0000000..8034659
--- /dev/null
@@ -0,0 +1,50 @@
+From f67cfd6a534e9faaca83afebd61a6d77d7837174 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Mon, 15 Mar 2021 20:53:55 +0100
+Subject: [PATCH] genesys: fix gcc-4.8 compile
+
+Fixes:
+
+  genesys/utilities.h:229:23: error: invalid initialization of non-const reference of type 'std::basic_ios<char>&' from an rvalue of type '<brace-enclosed initializer list>'
+           stream_{stream}
+                         ^
+  genesys/image_pipeline.cpp:715:19: error: invalid initialization of non-const reference of type 'genesys::ImagePipelineNode&' from an rvalue of type '<brace-enclosed initializer list>'
+       source_{source}
+                     ^
+
+[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/609]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ backend/genesys/image_pipeline.cpp | 2 +-
+ backend/genesys/utilities.h        | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/backend/genesys/image_pipeline.cpp b/backend/genesys/image_pipeline.cpp
+index 4161e95..14e2f8d 100644
+--- a/backend/genesys/image_pipeline.cpp
++++ b/backend/genesys/image_pipeline.cpp
+@@ -712,7 +712,7 @@ ImagePipelineNodeCalibrate::ImagePipelineNodeCalibrate(ImagePipelineNode& source
+                                                        const std::vector<std::uint16_t>& bottom,
+                                                        const std::vector<std::uint16_t>& top,
+                                                        std::size_t x_start) :
+-    source_{source}
++    source_(source)
+ {
+     std::size_t size = 0;
+     if (bottom.size() >= x_start && top.size() >= x_start) {
+diff --git a/backend/genesys/utilities.h b/backend/genesys/utilities.h
+index 6e637d0..2ef2ddd 100644
+--- a/backend/genesys/utilities.h
++++ b/backend/genesys/utilities.h
+@@ -226,7 +226,7 @@ class BasicStreamStateSaver
+ {
+ public:
+     explicit BasicStreamStateSaver(std::basic_ios<Char, Traits>& stream) :
+-        stream_{stream}
++        stream_(stream)
+     {
+         flags_ = stream_.flags();
+         width_ = stream_.width();
+-- 
+2.30.1
+