summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-03-02 22:52:32 +0000
committerKrzysztof Kosiński <tweenk.pl@gmail.com>2010-03-02 22:52:32 +0000
commit84fc09c9c921a31ac826c53e419d4ea61584f8a9 (patch)
tree963de2de0cd357d863d3ba104167abef31683750 /src
parentWin32. Fix for Object Visible warning. (diff)
downloadinkscape-84fc09c9c921a31ac826c53e419d4ea61584f8a9.tar.gz
inkscape-84fc09c9c921a31ac826c53e419d4ea61584f8a9.zip
Use Boost unordeed containers instead of TR1 to minimize pain
when using Apple compilers. (bzr r9129)
Diffstat (limited to 'src')
-rw-r--r--src/libnrtype/FontFactory.cpp4
-rw-r--r--src/libnrtype/FontInstance.cpp4
-rw-r--r--src/ui/tool/control-point-selection.h6
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp6
-rw-r--r--src/util/hash.h41
5 files changed, 8 insertions, 53 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index 09d9e2c4f..d6fc207b0 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -26,9 +26,9 @@
/* Freetype2 */
# include <pango/pangoft2.h>
-#include <tr1/unordered_map>
+#include <boost/unordered_map.hpp>
-typedef std::tr1::unordered_map<PangoFontDescription*, font_instance*, font_descr_hash, font_descr_equal> FaceMapType;
+typedef boost::unordered_map<PangoFontDescription*, font_instance*, font_descr_hash, font_descr_equal> FaceMapType;
// need to avoid using the size field
size_t font_descr_hash::operator()( PangoFontDescription *const &x) const {
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index 628e3cba0..557e9106e 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -29,7 +29,7 @@
# include FT_TRUETYPE_TABLES_H
# include <pango/pangoft2.h>
-#include <tr1/unordered_map>
+#include <boost/unordered_map.hpp>
struct font_style_hash : public std::unary_function<font_style, size_t> {
@@ -40,7 +40,7 @@ struct font_style_equal : public std::binary_function<font_style, font_style, bo
bool operator()(font_style const &a, font_style const &b) const;
};
-typedef std::tr1::unordered_map<font_style, raster_font*, font_style_hash, font_style_equal> StyleMap;
+typedef boost::unordered_map<font_style, raster_font*, font_style_hash, font_style_equal> StyleMap;
diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h
index d982d6bec..dde9ef218 100644
--- a/src/ui/tool/control-point-selection.h
+++ b/src/ui/tool/control-point-selection.h
@@ -13,16 +13,14 @@
#define SEEN_UI_TOOL_NODE_SELECTION_H
#include <memory>
-#include <tr1/unordered_map>
-#include <tr1/unordered_set>
#include <boost/optional.hpp>
+#include <boost/unordered_set.hpp>
#include <sigc++/sigc++.h>
#include <2geom/forward.h>
#include <2geom/point.h>
#include <2geom/rect.h>
#include "display/display-forward.h"
#include "util/accumulators.h"
-#include "util/hash.h"
#include "ui/tool/commit-events.h"
#include "ui/tool/manipulator.h"
@@ -42,7 +40,7 @@ class ControlPointSelection : public Manipulator, public sigc::trackable {
public:
ControlPointSelection(SPDesktop *d, SPCanvasGroup *th_group);
~ControlPointSelection();
- typedef std::tr1::unordered_set< SelectableControlPoint * > set_type;
+ typedef boost::unordered_set< SelectableControlPoint * > set_type;
typedef set_type Set; // convenience alias
typedef set_type::iterator iterator;
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index 5d7b520c8..f5646ac36 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -8,7 +8,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <tr1/unordered_set>
+#include <boost/unordered_set.hpp>
#include <boost/shared_ptr.hpp>
#include <glib.h>
#include <glibmm/i18n.h>
@@ -25,15 +25,13 @@
#include "ui/tool/multi-path-manipulator.h"
#include "ui/tool/path-manipulator.h"
-namespace std { using namespace tr1; }
-
namespace Inkscape {
namespace UI {
namespace {
typedef std::pair<NodeList::iterator, NodeList::iterator> IterPair;
typedef std::vector<IterPair> IterPairList;
-typedef std::unordered_set<NodeList::iterator> IterSet;
+typedef boost::unordered_set<NodeList::iterator> IterSet;
typedef std::multimap<double, IterPair> DistanceMap;
typedef std::pair<double, IterPair> DistanceMapItem;
diff --git a/src/util/hash.h b/src/util/hash.h
deleted file mode 100644
index d5abeff5a..000000000
--- a/src/util/hash.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- * Hash function for various things
- */
-/* Authors:
- * Krzysztof Kosiński <tweenk.pl@gmail.com>
- *
- * Copyright (C) 2009 Authors
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#ifndef SEEN_UTIL_HASH_H
-#define SEEN_UTIL_HASH_H
-
-#include <boost/shared_ptr.hpp>
-
-namespace std {
-namespace tr1 {
-
-/** Hash function for Boost shared pointers */
-template <typename T>
-struct hash< boost::shared_ptr<T> > : public std::unary_function<boost::shared_ptr<T>, size_t> {
- size_t operator()(boost::shared_ptr<T> p) const {
- return reinterpret_cast<size_t>(p.get());
- }
-};
-
-} // namespace tr1
-} // namespace std
-
-#endif
-
-/*
- Local Variables:
- mode:c++
- c-file-style:"stroustrup"
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
- indent-tabs-mode:nil
- fill-column:99
- End:
-*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :