aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-17 15:57:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-17 15:57:45 +0000
commitf69b88e0b6e6d7b836cf921445f7242b52b52d8d (patch)
tree01bd8ab8c4603aed1b38c48af2e6b4e92b11a1ca
parent58121c4e81db489db745851ed03208df28e64a11 (diff)
downloadpaludis-f69b88e0b6e6d7b836cf921445f7242b52b52d8d.tar.gz
paludis-f69b88e0b6e6d7b836cf921445f7242b52b52d8d.tar.xz
Remove all uses of deque in favour of lists. Although deque is theoretically potentially faster, it's fairly broken in some standard library implementations. Fixes: Berlios#8127.
-rw-r--r--configure.ac23
-rw-r--r--ebuild/utils/unmerge.cc4
-rw-r--r--paludis/dep_list.cc3
-rw-r--r--paludis/dep_list_TEST.cc8
-rw-r--r--paludis/repositories/portage/portage_repository.cc19
5 files changed, 17 insertions, 40 deletions
diff --git a/configure.ac b/configure.ac
index d822926..9dd4ce6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,27 +117,6 @@ int main(int, char **)
])
dnl }}}
-dnl {{{ check for broken std::deque<NoDefaultConstructor>
-AC_MSG_CHECKING([for a usable std::deque<NoDefaultConstructor>])
-AC_COMPILE_IFELSE([
-#include <deque>
-struct NoDefaultConstructor
-{
- NoDefaultConstructor(int);
-};
-int main(int, char **)
-{
- std::deque<NoDefaultConstructor> d, e;
- d = e;
-}
-],
- [AC_MSG_RESULT([yes])],
- [
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([Your std::deque doesn't work])
- ])
-dnl }}}
-
dnl {{{ check for hashes
have_tr1_hashes=0
have_ext_hashes=0
@@ -342,7 +321,7 @@ AC_SUBST([HAVE_DOT])
AM_CONDITIONAL([HAVE_DOT], test "x$HAVE_DOT" = "xyes")
dnl }}}
-{{{ check for whether to build qa stuff
+dnl {{{ check for whether to build qa stuff
AC_MSG_CHECKING([whether to build QA tools])
AC_ARG_ENABLE([qa],
[ --enable-qa Build QA things (qualudis) (maybe broken)],
diff --git a/ebuild/utils/unmerge.cc b/ebuild/utils/unmerge.cc
index fe455a0..9b28cf5 100644
--- a/ebuild/utils/unmerge.cc
+++ b/ebuild/utils/unmerge.cc
@@ -36,8 +36,8 @@
#include <iostream>
#include <iterator>
#include <string>
-#include <deque>
#include <vector>
+#include <list>
#include <cstdlib>
#include <errno.h>
@@ -204,7 +204,7 @@ main(int argc, char * argv[])
if (! contents_file)
throw Failure(stringify(contents) + ": not readable");
- std::deque<std::string> lines;
+ std::list<std::string> lines;
std::string line;
while (std::getline(contents_file, line))
lines.push_back(line);
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 57528fb..e882616 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -30,7 +30,6 @@
#include <algorithm>
#include <functional>
-#include <deque>
#include <vector>
#include <set>
@@ -653,7 +652,7 @@ DepList::visit(const AnyDepAtom * const a)
}
/* try to merge each of our viable children in turn. */
- std::deque<std::string> errors;
+ std::list<std::string> errors;
for (CompositeDepAtom::Iterator i(viable_children.begin()), i_end(viable_children.end()) ;
i != i_end ; ++i)
{
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index b471b2e..cde1970 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -17,12 +17,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <deque>
#include <paludis/paludis.hh>
#include <paludis/repositories/fake/fake_repository.hh>
-#include <string>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
+#include <string>
+#include <list>
using namespace paludis;
using namespace test;
@@ -41,7 +41,7 @@ namespace test_cases
protected:
TestEnvironment env;
FakeRepository::Pointer repo;
- std::deque<std::string> expected;
+ std::list<std::string> expected;
std::string merge_target;
bool done_populate;
#endif
@@ -79,7 +79,7 @@ namespace test_cases
TEST_CHECK(true);
unsigned n(0);
- std::deque<std::string>::const_iterator exp(expected.begin());
+ std::list<std::string>::const_iterator exp(expected.begin());
DepList::Iterator got(d.begin());
while (true)
{
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index 3e02372..5057532 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -51,7 +51,6 @@
#include <functional>
#include <algorithm>
#include <vector>
-#include <deque>
#include <limits>
#include <strings.h>
@@ -74,7 +73,7 @@ namespace paludis
typedef MakeHashedMap<QualifiedPackageName, PackageDepAtom::ConstPointer>::Type VirtualsMap;
/// Map for repository masks.
- typedef MakeHashedMap<QualifiedPackageName, std::deque<PackageDepAtom::ConstPointer> >::Type RepositoryMaskMap;
+ typedef MakeHashedMap<QualifiedPackageName, std::list<PackageDepAtom::ConstPointer> >::Type RepositoryMaskMap;
/// Map for categories.
typedef MakeHashedMap<CategoryNamePart, bool>::Type CategoryMap;
@@ -360,9 +359,9 @@ namespace paludis
Context context_local("When reading make.defaults file:");
KeyValueConfigFile make_defaults_f(f / "make.defaults");
- std::deque<std::string> uses;
+ std::list<std::string> uses;
WhitespaceTokeniser::get_instance()->tokenise(make_defaults_f.get("USE"), std::back_inserter(uses));
- for (std::deque<std::string>::const_iterator u(uses.begin()), u_end(uses.end()) ;
+ for (std::list<std::string>::const_iterator u(uses.begin()), u_end(uses.end()) ;
u != u_end ; ++u)
{
if ('-' == u->at(0))
@@ -405,12 +404,12 @@ namespace paludis
for (LineConfigFile::Iterator line(package_use_mask_f.begin()), line_end(package_use_mask_f.end());
line != line_end; ++line)
{
- std::deque<std::string> tokens;
+ std::list<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(*line, std::back_inserter(tokens));
if (tokens.size() < 2)
continue;
- std::deque<std::string>::iterator t=tokens.begin(), t_end=tokens.end();
+ std::list<std::string>::iterator t=tokens.begin(), t_end=tokens.end();
PackageDepAtom::ConstPointer d(new PackageDepAtom(*t++));
QualifiedPackageName p(d->package());
@@ -448,12 +447,12 @@ namespace paludis
for (LineConfigFile::Iterator line(package_use_force_f.begin()), line_end(package_use_force_f.end());
line != line_end; ++line)
{
- std::deque<std::string> tokens;
+ std::list<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(*line, std::back_inserter(tokens));
if (tokens.size() < 2)
continue;
- std::deque<std::string>::iterator t=tokens.begin(), t_end=tokens.end();
+ std::list<std::string>::iterator t=tokens.begin(), t_end=tokens.end();
PackageDepAtom::ConstPointer d(new PackageDepAtom(*t++));
QualifiedPackageName p(d->package());
@@ -476,7 +475,7 @@ namespace paludis
for (LineConfigFile::Iterator line(virtuals_f.begin()), line_end(virtuals_f.end()) ;
line != line_end ; ++line)
{
- std::deque<std::string> tokens;
+ std::vector<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(*line, std::back_inserter(tokens));
if (tokens.size() < 2)
continue;
@@ -1035,7 +1034,7 @@ PortageRepository::do_query_repository_masks(const QualifiedPackageName & q, con
if (_imp->repo_mask.end() == r)
return false;
else
- for (IndirectIterator<std::deque<PackageDepAtom::ConstPointer>::const_iterator, const PackageDepAtom>
+ for (IndirectIterator<std::list<PackageDepAtom::ConstPointer>::const_iterator, const PackageDepAtom>
k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
if (match_package(_imp->env, *k, PackageDatabaseEntry(q, v, name())))
return true;