summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-10-18 22:53:43 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-10-18 23:26:26 +0000
commitddffc1a8ab9e3357a8e0350ff08b5ef1a9fb2651 (patch)
tree9c91b6224ee6af12f030f03635f52b654db59840
parentMerge branch 'bugfix-1789838-confirmation-needed-before-overwriting-template'... (diff)
downloadinkscape-ddffc1a8ab9e3357a8e0350ff08b5ef1a9fb2651.tar.gz
inkscape-ddffc1a8ab9e3357a8e0350ff08b5ef1a9fb2651.zip
Remove util/unordered-containers.h aliases.
-rw-r--r--src/libnrtype/FontFactory.cpp5
-rw-r--r--src/libnrtype/FontInstance.cpp1
-rw-r--r--src/ui/tool/control-point-selection.h9
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp6
-rw-r--r--src/util/CMakeLists.txt1
-rw-r--r--src/util/units.cpp5
-rw-r--r--src/util/units.h20
-rw-r--r--src/util/unordered-containers.h54
8 files changed, 31 insertions, 70 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index cfa37bb97..74b68fc3f 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -16,6 +16,8 @@
#define PANGO_ENABLE_ENGINE
#endif
+#include <unordered_map>
+
#include <glibmm/i18n.h>
#include <fontconfig/fontconfig.h>
@@ -25,13 +27,12 @@
#include <pango/pango-ot.h>
#include "io/sys.h"
-#include "util/unordered-containers.h"
#include "libnrtype/FontFactory.h"
#include "libnrtype/font-instance.h"
#include "libnrtype/OpenTypeUtil.h"
-typedef INK_UNORDERED_MAP<PangoFontDescription*, font_instance*, font_descr_hash, font_descr_equal> FaceMapType;
+typedef std::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 88339a60e..7358deac0 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -32,7 +32,6 @@
#include <2geom/path-sink.h>
#include "libnrtype/font-glyph.h"
#include "libnrtype/font-instance.h"
-#include "util/unordered-containers.h"
#ifndef USE_PANGO_WIN32
diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h
index 192e273e0..046b98649 100644
--- a/src/ui/tool/control-point-selection.h
+++ b/src/ui/tool/control-point-selection.h
@@ -14,13 +14,14 @@
#include <list>
#include <memory>
+#include <unordered_map>
+#include <unordered_set>
#include <boost/optional.hpp>
#include <cstddef>
#include <sigc++/sigc++.h>
#include <2geom/forward.h>
#include <2geom/point.h>
#include <2geom/rect.h>
-#include "util/unordered-containers.h"
#include "ui/tool/commit-events.h"
#include "ui/tool/manipulator.h"
#include "snap-candidate.h"
@@ -42,7 +43,7 @@ class ControlPointSelection : public Manipulator, public sigc::trackable {
public:
ControlPointSelection(SPDesktop *d, SPCanvasGroup *th_group);
~ControlPointSelection() override;
- typedef INK_UNORDERED_SET<SelectableControlPoint *> set_type;
+ typedef std::unordered_set<SelectableControlPoint *> set_type;
typedef set_type Set; // convenience alias
typedef set_type::iterator iterator;
@@ -144,8 +145,8 @@ private:
set_type _points;
set_type _all_points;
- INK_UNORDERED_MAP<SelectableControlPoint *, Geom::Point> _original_positions;
- INK_UNORDERED_MAP<SelectableControlPoint *, Geom::Affine> _last_trans;
+ std::unordered_map<SelectableControlPoint *, Geom::Point> _original_positions;
+ std::unordered_map<SelectableControlPoint *, Geom::Affine> _last_trans;
boost::optional<double> _rot_radius;
boost::optional<double> _mouseover_rot_radius;
Geom::OptRect _bounds;
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index dd700d9b3..a92b129e9 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -10,6 +10,8 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <unordered_set>
+
#include <gdk/gdkkeysyms.h>
#include <glibmm/i18n.h>
@@ -39,13 +41,13 @@ struct hash_nodelist_iterator
: public std::unary_function<NodeList::iterator, std::size_t>
{
std::size_t operator()(NodeList::iterator i) const {
- return INK_HASH<NodeList::iterator::pointer>()(&*i);
+ return std::hash<NodeList::iterator::pointer>()(&*i);
}
};
typedef std::pair<NodeList::iterator, NodeList::iterator> IterPair;
typedef std::vector<IterPair> IterPairList;
-typedef INK_UNORDERED_SET<NodeList::iterator, hash_nodelist_iterator> IterSet;
+typedef std::unordered_set<NodeList::iterator, hash_nodelist_iterator> IterSet;
typedef std::multimap<double, IterPair> DistanceMap;
typedef std::pair<double, IterPair> DistanceMapItem;
diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt
index b8c61e2fe..ce982eab3 100644
--- a/src/util/CMakeLists.txt
+++ b/src/util/CMakeLists.txt
@@ -35,7 +35,6 @@ set(util_SRC
tuple.h
ucompose.hpp
units.h
- unordered-containers.h
ziptool.h
)
diff --git a/src/util/units.cpp b/src/util/units.cpp
index 35493bcbc..0308623d5 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -14,6 +14,7 @@
#include <iomanip>
#include <iostream>
#include <utility>
+#include <unordered_map>
#include <glib.h>
#include <glibmm/regex.h>
#include <glibmm/fileutils.h>
@@ -81,7 +82,7 @@ unsigned const svg_length_lookup[] = {
// maps unit codes obtained from their abbreviations to their SVGLength unit indexes
-typedef INK_UNORDERED_MAP<unsigned, SVGLength::Unit> UnitCodeLookup;
+typedef std::unordered_map<unsigned, SVGLength::Unit> UnitCodeLookup;
UnitCodeLookup make_unit_code_lookup()
{
@@ -96,7 +97,7 @@ UnitCodeLookup const unit_code_lookup = make_unit_code_lookup();
-typedef INK_UNORDERED_MAP<Glib::ustring, Inkscape::Util::UnitType> TypeMap;
+typedef std::unordered_map<Glib::ustring, Inkscape::Util::UnitType> TypeMap;
/** A std::map that gives the data type value for the string version.
* @todo consider hiding map behind hasFoo() and getFoo() type functions. */
diff --git a/src/util/units.h b/src/util/units.h
index e4530d0c3..17c54eb4e 100644
--- a/src/util/units.h
+++ b/src/util/units.h
@@ -13,12 +13,24 @@
#ifndef INKSCAPE_UTIL_UNITS_H
#define INKSCAPE_UTIL_UNITS_H
-#include <map>
+#include <unordered_map>
#include <boost/operators.hpp>
#include <glibmm/ustring.h>
#include <2geom/coord.h>
#include "svg/svg-length.h"
-#include "unordered-containers.h"
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+namespace std {
+template <>
+struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size_t> {
+ std::size_t operator()(Glib::ustring const &s) const {
+ return hash<std::string>()(s.raw());
+ }
+};
+} // namespace std
+
+#endif
namespace Inkscape {
namespace Util {
@@ -137,8 +149,8 @@ public:
UnitTable();
virtual ~UnitTable();
- typedef INK_UNORDERED_MAP<Glib::ustring, Unit> UnitMap;
- typedef INK_UNORDERED_MAP<unsigned, Unit*> UnitCodeMap;
+ typedef std::unordered_map<Glib::ustring, Unit> UnitMap;
+ typedef std::unordered_map<unsigned, Unit*> UnitCodeMap;
/** Add a new unit to the table */
void addUnit(Unit const &u, bool primary);
diff --git a/src/util/unordered-containers.h b/src/util/unordered-containers.h
deleted file mode 100644
index 9d869142d..000000000
--- a/src/util/unordered-containers.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- * @brief Compatibility wrapper for unordered containers.
- */
-/* Authors:
- * Jon A. Cruz <jon@joncruz.org>
- * Krzysztof KosiƄski <tweenk.pl@gmail.com>
- *
- * Copyright (C) 2010 Authors
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#ifndef SEEN_INK_UTIL_UNORDERED_CONTAINERS_H
-#define SEEN_INK_UTIL_UNORDERED_CONTAINERS_H
-
-#include <glibmm/ustring.h>
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include <unordered_set>
-#include <unordered_map>
-#define INK_UNORDERED_SET std::unordered_set
-#define INK_UNORDERED_MAP std::unordered_map
-#define INK_HASH std::hash
-
-namespace std {
-template <>
-struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size_t> {
- std::size_t operator()(Glib::ustring const &s) const {
- return hash<std::string>()(s.raw());
- }
-};
-} // namespace std
-
-#else
-/// Name (with namespace) of the unordered set template.
-#define INK_UNORDERED_SET
-/// Name (with namespace) of the unordered map template.
-#define INK_UNORDERED_MAP
-/// Name (with namespace) of the hash template.
-#define INK_HASH
-
-#endif
-
-#endif // SEEN_SET_TYPES_H
-/*
- 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:fileencoding=utf-8:textwidth=99 :