git: 3296a983f093 - main - devel/indi: unbreak the port's build on 32-bit architectures

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Sat, 31 Dec 2022 09:15:00 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3296a983f093e8ea98305e4d60e3b0e94fd49b23

commit 3296a983f093e8ea98305e4d60e3b0e94fd49b23
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-12-31 09:13:30 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-12-31 09:13:30 +0000

    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)
---
 .../files/patch-libs_indibase_dsp_dspinterface.cpp | 15 +++++++++++++++
 ...ch-libs_indibase_property_indipropertybasic.cpp | 22 ++++++++++++++++++++++
 ...atch-libs_indibase_property_indipropertybasic.h | 11 +++++++++++
 3 files changed, 48 insertions(+)

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();