summaryrefslogtreecommitdiffstats
path: root/external/mdds
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
commit940b4d1848e8c70ab7642901a68594e8016caffc (patch)
treeeb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /external/mdds
parentInitial commit. (diff)
downloadlibreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.tar.xz
libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.zip
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/mdds')
-rw-r--r--external/mdds/Makefile7
-rw-r--r--external/mdds/Module_mdds.mk16
-rw-r--r--external/mdds/README4
-rw-r--r--external/mdds/UnpackedTarball_mdds.mk21
-rw-r--r--external/mdds/delta-signed-int.diff44
-rw-r--r--external/mdds/remove-warnings.diff84
6 files changed, 176 insertions, 0 deletions
diff --git a/external/mdds/Makefile b/external/mdds/Makefile
new file mode 100644
index 000000000..e4968cf85
--- /dev/null
+++ b/external/mdds/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/mdds/Module_mdds.mk b/external/mdds/Module_mdds.mk
new file mode 100644
index 000000000..47745940b
--- /dev/null
+++ b/external/mdds/Module_mdds.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,mdds))
+
+$(eval $(call gb_Module_add_targets,mdds,\
+ UnpackedTarball_mdds \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/mdds/README b/external/mdds/README
new file mode 100644
index 000000000..140f07bac
--- /dev/null
+++ b/external/mdds/README
@@ -0,0 +1,4 @@
+Multi-dimensional data structure (mdds) library, available from [https://gitlab.com/mdds/mdds].
+
+mdds primarily provides data structures that are used by the calc
+core.
diff --git a/external/mdds/UnpackedTarball_mdds.mk b/external/mdds/UnpackedTarball_mdds.mk
new file mode 100644
index 000000000..17834c6d1
--- /dev/null
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -0,0 +1,21 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,mdds))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+ external/mdds/remove-warnings.diff \
+ external/mdds/delta-signed-int.diff \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/mdds/delta-signed-int.diff b/external/mdds/delta-signed-int.diff
new file mode 100644
index 000000000..8612b8543
--- /dev/null
+++ b/external/mdds/delta-signed-int.diff
@@ -0,0 +1,44 @@
+diff --git a/include/mdds/multi_type_vector.hpp b/include/mdds/multi_type_vector.hpp
+index d941ee2..71c34f3 100644
+--- a/include/mdds/multi_type_vector.hpp
++++ b/include/mdds/multi_type_vector.hpp
+@@ -1071,7 +1071,7 @@ public:
+
+ private:
+
+- void adjust_block_positions(int64_t start_block_index, size_type delta);
++ void adjust_block_positions(int64_t start_block_index, int64_t delta);
+
+ /**
+ * Delete only the element block owned by an outer block.
+diff --git a/include/mdds/multi_type_vector_def.inl b/include/mdds/multi_type_vector_def.inl
+index d4fff49..7509e3e 100644
+--- a/include/mdds/multi_type_vector_def.inl
++++ b/include/mdds/multi_type_vector_def.inl
+@@ -503,7 +503,7 @@ multi_type_vector<_CellBlockFunc, _EventFunc>::set(const iterator& pos_hint, siz
+ }
+
+ template<typename _CellBlockFunc, typename _EventFunc>
+-void multi_type_vector<_CellBlockFunc, _EventFunc>::adjust_block_positions(int64_t start_block_index, size_type delta)
++void multi_type_vector<_CellBlockFunc, _EventFunc>::adjust_block_positions(int64_t start_block_index, int64_t delta)
+ {
+ int64_t n = m_blocks.size();
+
+@@ -2927,7 +2927,7 @@ void multi_type_vector<_CellBlockFunc, _EventFunc>::erase_impl(size_type start_r
+ // Now, erase all blocks in between.
+ delete_element_blocks(it_erase_begin, it_erase_end);
+ auto it_adjust_block = m_blocks.erase(it_erase_begin, it_erase_end);
+- size_type delta = end_row - start_row + 1;
++ int64_t delta = end_row - start_row + 1;
+ m_cur_size -= delta;
+
+ if (m_blocks.empty())
+@@ -2945,7 +2945,7 @@ void multi_type_vector<_CellBlockFunc, _EventFunc>::erase_in_single_block(
+ {
+ // Range falls within the same block.
+ block* blk = &m_blocks[block_pos];
+- size_type size_to_erase = end_pos - start_pos + 1;
++ int64_t size_to_erase = end_pos - start_pos + 1;
+ if (blk->mp_data)
+ {
+ // Erase data in the data block.
diff --git a/external/mdds/remove-warnings.diff b/external/mdds/remove-warnings.diff
new file mode 100644
index 000000000..b98ddb9ee
--- /dev/null
+++ b/external/mdds/remove-warnings.diff
@@ -0,0 +1,84 @@
+diff --git a/configure.ac b/configure.ac
+index ef22726..00ab937 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,7 +70,7 @@ AC_ARG_ENABLE(openmp,
+ )
+
+ AS_IF([test x"$enable_openmp" == "xyes"], [
+- CXXFLAGS="$CXXFLAGS -fopenmp"
++ CXXFLAGS="$CXXFLAGS -fopenmp -DMDDS_USE_OPENMP=1"
+ LDFLAGS="$LDFLAGS -fopenmp"
+ ])
+
+diff --git a/include/mdds/global.hpp b/include/mdds/global.hpp
+index f92f0a5..11f0325 100644
+--- a/include/mdds/global.hpp
++++ b/include/mdds/global.hpp
+@@ -65,6 +65,10 @@
+ #define MDDS_LOOP_UNROLLING 1
+ #endif
+
++#ifndef MDDS_USE_OPENMP
++#define MDDS_USE_OPENMP 0
++#endif
++
+ namespace mdds {
+
+ class general_error : public ::std::exception
+diff --git a/include/mdds/multi_type_vector.hpp b/include/mdds/multi_type_vector.hpp
+index 1c50a42..d941ee2 100644
+--- a/include/mdds/multi_type_vector.hpp
++++ b/include/mdds/multi_type_vector.hpp
+@@ -1126,8 +1126,7 @@ private:
+ void append_cell_to_block(size_type block_index, const _T& cell);
+
+ template<typename _T>
+- iterator set_cell_to_empty_block(
+- size_type start_row, size_type block_index, size_type pos_in_block, const _T& cell);
++ iterator set_cell_to_empty_block(size_type block_index, size_type pos_in_block, const _T& cell);
+
+ template<typename _T>
+ iterator set_cell_to_block_of_size_one(
+diff --git a/include/mdds/multi_type_vector_def.inl b/include/mdds/multi_type_vector_def.inl
+index a4cfe6d..d4fff49 100644
+--- a/include/mdds/multi_type_vector_def.inl
++++ b/include/mdds/multi_type_vector_def.inl
+@@ -516,7 +516,9 @@ void multi_type_vector<_CellBlockFunc, _EventFunc>::adjust_block_positions(int64
+ int64_t rem = len % 8;
+ len -= rem;
+ len += start_block_index;
++#if MDDS_USE_OPENMP
+ #pragma omp parallel for
++#endif
+ for (int64_t i = start_block_index; i < len; i += 8)
+ {
+ m_blocks[i].m_position += delta;
+@@ -533,7 +535,9 @@ void multi_type_vector<_CellBlockFunc, _EventFunc>::adjust_block_positions(int64
+ for (int64_t i = len; i < rem; ++i)
+ m_blocks[i].m_position += delta;
+ #else
++#if MDDS_USE_OPENMP
+ #pragma omp parallel for
++#endif
+ for (int64_t i = start_block_index; i < n; ++i)
+ m_blocks[i].m_position += delta;
+ #endif
+@@ -583,7 +587,7 @@ multi_type_vector<_CellBlockFunc, _EventFunc>::set_impl(size_type pos, size_type
+ if (!blk->mp_data)
+ {
+ // This is an empty block.
+- return set_cell_to_empty_block(start_row, block_index, pos_in_block, value);
++ return set_cell_to_empty_block(block_index, pos_in_block, value);
+ }
+
+ assert(blk->mp_data);
+@@ -1027,7 +1031,7 @@ template<typename _CellBlockFunc, typename _EventFunc>
+ template<typename _T>
+ typename multi_type_vector<_CellBlockFunc, _EventFunc>::iterator
+ multi_type_vector<_CellBlockFunc, _EventFunc>::set_cell_to_empty_block(
+- size_type start_row, size_type block_index, size_type pos_in_block, const _T& cell)
++ size_type block_index, size_type pos_in_block, const _T& cell)
+ {
+ block* blk = &m_blocks[block_index];
+ assert(!blk->mp_data); // In this call, the current block is an empty block.