summaryrefslogtreecommitdiff
path: root/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch')
-rw-r--r--debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch b/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch
new file mode 100644
index 0000000..01142f6
--- /dev/null
+++ b/debian/patches/0001-Prevent-overflow-on-32-bit-architectures.patch
@@ -0,0 +1,21 @@
+From: Gard Spreemann <gspr@nonempty.org>
+Date: Sun, 8 Mar 2020 15:14:54 +0100
+Subject: Prevent overflow on 32 bit architectures.
+
+---
+ ripser.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ripser.cpp b/ripser.cpp
+index cd546e8..79e5c89 100644
+--- a/ripser.cpp
++++ b/ripser.cpp
+@@ -80,7 +80,7 @@ static const std::string clear_line("\r\033[K");
+ static const size_t num_coefficient_bits = 8;
+
+ static const index_t max_simplex_index =
+- (1l << (8 * sizeof(index_t) - 1 - num_coefficient_bits)) - 1;
++ ((index_t)1 << (8 * sizeof(index_t) - 1 - num_coefficient_bits)) - 1;
+
+ void check_overflow(index_t i) {
+ if