[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[mdds] 28/62: Imported Upstream version 0.7.1



This is an automated email from the git hooks/post-receive script.

rene pushed a commit to branch master
in repository mdds.

commit b3838bd32d8583bc6f929b07421b663662914971
Author: Rene Engelhard <rene@debian.org>
Date:   Thu Apr 21 14:50:49 2016 +0200

    Imported Upstream version 0.7.1
---
 NEWS                                   |   8 +
 configure                              | 342 +++++++++++++++------------------
 configure.ac                           |   2 +-
 include/mdds/multi_type_vector.hpp     |   2 +
 include/mdds/multi_type_vector_def.inl | 178 +++++++++++++++--
 src/multi_type_vector_test_custom.cpp  |   8 +
 src/multi_type_vector_test_default.cpp | 127 ++++++++++++
 7 files changed, 462 insertions(+), 205 deletions(-)

diff --git a/NEWS b/NEWS
index 8278043..a0d4491 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+mdds 0.7.1
+
+* multi_type_vector
+
+  * fixed a bug in set_empty() where emptying a whole or partial block
+    would fail to merge its adjacent block(s) even when they are also
+    empty.
+
 mdds 0.7.0
 
 * multi_type_vector
diff --git a/configure b/configure
index 476f0c7..0bb3dcc 100755
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for mdds 0.6.1.
+# Generated by GNU Autoconf 2.69 for mdds 0.7.1.
 #
 # Report bugs to <kohei.yoshida@gmail.com>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,21 +237,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -330,6 +358,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -451,6 +487,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -485,16 +525,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -506,28 +546,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -559,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mdds'
 PACKAGE_TARNAME='mdds'
-PACKAGE_VERSION='0.6.1'
-PACKAGE_STRING='mdds 0.6.1'
+PACKAGE_VERSION='0.7.1'
+PACKAGE_STRING='mdds 0.7.1'
 PACKAGE_BUGREPORT='kohei.yoshida@gmail.com'
 PACKAGE_URL=''
 
@@ -1074,8 +1094,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1161,7 +1179,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.6.1 to adapt to many kinds of systems.
+\`configure' configures mdds 0.7.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1222,7 +1240,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mdds 0.6.1:";;
+     short | recursive ) echo "Configuration of mdds 0.7.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1306,10 +1324,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mdds configure 0.6.1
-generated by GNU Autoconf 2.68
+mdds configure 0.7.1
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1323,8 +1341,8 @@ 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.6.1, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by mdds $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -1672,7 +1690,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-VERSION=0.6.1
+VERSION=0.7.1
 
 
 PACKAGE_TARNAME=mdds
@@ -2157,16 +2175,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -2226,28 +2244,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -2268,8 +2274,8 @@ 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.6.1, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by mdds $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -2321,11 +2327,11 @@ _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.6.1
-configured by $0, generated by GNU Autoconf 2.68,
+mdds config.status 0.7.1
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -2402,7 +2408,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -3326,16 +3332,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -3395,28 +3401,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -3437,8 +3431,8 @@ 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.6.1, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by mdds $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -3490,11 +3484,11 @@ _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.6.1
-configured by $0, generated by GNU Autoconf 2.68,
+mdds config.status 0.7.1
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -3571,7 +3565,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -4496,16 +4490,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -4565,28 +4559,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -4607,8 +4589,8 @@ 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.6.1, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by mdds $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -4660,11 +4642,11 @@ _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.6.1
-configured by $0, generated by GNU Autoconf 2.68,
+mdds config.status 0.7.1
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -4741,7 +4723,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -5667,16 +5649,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -5736,28 +5718,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -5778,8 +5748,8 @@ 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.6.1, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by mdds $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -5831,11 +5801,11 @@ _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.6.1
-configured by $0, generated by GNU Autoconf 2.68,
+mdds config.status 0.7.1
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -5912,7 +5882,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
diff --git a/configure.ac b/configure.ac
index 973042c..0c87941 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(mdds, 0.6.1, kohei.yoshida@gmail.com)
+AC_INIT(mdds, 0.7.1, kohei.yoshida@gmail.com)
 
 VERSION=AC_PACKAGE_VERSION
 AC_SUBST(VERSION)
diff --git a/include/mdds/multi_type_vector.hpp b/include/mdds/multi_type_vector.hpp
index b8f9c93..8eb71ed 100644
--- a/include/mdds/multi_type_vector.hpp
+++ b/include/mdds/multi_type_vector.hpp
@@ -617,6 +617,8 @@ private:
 
     iterator set_empty_impl(size_type start_pos, size_type end_pos, size_type start_pos_in_block1, size_type block_index1);
 
+    iterator set_whole_block_empty(size_type block_index, size_type start_pos_in_block);
+
     iterator set_empty_in_single_block(
         size_type start_pos, size_type end_pos, size_type block_index, size_type start_pos_in_block);
 
diff --git a/include/mdds/multi_type_vector_def.inl b/include/mdds/multi_type_vector_def.inl
index 0fcfc47..32e6c99 100644
--- a/include/mdds/multi_type_vector_def.inl
+++ b/include/mdds/multi_type_vector_def.inl
@@ -2177,6 +2177,80 @@ mtv::element_t multi_type_vector<_CellBlockFunc>::get_element_type(const _T& ele
 
 template<typename _CellBlockFunc>
 typename multi_type_vector<_CellBlockFunc>::iterator
+multi_type_vector<_CellBlockFunc>::set_whole_block_empty(size_type block_index, size_type start_pos_in_block)
+{
+    block* blk = m_blocks[block_index];
+    element_block_func::delete_block(blk->mp_data);
+    blk->mp_data = NULL;
+
+    block* blk_prev = NULL;
+    if (block_index > 0)
+    {
+        // Check if the preceding block is empty.
+        blk_prev = m_blocks[block_index-1];
+        if (blk_prev->mp_data)
+            // Previous block is not empty.  Ignore it.
+            blk_prev = NULL;
+    }
+
+    block* blk_next = NULL;
+    if (block_index < m_blocks.size()-1)
+    {
+        // Check if the next block is empty.
+        blk_next = m_blocks[block_index+1];
+        if (blk_next->mp_data)
+            // Next block is not empty. Ignore it.
+            blk_next = NULL;
+    }
+
+    // Merge with adjacent block(s) if necessary.
+    if (blk_prev)
+    {
+        if (blk_next)
+        {
+            // Both preceding and next blocks are empty.
+            size_type offset = blk_prev->m_size;
+            blk_prev->m_size += blk->m_size + blk_next->m_size;
+
+            // Erase the current and next blocks.
+            delete blk;
+            delete blk_next;
+            typename blocks_type::iterator it = m_blocks.begin();
+            std::advance(it, block_index);
+            typename blocks_type::iterator it_end = it;
+            std::advance(it_end, 2);
+            m_blocks.erase(it, it_end);
+
+            return get_iterator(block_index-1, start_pos_in_block-offset);
+        }
+
+        // Only the preceding block is empty. Merge the current block with the previous.
+        size_type offset = blk_prev->m_size;
+        blk_prev->m_size += blk->m_size;
+        delete blk;
+        typename blocks_type::iterator it = m_blocks.begin();
+        std::advance(it, block_index);
+        m_blocks.erase(it);
+
+        return get_iterator(block_index-1, start_pos_in_block-offset);
+    }
+    else if (blk_next)
+    {
+        // Only the next block is empty. Merge the next block with the current.
+        blk->m_size += blk_next->m_size;
+        delete blk_next;
+        typename blocks_type::iterator it = m_blocks.begin();
+        std::advance(it, block_index+1);
+        m_blocks.erase(it);
+
+        return get_iterator(block_index, start_pos_in_block);
+    }
+
+    return get_iterator(block_index, start_pos_in_block);
+}
+
+template<typename _CellBlockFunc>
+typename multi_type_vector<_CellBlockFunc>::iterator
 multi_type_vector<_CellBlockFunc>::set_empty_in_single_block(
     size_type start_row, size_type end_row, size_type block_index, size_type start_row_in_block)
 {
@@ -2195,18 +2269,31 @@ multi_type_vector<_CellBlockFunc>::set_empty_in_single_block(
         // start row coincides with the start of a block.
 
         if (end_row == end_row_in_block)
-        {
-            // Set the whole block empty.
-            element_block_func::delete_block(blk->mp_data);
-            blk->mp_data = NULL;
-            return get_iterator(block_index, start_row_in_block);
-        }
+            return set_whole_block_empty(block_index, start_row_in_block);
 
         // Set the upper part of the block empty.
         element_block_func::overwrite_values(*blk->mp_data, 0, empty_block_size);
         element_block_func::erase(*blk->mp_data, 0, empty_block_size);
         blk->m_size -= empty_block_size;
 
+        // Check if the preceding block (if exists) is also empty.
+        block* blk_prev = NULL;
+        if (block_index > 0)
+        {
+            blk_prev = m_blocks[block_index-1];
+            if (blk_prev->mp_data)
+                // Preceding block is not empty. Ignore it.
+                blk_prev = NULL;
+        }
+
+        if (blk_prev)
+        {
+            // Extend the previous empty block.
+            size_type offset = blk_prev->m_size;
+            blk_prev->m_size += empty_block_size;
+            return get_iterator(block_index-1, start_row-offset);
+        }
+
         // Insert a new empty block before the current one.
         m_blocks.insert(m_blocks.begin()+block_index, new block(empty_block_size));
         return get_iterator(block_index, start_row_in_block);
@@ -2223,8 +2310,23 @@ multi_type_vector<_CellBlockFunc>::set_empty_in_single_block(
         element_block_func::erase(*blk->mp_data, start_pos, empty_block_size);
         blk->m_size -= empty_block_size;
 
-        // Insert a new empty block after the current one.
-        m_blocks.insert(m_blocks.begin()+block_index+1, new block(empty_block_size));
+        // Check if the following block (if exists) is also empty.
+        block* blk_next = NULL;
+        if (block_index < m_blocks.size()-1)
+        {
+            blk_next = m_blocks[block_index+1];
+            if (blk_next->mp_data)
+                // Next block is not empty.  Ignore it.
+                blk_next = NULL;
+        }
+
+        if (blk_next)
+            // Extend the next empty block to cover the new empty segment.
+            blk_next->m_size += empty_block_size;
+        else
+            // Insert a new empty block after the current one.
+            m_blocks.insert(m_blocks.begin()+block_index+1, new block(empty_block_size));
+
         return get_iterator(block_index+1, start_row);
     }
 
@@ -2277,8 +2379,31 @@ multi_type_vector<_CellBlockFunc>::set_empty_in_multi_blocks(
             if (start_row_in_block1 == start_row)
             {
                 // Empty the whole block.
-                element_block_func::delete_block(blk->mp_data);
-                blk->mp_data = NULL;
+
+                // Check if the previos block (if exists) is also empty.
+                block* blk_prev = NULL;
+                if (block_index1 > 0)
+                {
+                    blk_prev = m_blocks[block_index1-1];
+                    if (blk_prev->mp_data)
+                        // Not empty.  Ignore it.
+                        blk_prev = NULL;
+                }
+
+                if (blk_prev)
+                {
+                    // Previous block is empty.  Move the start row to the
+                    // first row of the previous block, and make the previous
+                    // block 'block 1'.
+                    start_row -= blk_prev->m_size;
+                    --block_index1;
+                }
+                else
+                {
+                    // Make block 1 empty.
+                    element_block_func::delete_block(blk->mp_data);
+                    blk->mp_data = NULL;
+                }
             }
             else
             {
@@ -2297,6 +2422,8 @@ multi_type_vector<_CellBlockFunc>::set_empty_in_multi_blocks(
         }
     }
 
+    size_type end_block_to_erase = block_index2; // End block position is non-inclusive.
+
     {
         // Empty the upper part of the last block.
         block* blk = m_blocks[block_index2];
@@ -2306,8 +2433,24 @@ multi_type_vector<_CellBlockFunc>::set_empty_in_multi_blocks(
             if (last_row_in_block == end_row)
             {
                 // Delete the whole block.
-                delete blk;
-                m_blocks.erase(m_blocks.begin()+block_index2);
+                ++end_block_to_erase;
+
+                // Check if the following block (if exists) is also empty.
+                block* blk_next = NULL;
+                if (block_index2+1 < m_blocks.size())
+                {
+                    blk_next = m_blocks[block_index2+1];
+                    if (blk_next->mp_data)
+                        // Not empty.  Ignore it.
+                        blk_next = NULL;
+                }
+
+                if (blk_next)
+                {
+                    // The following block is also empty.
+                    end_row += blk_next->m_size;
+                    ++end_block_to_erase;
+                }
             }
             else
             {
@@ -2322,21 +2465,20 @@ multi_type_vector<_CellBlockFunc>::set_empty_in_multi_blocks(
         {
             // Last block is empty.  Delete this block and adjust the end row
             // of the new empty range.
-            delete blk;
-            m_blocks.erase(m_blocks.begin()+block_index2);
+            ++end_block_to_erase;
             end_row = last_row_in_block;
         }
     }
 
-    if (block_index2 - block_index1 > 1)
+    if (end_block_to_erase - block_index1 > 1)
     {
-        // Remove all blocks in-between, from block_index1+1 to block_index2-1.
+        // Remove all blocks in-between, from block_index1+1 to end_block_to_erase-1.
 
-        for (size_type i = block_index1 + 1; i < block_index2; ++i)
+        for (size_type i = block_index1 + 1; i < end_block_to_erase; ++i)
             delete m_blocks[i];
 
         typename blocks_type::iterator it = m_blocks.begin() + block_index1 + 1;
-        typename blocks_type::iterator it_end = m_blocks.begin() + block_index2;
+        typename blocks_type::iterator it_end = m_blocks.begin() + end_block_to_erase;
         m_blocks.erase(it, it_end);
     }
 
diff --git a/src/multi_type_vector_test_custom.cpp b/src/multi_type_vector_test_custom.cpp
index dd0bb18..a0b877d 100644
--- a/src/multi_type_vector_test_custom.cpp
+++ b/src/multi_type_vector_test_custom.cpp
@@ -1040,6 +1040,14 @@ void mtv_test_managed_block()
         assert(db.is_empty(1));
         assert(db.get<muser_cell*>(2)->value == 3.0);
     }
+
+    {
+        mtv_type db(3);
+        db.set(1, new muser_cell(3.3));
+        assert(db.block_size() == 3);
+        db.set_empty(1, 1);
+        assert(db.block_size() == 1);
+    }
 }
 
 }
diff --git a/src/multi_type_vector_test_default.cpp b/src/multi_type_vector_test_default.cpp
index 3b75694..1a18dcc 100644
--- a/src/multi_type_vector_test_default.cpp
+++ b/src/multi_type_vector_test_default.cpp
@@ -1056,6 +1056,81 @@ void mtv_test_empty_cells()
         assert(db.get<bool>(2) == true);
         assert(db.block_size() == 3);
     }
+
+    {
+        mtv_type db(10);
+        assert(db.block_size() == 1);
+
+        unsigned short val = 12;
+        db.set(3, val);
+        assert(db.block_size() == 3);
+        assert(db.is_empty(2));
+        assert(!db.is_empty(3));
+        assert(db.is_empty(4));
+
+        db.set_empty(3, 3); // This should merge the top, middle and bottom blocks into one.
+        assert(db.block_size() == 1);
+
+        db.set(9, val);
+        assert(db.block_size() == 2);
+        db.set_empty(9, 9); // Merge the block with the top one.
+        assert(db.block_size() == 1);
+
+        db = mtv_type(10, true);
+        db.set(3, 1.1);
+        db.set(4, 1.2);
+        db.set(5, 1.3);
+        assert(db.block_size() == 3);
+        db.set_empty(3, 5); // No merging.
+        assert(db.block_size() == 3);
+    }
+
+    {
+        mtv_type db(10);
+        db.set(0, 1.1);
+        assert(db.block_size() == 2);
+        db.set(1, 1.2);
+        assert(db.block_size() == 2);
+        db.set_empty(1, 1); // Merge with the next block.
+        assert(db.block_size() == 2);
+        db.set(1, 1.3);
+
+        db = mtv_type(5);
+        db.set(3, 2.1);
+        db.set(4, 2.2);
+        assert(db.block_size() == 2);
+        db.set_empty(3, 3); // Merge with the previous block.
+        assert(db.block_size() == 2);
+    }
+
+    {
+        mtv_type db(7);
+        db.set(0, 1.2);
+        db.set(2, true);
+        db.set(4, true);
+        db.set(5, static_cast<int>(22));
+        db.set(6, string("foo"));
+        assert(db.block_size() == 7);
+        db.set_empty(2, 4); // Merge with the previous block.
+        assert(db.block_size() == 4);
+        assert(db.get<double>(0) == 1.2);
+        assert(db.is_empty(1));
+        assert(db.is_empty(2));
+        assert(db.is_empty(3));
+        assert(db.is_empty(4));
+        assert(db.get<int>(5) == 22);
+        assert(db.get<string>(6) == "foo");
+    }
+
+    {
+        mtv_type db(4);
+        db.set(0, true);
+        db.set(2, true);
+        assert(db.block_size() == 4);
+        db.set_empty(0, 2); // Merge with the next block.
+        cout << "block size: " << db.block_size() << endl;
+        assert(db.block_size() == 1);
+    }
 }
 
 void mtv_test_swap()
@@ -3593,6 +3668,58 @@ void mtv_test_set_empty_return_iterator()
     assert(it->size == 2);
     ++it;
     assert(it == db.end());
+
+    db = mtv_type(10);
+    db.set(0, true);
+    db.set(5, 1.1);
+    it = db.set_empty(5, 5); // Merge with previous and next blocks.
+    check = db.begin();
+    ++check;
+    assert(it == check);
+    assert(it->size == 9);
+    assert(it->type == mtv::element_type_empty);
+    assert(it->__private_data.start_pos == 1);
+    assert(it->__private_data.block_index == 1);
+    ++it;
+    assert(it == db.end());
+
+    doubles.resize(3, 32.3);
+    db.set(4, doubles.begin(), doubles.end()); // 4 thru 6
+    assert(db.block_size() == 4);
+    it = db.set_empty(4, 5); // Merge with the previous block.
+    check = db.begin();
+    ++check;
+    assert(it == check);
+    assert(it->size == 5);
+    assert(it->type == mtv::element_type_empty);
+    assert(it->__private_data.start_pos == 1);
+    assert(it->__private_data.block_index == 1);
+    ++it;
+    assert(it->size == 1);
+    assert(it->type == mtv::element_type_numeric);
+    ++it;
+    assert(it->size == 3);
+    assert(it->type == mtv::element_type_empty);
+    ++it;
+    assert(it == db.end());
+
+    db = mtv_type(10);
+    db.set(9, false);
+    db.set(3, 1.1);
+    db.set(4, 1.2);
+    db.set(5, 1.3);
+    assert(db.block_size() == 4);
+    it = db.set_empty(5, 5); // Merge with the next empty block.
+    assert(db.block_size() == 4);
+    check = db.begin();
+    advance(check, 2);
+    assert(it == check);
+    assert(it->size == 4);
+    assert(it->type == mtv::element_type_empty);
+    assert(it->__private_data.block_index == 2);
+    assert(it->__private_data.start_pos == 5);
+    advance(it, 2);
+    assert(it == db.end());
 }
 
 void mtv_test_insert_empty_return_iterator()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/mdds.git


Reply to: