aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2022-12-31 09:13:30 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2022-12-31 09:13:30 +0000
commit3296a983f093e8ea98305e4d60e3b0e94fd49b23 (patch)
tree4e0bf1a647e2ce05c1443fab56888012c6fde43e
parent19e238d38d9e0ab966e6297264214055e47c7253 (diff)
downloadports-3296a983f093e8ea98305e4d60e3b0e94fd49b23.tar.gz
ports-3296a983f093e8ea98305e4d60e3b0e94fd49b23.zip
devel/indi: unbreak the port's build on 32-bit architectures
Use of overloaded operator [] is ambiguous (with operand types INDI:: PropertyNumber and int) because candidate function ``WidgetView<T> &operator[](size_t index) const'' conflicts with built-in candidate operator. Use signed type with an assertion to avoid the clash. On 64-bit machines `size_t' is 64-bit but `int' is still 32-bit so there's no clash. Obtained from: upstream (partially)
-rw-r--r--devel/indi/files/patch-libs_indibase_dsp_dspinterface.cpp15
-rw-r--r--devel/indi/files/patch-libs_indibase_property_indipropertybasic.cpp22
-rw-r--r--devel/indi/files/patch-libs_indibase_property_indipropertybasic.h11
3 files changed, 48 insertions, 0 deletions
diff --git a/devel/indi/files/patch-libs_indibase_dsp_dspinterface.cpp b/devel/indi/files/patch-libs_indibase_dsp_dspinterface.cpp
new file mode 100644
index 000000000000..07dc70d35c8d
--- /dev/null
+++ b/devel/indi/files/patch-libs_indibase_dsp_dspinterface.cpp
@@ -0,0 +1,15 @@
+--- libs/indibase/dsp/dspinterface.cpp.orig 2022-05-21 13:52:23 UTC
++++ libs/indibase/dsp/dspinterface.cpp
+@@ -336,9 +336,9 @@ dsp_stream_p Interface::loadFITS(char* buffer, int len
+ long ndims;
+ long bits_per_sample;
+ int status;
+- off_t offset;
+- off_t head;
+- off_t end;
++ OFF_T offset;
++ OFF_T head;
++ OFF_T end;
+ fitsfile *fptr;
+ void* buf;
+ char error_status[MAXINDINAME];
diff --git a/devel/indi/files/patch-libs_indibase_property_indipropertybasic.cpp b/devel/indi/files/patch-libs_indibase_property_indipropertybasic.cpp
new file mode 100644
index 000000000000..88fb1d26d317
--- /dev/null
+++ b/devel/indi/files/patch-libs_indibase_property_indipropertybasic.cpp
@@ -0,0 +1,22 @@
+--- libs/indibase/property/indipropertybasic.cpp.orig 2022-05-21 13:52:23 UTC
++++ libs/indibase/property/indipropertybasic.cpp
+@@ -16,6 +16,7 @@
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include <cassert>
+ #include "indipropertybasic.h"
+ #include "indipropertybasic_p.h"
+
+@@ -342,9 +343,10 @@ const WidgetView<T> *PropertyBasic<T>::at(size_t index
+ }
+
+ template <typename T>
+-WidgetView<T> &PropertyBasic<T>::operator[](size_t index) const
++WidgetView<T> &PropertyBasic<T>::operator[](ssize_t index) const
+ {
+ D_PTR(const PropertyBasic);
++ assert(index >= 0);
+ return *d->property.at(index);
+ }
+
diff --git a/devel/indi/files/patch-libs_indibase_property_indipropertybasic.h b/devel/indi/files/patch-libs_indibase_property_indipropertybasic.h
new file mode 100644
index 000000000000..383a82ef1277
--- /dev/null
+++ b/devel/indi/files/patch-libs_indibase_property_indipropertybasic.h
@@ -0,0 +1,11 @@
+--- libs/indibase/property/indipropertybasic.h.orig 2022-05-21 13:52:23 UTC
++++ libs/indibase/property/indipropertybasic.h
+@@ -110,7 +110,7 @@ class PropertyBasic : public INDI::Property (public)
+
+ const WidgetView<T> *at(size_t index) const;
+
+- WidgetView<T> &operator[](size_t index) const;
++ WidgetView<T> &operator[](ssize_t index) const;
+
+ public: // STL-style iterators
+ WidgetView<T> *begin();