I would like the attached patch to be merged to the 3-6 branch in order
to update the internal mdds to 0.6.1. This version fixes one important
bug in the iterator implementation of flat_segment_tree, so having 0.6.1
available will make it easier to backport any future fixes I might
backport to 3.6.
I've also attached relevant changes (changes that affect libreoffice)
between 0.6.0 and 0.6.1.
Thanks,
Kohei
--
Kohei Yoshida, LibreOffice hacker, Calc
From 9d289c7b6f106a31afc7184c3e21896aaf998819 Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yoshida@gmail.com>
Date: Tue, 18 Sep 2012 10:14:45 -0400
Subject: [PATCH] Update mdds to 0.6.1.
Change-Id: Ic400620f1bab54cf9b535193b62840243cdede77
---
mdds/0001-Workaround-for-gcc-bug.patch | 27 +++++++++
mdds/0001-fix-linking-error-with-boost-1.50.patch | 27 ---------
mdds/makefile.mk | 10 ++--
mdds/mdds_0.5.3.patch | 62 ---------------------
mdds/mdds_0.6.0.patch | 54 ++++++++++++++++++
ooo.lst.in | 2 +-
6 files changed, 87 insertions(+), 95 deletions(-)
create mode 100644 mdds/0001-Workaround-for-gcc-bug.patch
delete mode 100644 mdds/0001-fix-linking-error-with-boost-1.50.patch
delete mode 100644 mdds/mdds_0.5.3.patch
create mode 100644 mdds/mdds_0.6.0.patch
diff --git a/mdds/0001-Workaround-for-gcc-bug.patch b/mdds/0001-Workaround-for-gcc-bug.patch
new file mode 100644
index 0000000..4205ea5
--- /dev/null
+++ b/mdds/0001-Workaround-for-gcc-bug.patch
@@ -0,0 +1,27 @@
+From e1c795c8734119985ea09bf4d9f860d11e440b2a Mon Sep 17 00:00:00 2001
+From: Kohei Yoshida <kohei.yoshida@gmail.com>
+Date: Mon, 30 Jul 2012 14:36:24 -0400
+Subject: [PATCH] Workaround for gcc bug.
+
+c.f. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44963
+---
+ include/mdds/multi_type_vector_types.hpp | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/include/mdds/multi_type_vector_types.hpp b/include/mdds/multi_type_vector_types.hpp
+index 78f18cb..6189139 100644
+--- a/include/mdds/multi_type_vector_types.hpp
++++ misc/build/mdds_0.6.1/include/mdds/multi_type_vector_types.hpp
+@@ -218,7 +218,8 @@ public:
+ typename store_type::const_iterator it_end = it;
+ std::advance(it_end, len);
+ d.reserve(d.size() + len);
+- std::copy(it, it_end, std::back_inserter(d));
++ for (; it != it_end; ++it)
++ d.push_back(*it);
+ }
+
+ static void assign_values_from_block(
+--
+1.7.7
+
diff --git a/mdds/0001-fix-linking-error-with-boost-1.50.patch
b/mdds/0001-fix-linking-error-with-boost-1.50.patch
deleted file mode 100644
index c5a4afc..0000000
--- a/mdds/0001-fix-linking-error-with-boost-1.50.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 09937e5d6b4b82efbff40da2aa50fb02f2250bb2 Mon Sep 17 00:00:00 2001
-From: David Tardon <dtardon@redhat.com>
-Date: Sat, 28 Jul 2012 14:32:47 +0200
-Subject: [PATCH] fix linking error with boost 1.50
-
----
- include/mdds/mixed_type_matrix_storage.hpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/include/mdds/mixed_type_matrix_storage.hpp
b/include/mdds/mixed_type_matrix_storage.hpp
-index fa0bf25..bb4e354 100644
---- a/include/mdds/mixed_type_matrix_storage.hpp
-+++ misc/build/mdds_0.5.3/include/mdds/mixed_type_matrix_storage.hpp
-@@ -32,6 +32,10 @@
-
- #include <boost/ptr_container/ptr_vector.hpp>
- #include <boost/ptr_container/ptr_map.hpp>
-+// Boost.Pool indirectly pulls in Boost.System, causing linking error
-+// with Boost 1.50, because some (deprecated) symbols from System are
-+// not found.
-+#define BOOST_SYSTEM_NO_DEPRECATED
- #include <boost/pool/object_pool.hpp>
-
- namespace mdds {
---
-1.7.11.2
-
diff --git a/mdds/makefile.mk b/mdds/makefile.mk
index 0063870..7338e0a 100644
--- a/mdds/makefile.mk
+++ b/mdds/makefile.mk
@@ -36,11 +36,11 @@ TARGET=mdds
# --- Files --------------------------------------------------------
-TARFILE_NAME=mdds_0.5.3
-TARFILE_MD5=0ff7d225d087793c8c2c680d77aac3e7
-PATCH_FILES=mdds_0.5.3.patch
-PATCH_FILES=\
- 0001-fix-linking-error-with-boost-1.50.patch \
+TARFILE_NAME=mdds_0.6.1
+TARFILE_MD5=9f9e15966b5624834157fe3d748312bc
+
+PATCH_FILES=mdds_0.6.0.patch \
+ 0001-Workaround-for-gcc-bug.patch
CONFIGURE_DIR=
CONFIGURE_ACTION=
diff --git a/mdds/mdds_0.5.3.patch b/mdds/mdds_0.5.3.patch
deleted file mode 100644
index 40aedb1..0000000
--- a/mdds/mdds_0.5.3.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- misc/mdds_0.5.3/include/mdds/mixed_type_matrix_def.inl 2011-07-13 13:26:27.000000000 -0600
-+++ misc/build/mdds_0.5.3/include/mdds/mixed_type_matrix_def.inl 2011-07-20
02:02:21.164198900 -0600
-@@ -44,7 +44,6 @@
- default:
- throw matrix_error("unknown density type");
- }
-- return NULL;
- }
-
- template<typename _String, typename _Flag>
-@@ -216,8 +216,8 @@
- // assignment to self.
- return;
-
-- size_t row_count = ::std::min(mp_storage->rows(), r.mp_storage->rows());
-- size_t col_count = ::std::min(mp_storage->cols(), r.mp_storage->cols());
-+ size_t row_count = (::std::min)(mp_storage->rows(), r.mp_storage->rows());
-+ size_t col_count = (::std::min)(mp_storage->cols(), r.mp_storage->cols());
- for (size_t i = 0; i < row_count; ++i)
- for (size_t j = 0; j < col_count; ++j)
- mp_storage->get_element(i, j) = r.mp_storage->get_element(i, j);
---- misc/mdds_0.5.3/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-13
13:26:27.000000000 -0600
-+++ misc/build/mdds_0.5.3/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-20
02:02:21.179798900 -0600
-@@ -354,8 +354,8 @@
- }
-
- array_type new_array(new_size, &m_init_elem);
-- size_t min_rows = ::std::min(row, m_rows);
-- size_t min_cols = ::std::min(col, m_cols);
-+ size_t min_rows = (::std::min)(row, m_rows);
-+ size_t min_cols = (::std::min)(col, m_cols);
- for (size_t i = 0; i < min_rows; ++i)
- {
- for (size_t j = 0; j < min_cols; ++j)
-@@ -612,8 +612,8 @@
- }
-
- array_type new_array(new_size, element(0.0));
-- size_t min_rows = ::std::min(row, m_rows);
-- size_t min_cols = ::std::min(col, m_cols);
-+ size_t min_rows = (::std::min)(row, m_rows);
-+ size_t min_cols = (::std::min)(col, m_cols);
- for (size_t i = 0; i < min_rows; ++i)
- {
- for (size_t j = 0; j < min_cols; ++j)
---- misc/mdds_0.5.3/include/mdds/point_quad_tree.hpp 2011-07-13 13:26:27.000000000 -0600
-+++ misc/build/mdds_0.5.3/include/mdds/point_quad_tree.hpp 2011-07-20 02:04:36.088835900 -0600
-@@ -623,10 +623,10 @@
- template<typename _Key, typename _Data>
- void point_quad_tree<_Key,_Data>::insert(key_type x, key_type y, data_type data)
- {
-- m_xrange.first = ::std::min(m_xrange.first, x);
-- m_xrange.second = ::std::max(m_xrange.second, x);
-- m_yrange.first = ::std::min(m_yrange.first, y);
-- m_yrange.second = ::std::max(m_yrange.second, y);
-+ m_xrange.first = (::std::min)(m_xrange.first, x);
-+ m_xrange.second = (::std::max)(m_xrange.second, x);
-+ m_yrange.first = (::std::min)(m_yrange.first, y);
-+ m_yrange.second = (::std::max)(m_yrange.second, y);
-
- if (!m_root)
- {
diff --git a/mdds/mdds_0.6.0.patch b/mdds/mdds_0.6.0.patch
new file mode 100644
index 0000000..d1d997c
--- /dev/null
+++ b/mdds/mdds_0.6.0.patch
@@ -0,0 +1,54 @@
+--- misc/mdds_0.6.1/include/mdds/mixed_type_matrix_def.inl 2011-07-13 13:26:27.000000000 -0600
++++ misc/build/mdds_0.6.1/include/mdds/mixed_type_matrix_def.inl 2011-07-20
02:02:21.164198900 -0600
+@@ -216,8 +216,8 @@
+ // assignment to self.
+ return;
+
+- size_t row_count = ::std::min(mp_storage->rows(), r.mp_storage->rows());
+- size_t col_count = ::std::min(mp_storage->cols(), r.mp_storage->cols());
++ size_t row_count = (::std::min)(mp_storage->rows(), r.mp_storage->rows());
++ size_t col_count = (::std::min)(mp_storage->cols(), r.mp_storage->cols());
+ for (size_t i = 0; i < row_count; ++i)
+ for (size_t j = 0; j < col_count; ++j)
+ mp_storage->get_element(i, j) = r.mp_storage->get_element(i, j);
+--- misc/mdds_0.6.1/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-13
13:26:27.000000000 -0600
++++ misc/build/mdds_0.6.1/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-20
02:02:21.179798900 -0600
+@@ -354,8 +354,8 @@
+ }
+
+ array_type new_array(new_size, &m_init_elem);
+- size_t min_rows = ::std::min(row, m_rows);
+- size_t min_cols = ::std::min(col, m_cols);
++ size_t min_rows = (::std::min)(row, m_rows);
++ size_t min_cols = (::std::min)(col, m_cols);
+ for (size_t i = 0; i < min_rows; ++i)
+ {
+ for (size_t j = 0; j < min_cols; ++j)
+@@ -612,8 +612,8 @@
+ }
+
+ array_type new_array(new_size, element(0.0));
+- size_t min_rows = ::std::min(row, m_rows);
+- size_t min_cols = ::std::min(col, m_cols);
++ size_t min_rows = (::std::min)(row, m_rows);
++ size_t min_cols = (::std::min)(col, m_cols);
+ for (size_t i = 0; i < min_rows; ++i)
+ {
+ for (size_t j = 0; j < min_cols; ++j)
+--- misc/mdds_0.6.1/include/mdds/point_quad_tree.hpp 2011-07-13 13:26:27.000000000 -0600
++++ misc/build/mdds_0.6.1/include/mdds/point_quad_tree.hpp 2011-07-20 02:04:36.088835900 -0600
+@@ -623,10 +623,10 @@
+ template<typename _Key, typename _Data>
+ void point_quad_tree<_Key,_Data>::insert(key_type x, key_type y, data_type data)
+ {
+- m_xrange.first = ::std::min(m_xrange.first, x);
+- m_xrange.second = ::std::max(m_xrange.second, x);
+- m_yrange.first = ::std::min(m_yrange.first, y);
+- m_yrange.second = ::std::max(m_yrange.second, y);
++ m_xrange.first = (::std::min)(m_xrange.first, x);
++ m_xrange.second = (::std::max)(m_xrange.second, x);
++ m_yrange.first = (::std::min)(m_yrange.first, y);
++ m_yrange.second = (::std::max)(m_yrange.second, y);
+
+ if (!m_root)
+ {
diff --git a/ooo.lst.in b/ooo.lst.in
index 9a8bf74..f4d8db9 100644
--- a/ooo.lst.in
+++ b/ooo.lst.in
@@ -83,7 +83,7 @@ a0a861f539f0e7a91d05e6b9457e4db1-nss-3.13.5-with-nspr-4.9.1.tar.gz
9d283e02441d8cebdcd1e5d9df227d67-libwpg-0.2.1.tar.bz2
c01351d7db2b205de755d58769288224-libwpd-0.9.4.tar.bz2
d197bd6211669a2fa4ca648faf04bcb1-libwps-0.2.7.tar.bz2
-0ff7d225d087793c8c2c680d77aac3e7-mdds_0.5.3.tar.bz2
+9f9e15966b5624834157fe3d748312bc-mdds_0.6.1.tar.bz2
f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2
3121aaf3e13e5d88dfff13fb4a5f1ab8-hunspell-1.3.2.tar.gz
3bf481ca95109b14435125c0dd1f2217-graphite2-1.0.3.tgz
--
1.7.3.4
diff --git a/include/mdds/flat_segment_tree_itr.hpp b/include/mdds/flat_segment_tree_itr.hpp
index b307d69..cfb5f7c 100644
--- a/include/mdds/flat_segment_tree_itr.hpp
+++ b/include/mdds/flat_segment_tree_itr.hpp
@@ -1,6 +1,6 @@
/*************************************************************************
*
- * Copyright (c) 2010 Kohei Yoshida
+ * Copyright (c) 2010-2012 Kohei Yoshida
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -38,12 +38,12 @@ struct itr_forward_handler
{
typedef _FstType fst_type;
- const typename fst_type::node* init_pos(const fst_type* _db, bool _end) const
+ static const typename fst_type::node* init_pos(const fst_type* _db, bool _end)
{
return _end ? _db->m_right_leaf.get() : _db->m_left_leaf.get();
}
- void inc(const fst_type* _db, const typename fst_type::node*& p, bool& end) const
+ static void inc(const fst_type* _db, const typename fst_type::node*& p, bool& end)
{
if (p == _db->m_right_leaf.get())
end = true;
@@ -51,7 +51,7 @@ struct itr_forward_handler
p = p->right.get();
}
- void dec(const typename fst_type::node*& p, bool& end) const
+ static void dec(const typename fst_type::node*& p, bool& end)
{
if (end)
end = false;
@@ -68,12 +68,12 @@ struct itr_reverse_handler
{
typedef _FstType fst_type;
- const typename fst_type::node* init_pos(const fst_type* _db, bool _end) const
+ static const typename fst_type::node* init_pos(const fst_type* _db, bool _end)
{
return _end ? _db->m_left_leaf.get() : _db->m_right_leaf.get();
}
- void inc(const fst_type* _db, const typename fst_type::node*& p, bool& end) const
+ static void inc(const fst_type* _db, const typename fst_type::node*& p, bool& end)
{
if (p == _db->m_left_leaf.get())
end = true;
@@ -81,7 +81,7 @@ struct itr_reverse_handler
p = p->left.get();
}
- void dec(const typename fst_type::node*& p, bool& end) const
+ static void dec(const typename fst_type::node*& p, bool& end)
{
if (end)
end = false;
@@ -93,9 +93,9 @@ struct itr_reverse_handler
template<typename _FstType, typename _Hdl>
class const_iterator_base
{
+ typedef _Hdl handler_type;
public:
typedef _FstType fst_type;
- typedef _Hdl handler_type;
// iterator traits
typedef ::std::pair<typename fst_type::key_type, typename fst_type::value_type> value_type;
@@ -110,7 +110,7 @@ public:
if (!_db)
return;
- m_pos = m_hdl.init_pos(_db, _end);
+ m_pos = handler_type::init_pos(_db, _end);
}
explicit const_iterator_base(const fst_type* _db, const typename fst_type::node* pos) :
@@ -123,20 +123,21 @@ public:
{
m_db = r.m_db;
m_pos = r.m_pos;
+ m_end_pos = r.m_end_pos;
return *this;
}
const value_type* operator++()
{
assert(m_pos);
- m_hdl.inc(m_db, m_pos, m_end_pos);
+ handler_type::inc(m_db, m_pos, m_end_pos);
return operator->();
}
const value_type* operator--()
{
assert(m_pos);
- m_hdl.dec(m_pos, m_end_pos);
+ handler_type::dec(m_pos, m_end_pos);
return operator->();
}
@@ -145,10 +146,7 @@ public:
if (m_db != r.m_db)
return false;
- if (m_end_pos == r.m_end_pos)
- return true;
-
- return (m_pos == r.m_pos);
+ return (m_pos == r.m_pos) && (m_end_pos == r.m_end_pos);
}
bool operator!=(const const_iterator_base& r) const
@@ -177,7 +175,6 @@ private:
return m_current_pair;
}
- handler_type m_hdl;
const fst_type* m_db;
const typename fst_type::node* m_pos;
value_type m_current_pair;
diff --git a/include/mdds/mixed_type_matrix_def.inl b/include/mdds/mixed_type_matrix_def.inl
index 7c129ec..2c33799 100644
--- a/include/mdds/mixed_type_matrix_def.inl
+++ b/include/mdds/mixed_type_matrix_def.inl
@@ -44,7 +44,6 @@ mixed_type_matrix<_String,_Flag>::create_storage(size_t rows, size_t cols, matri
default:
throw matrix_error("unknown density type");
}
- return NULL;
}
template<typename _String, typename _Flag>
diff --git a/include/mdds/mixed_type_matrix_storage.hpp b/include/mdds/mixed_type_matrix_storage.hpp
index fa0bf25..bb4e354 100644
--- a/include/mdds/mixed_type_matrix_storage.hpp
+++ b/include/mdds/mixed_type_matrix_storage.hpp
@@ -32,6 +32,10 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_map.hpp>
+// Boost.Pool indirectly pulls in Boost.System, causing linking error
+// with Boost 1.50, because some (deprecated) symbols from System are
+// not found.
+#define BOOST_SYSTEM_NO_DEPRECATED
#include <boost/pool/object_pool.hpp>
namespace mdds {
diff --git a/include/mdds/multi_type_vector_def.inl b/include/mdds/multi_type_vector_def.inl
index 252a260..fb72070 100644
--- a/include/mdds/multi_type_vector_def.inl
+++ b/include/mdds/multi_type_vector_def.inl
@@ -1148,7 +1148,7 @@ void multi_type_vector<_CellBlockFunc>::insert_empty_impl(size_type row,
size_ty
// Insert two new block below the current; one for the empty block being
// inserted, and one for the lower part of the current non-empty block.
- m_blocks.insert(m_blocks.begin()+block_index+1, 2, NULL);
+ m_blocks.insert(m_blocks.begin()+block_index+1, 2u, NULL);
m_blocks[block_index+1] = new block(length);
m_blocks[block_index+2] = new block(size_blk_next);
@@ -1302,7 +1302,7 @@ void multi_type_vector<_CellBlockFunc>::insert_cells_to_middle(
// Insert two new blocks.
size_type n1 = row - start_row;
size_type n2 = blk->m_size - n1;
- m_blocks.insert(m_blocks.begin()+block_index+1, 2, NULL);
+ m_blocks.insert(m_blocks.begin()+block_index+1, 2u, NULL);
blk->m_size = n1;
m_blocks[block_index+1] = new block(length);
@@ -1467,7 +1467,7 @@ void multi_type_vector<_CellBlockFunc>::set_cells_to_single_block(
assert(start_row_in_block < start_row && end_row < end_row_in_block);
// Insert two new blocks below the current one.
- m_blocks.insert(m_blocks.begin()+block_index+1, 2, NULL);
+ m_blocks.insert(m_blocks.begin()+block_index+1, 2u, NULL);
// first new block is for the data array being inserted.
size_type new_size = end_row - start_row + 1;
@@ -1985,7 +1985,7 @@ void multi_type_vector<_CellBlockFunc>::set_empty_in_single_block(
// First, insert two new blocks at position past the current block.
size_type lower_block_size = end_row_in_block - end_row;
- m_blocks.insert(m_blocks.begin()+block_index+1, 2, NULL);
+ m_blocks.insert(m_blocks.begin()+block_index+1, 2u, NULL);
m_blocks[block_index+1] = new block(empty_block_size); // empty block.
m_blocks[block_index+2] = new block(lower_block_size);
diff --git a/include/mdds/multi_type_vector_trait.hpp b/include/mdds/multi_type_vector_trait.hpp
index 4c468d3..466ed8f 100644
--- a/include/mdds/multi_type_vector_trait.hpp
+++ b/include/mdds/multi_type_vector_trait.hpp
@@ -95,7 +95,6 @@ base_element_block* element_block_func_base::create_new_block(element_t type, si
default:
throw general_error("create_new_block: failed to create a new block of unknown type.");
}
- return NULL;
}
base_element_block* element_block_func_base::clone_block(const base_element_block& block)
@@ -123,7 +122,6 @@ base_element_block* element_block_func_base::clone_block(const base_element_bloc
default:
throw general_error("clone_block: failed to clone a block of unknown type.");
}
- return NULL;
}
void element_block_func_base::delete_block(base_element_block* p)
diff --git a/include/mdds/multi_type_vector_types.hpp b/include/mdds/multi_type_vector_types.hpp
index f27ac88..f72b641 100644
--- a/include/mdds/multi_type_vector_types.hpp
+++ b/include/mdds/multi_type_vector_types.hpp
@@ -302,7 +302,7 @@ protected:
noncopyable_element_block(size_t n, const _Data& val) : base_type(n, val) {}
public:
- static _Self* clone_block(const base_element_block& blk)
+ static _Self* clone_block(const base_element_block&)
{
throw element_block_error("attempted to clone a noncopyable element block.");
}
@@ -355,6 +355,7 @@ struct managed_element_block : public copyable_element_block<managed_element_blo
typedef managed_element_block<_TypeId,_Data> self_type;
using base_type::get;
+ using base_type::set_value;
using base_type::m_array;
managed_element_block() : base_type() {}
@@ -402,6 +403,7 @@ struct noncopyable_managed_element_block : public noncopyable_element_block<nonc
using base_type::get;
using base_type::m_array;
+ using base_type::set_value;
noncopyable_managed_element_block() : base_type() {}
noncopyable_managed_element_block(size_t n) : base_type(n) {}
Context
- [REVIEW 3-6] Update mdds to 0.6.1. · Kohei Yoshida
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.