This is an automated email from the git hooks/post-receive script. rene pushed a commit to branch master in repository mdds.
commit 63e14856f672e2d7cf96629c151216f1db525908 Author: Rene Engelhard <[email protected]> Date: Thu Apr 21 14:50:47 2016 +0200 Imported Upstream version 0.5.4 --- NEWS | 85 +++++++++++++++++++++++----------------- autogen.sh | 6 +++ configure | 32 +++++++-------- configure.ac | 52 ++++++++++++++++++++++++ include/mdds/point_quad_tree.hpp | 16 +++++++- include/mdds/segment_tree.hpp | 23 +++++++---- 6 files changed, 154 insertions(+), 60 deletions(-) diff --git a/NEWS b/NEWS index 7f9a224..57dd642 100644 --- a/NEWS +++ b/NEWS @@ -1,34 +1,49 @@ +mdds 0.5.4 + +* segment_tree + + * fixed build breakage, to allow it to be buildable when UNIT_TEST + is not defined. + + * fixed a crasher with MSVC when comparing iterators of empty + search_result instances. + +* point_quad_tree + + * fixed a bug where de-referencing copied search_result iterators + would return an uninitialized node data. + mdds 0.5.3 * mixed_type_matrix - * re-implemented the filled storage for better performance, with two - separate implementations for zero and emtpy matrix types. The - newer implementation should improve object creation time + * re-implemented the filled storage for better performance, with two + separate implementations for zero and emtpy matrix types. The + newer implementation should improve object creation time considerably. mdds 0.5.2 * flat_segment_tree - * fixed a crash on assignment by properly implementing assignment - operator(). + * fixed a crash on assignment by properly implementing assignment + operator(). * fixed several bugs in shift_right(): - * shifting of all existing nodes was not handled properly. + * shifting of all existing nodes was not handled properly. * leaf nodes were not properly linked under certain conditions. - * shifting with skip node option was not properly skipping the - node at insertion position when the insertion position was at - the leftmost node. + * shifting with skip node option was not properly skipping the + node at insertion position when the insertion position was at + the leftmost node. - * implemented min_key(), max_key(), default_value(), clear() and + * implemented min_key(), max_key(), default_value(), clear() and swap(). - * fixed a bug in operator==() where two different containers were - incorrectly evaluated to be equal. + * fixed a bug in operator==() where two different containers were + incorrectly evaluated to be equal. * added quickcheck test code. @@ -38,29 +53,29 @@ mdds 0.5.1 mdds 0.5.0 - * flat_segment_tree's search methods now return a std::pair of - const_iterator and bool, instead of just returning bool. + * flat_segment_tree's search methods now return a std::pair of + const_iterator and bool, instead of just returning bool. - * fixed a weird enum value mis-handling with mixed_type_matrix when + * fixed a weird enum value mis-handling with mixed_type_matrix when compiled with MSVC++. - * added new insert() method to flat_segment_tree that takes a - positional hint in order to speed up insertion speed. Also, all - three insert() methods now return the start position of the - segment that an inserted segment belongs to. + * added new insert() method to flat_segment_tree that takes a + positional hint in order to speed up insertion speed. Also, all + three insert() methods now return the start position of the + segment that an inserted segment belongs to. - * slight performance improvement on the insert methods of - flat_segment_tree. + * slight performance improvement on the insert methods of + flat_segment_tree. - * slight performance improvement on the iterators of + * slight performance improvement on the iterators of flat_segment_tree. - * re-organized the structure of flat_segment_tree to split it into - multiple headers. + * re-organized the structure of flat_segment_tree to split it into + multiple headers. * properly support prefix, docdir, includedir configure options. - - * support DESTDIR environment variable for make install. + + * support DESTDIR environment variable for make install. mdds 0.4.0 @@ -68,7 +83,7 @@ mdds 0.4.0 mdds 0.3.1 - * added support for boost::unordered_map (boost) and std::hash_map + * added support for boost::unordered_map (boost) and std::hash_map (stlport) in addition to C++0x's std::unordered_map. mdds 0.3.0 @@ -79,11 +94,11 @@ mdds 0.2.1 * added example files on how to use these data structures. - * fixed a bug in segment_tree::search_result object, to make it work - with empty result set. + * fixed a bug in segment_tree::search_result object, to make it work + with empty result set. - * fixed segment_tree to make it really usable outside of unit test - code. + * fixed segment_tree to make it really usable outside of unit test + code. mdds 0.2.0 @@ -91,8 +106,8 @@ mdds 0.2.0 * lots of code cleanups. - * support for search result iterator in segment_tree and - rectangle_set, for better search performance. + * support for search result iterator in segment_tree and + rectangle_set, for better search performance. * implemented rectnagle_set. @@ -102,5 +117,5 @@ mdds 0.1.2 * implemented segment_tree. - * node_base class is now without virtual methods to avoid vtable - generation. + * node_base class is now without virtual methods to avoid vtable + generation. diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..6ed99bd --- /dev/null +++ b/autogen.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Create configure script from configure.ac. +autoconf || exit 1 + +./configure $@ \ No newline at end of file diff --git a/configure b/configure index 680db6a..090353f 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for mdds 0.5.3. +# Generated by GNU Autoconf 2.68 for mdds 0.5.4. # # Report bugs to <[email protected]>. # @@ -559,8 +559,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mdds' PACKAGE_TARNAME='mdds' -PACKAGE_VERSION='0.5.3' -PACKAGE_STRING='mdds 0.5.3' +PACKAGE_VERSION='0.5.4' +PACKAGE_STRING='mdds 0.5.4' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1160,7 +1160,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mdds 0.5.3 to adapt to many kinds of systems. +\`configure' configures mdds 0.5.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1221,7 +1221,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mdds 0.5.3:";; + short | recursive ) echo "Configuration of mdds 0.5.4:";; esac cat <<\_ACEOF @@ -1305,7 +1305,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mdds configure 0.5.3 +mdds configure 0.5.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1322,7 +1322,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mdds $as_me 0.5.3, which was +It was created by mdds $as_me 0.5.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -1671,7 +1671,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -VERSION=0.5.3 +VERSION=0.5.4 PACKAGE_TARNAME=mdds @@ -2268,7 +2268,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.5.3, which was +This file was extended by mdds $as_me 0.5.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2321,7 +2321,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.5.3 +mdds config.status 0.5.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -3437,7 +3437,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.5.3, which was +This file was extended by mdds $as_me 0.5.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3490,7 +3490,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.5.3 +mdds config.status 0.5.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -4607,7 +4607,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.5.3, which was +This file was extended by mdds $as_me 0.5.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4660,7 +4660,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.5.3 +mdds config.status 0.5.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -5778,7 +5778,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.5.3, which was +This file was extended by mdds $as_me 0.5.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5831,7 +5831,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.5.3 +mdds config.status 0.5.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..678fcc7 --- /dev/null +++ b/configure.ac @@ -0,0 +1,52 @@ +AC_INIT(mdds, 0.5.4, [email protected]) + +VERSION=AC_PACKAGE_VERSION +AC_SUBST(VERSION) + +PACKAGE_TARNAME=AC_PACKAGE_TARNAME +AC_SUBST(PACKAGE_TARNAME) + +AC_ARG_WITH(hash-container, +[ + --with-hash-container specify the type of hash containers to use in test + programs. Supported types are: boost, c++0x, or + stlport. c++0x is used if unspecified. + + With c++0x, we assume that unordered_map and + unordered_set are available under the std namespace, + whereas with boost they are assumed to be defined in + the boost namespace. When stlport is specified, we + assume that hash_map and hash_set are available + under the std namespace. + + Example: --with-hash-container=boost], +,with_hash_container=c++0x) + +AC_MSG_CHECKING([hash container type]) +AC_MSG_RESULT([$with_hash_container]) + +OBJDIR=./obj +SRCDIR=./src +INCDIR=./include +QUICKCHECKDIR=./quickcheck +AC_SUBST(OBJDIR) +AC_SUBST(SRCDIR) +AC_SUBST(INCDIR) +AC_SUBST(QUICKCHECKDIR) + +CPPFLAGS="-DDEBUG_NODE_BASE -DUNIT_TEST -Wall -Os -g -pedantic-errors" +if test $with_hash_container = stlport; then + CPPFLAGS="$CPPFLAGS -DMDDS_HASH_CONTAINER_STLPORT" +elif test $with_hash_container = boost; then + CPPFLAGS="$CPPFLAGS -DMDDS_HASH_CONTAINER_BOOST" +else + CPPFLAGS="$CPPFLAGS -std=c++0x" +fi + + +AC_SUBST(CPPFLAGS) + +AC_OUTPUT(Makefile) +AC_OUTPUT(example/Makefile) +AC_OUTPUT(misc/mdds.spec) +AC_OUTPUT(VERSION) diff --git a/include/mdds/point_quad_tree.hpp b/include/mdds/point_quad_tree.hpp index 1eb4953..aac1b02 100644 --- a/include/mdds/point_quad_tree.hpp +++ b/include/mdds/point_quad_tree.hpp @@ -225,20 +225,32 @@ public: const_iterator(const const_iterator& r) : mp_res_nodes(r.mp_res_nodes), m_cur_pos(r.m_cur_pos), + m_cur_value(r.m_cur_value), m_end_pos(r.m_end_pos) {} const_iterator& operator= (const const_iterator& r) { mp_res_nodes = r.mp_res_nodes; m_cur_pos = r.m_cur_pos; + m_cur_value = r.m_cur_value; m_end_pos = r.m_end_pos; return *this; } bool operator== (const const_iterator& r) const { - return mp_res_nodes.get() == r.mp_res_nodes.get() && - m_cur_pos == r.m_cur_pos && m_end_pos == r.m_end_pos; + if (mp_res_nodes) + { + // Non-empty result set. + return mp_res_nodes.get() == r.mp_res_nodes.get() && + m_cur_pos == r.m_cur_pos && m_end_pos == r.m_end_pos; + } + + // Empty result set. + if (r.mp_res_nodes) + return false; + + return m_end_pos == r.m_end_pos; } bool operator!= (const const_iterator& r) const diff --git a/include/mdds/segment_tree.hpp b/include/mdds/segment_tree.hpp index 8bc60ab..9ece0c5 100644 --- a/include/mdds/segment_tree.hpp +++ b/include/mdds/segment_tree.hpp @@ -156,11 +156,7 @@ public: }; #endif -#ifdef UNIT_TEST public: -#else -private: -#endif typedef ::std::vector<data_type*> data_chain_type; typedef _mdds_unordered_map_type<data_type*, ::std::pair<key_type, key_type> > segment_map_type; typedef ::std::map<data_type*, ::std::pair<key_type, key_type> > sorted_segment_map_type; @@ -234,6 +230,7 @@ private: { ::std::string operator() (const node& _self) const { +#ifdef UNIT_TEST ::std::ostringstream os; if (_self.is_leaf) { @@ -260,6 +257,9 @@ private: } os << " "; return os.str(); +#else + return ::std::string(); +#endif } }; @@ -436,9 +436,18 @@ private: bool operator== (const iterator_base& r) const { - return mp_res_chains.get() == r.mp_res_chains.get() && - m_cur_chain == r.m_cur_chain && m_cur_pos_in_chain == r.m_cur_pos_in_chain && - m_end_pos == r.m_end_pos; + if (mp_res_chains.get()) + { + // non-empty result set. + return mp_res_chains.get() == r.mp_res_chains.get() && + m_cur_chain == r.m_cur_chain && m_cur_pos_in_chain == r.m_cur_pos_in_chain && + m_end_pos == r.m_end_pos; + } + + // empty result set. + if (r.mp_res_chains.get()) + return false; + return m_end_pos == r.m_end_pos; } bool operator!= (const iterator_base& r) const { return !operator==(r); } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/mdds.git

