Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 887037
Collapse All | Expand All

(-)file_not_specified_in_diff (-49 / +49 lines)
Line  Link Here
0
-- a/src/third_party/s2/base/stl_decl_msvc.h
0
++ b/src/third_party/s2/base/stl_decl_msvc.h
Lines 118-125 namespace msvchash { Link Here
118
  class hash_multimap;
118
  class hash_multimap;
119
}  // end namespace  msvchash
119
}  // end namespace  msvchash
120
120
121
using msvchash::hash_set;
121
using msvchash::hash_set = my_hash_set;
122
using msvchash::hash_map;
122
using msvchash::hash_map = my_hash_map;
123
using msvchash::hash;
123
using msvchash::hash;
124
using msvchash::hash_multimap;
124
using msvchash::hash_multimap;
125
using msvchash::hash_multiset;
125
using msvchash::hash_multiset;
126
-- a/src/third_party/s2/base/stl_decl_osx.h
126
++ b/src/third_party/s2/base/stl_decl_osx.h
Lines 68-75 using std::string; Link Here
68
68
69
using namespace std;
69
using namespace std;
70
using __gnu_cxx::hash;
70
using __gnu_cxx::hash;
71
using __gnu_cxx::hash_set;
71
using __gnu_cxx::hash_set = my_hash_set;
72
using __gnu_cxx::hash_map;
72
using __gnu_cxx::hash_map = my_hash_map;
73
using __gnu_cxx::select1st;
73
using __gnu_cxx::select1st;
74
74
75
/* On Linux (and gdrive on OSX), this comes from places like
75
/* On Linux (and gdrive on OSX), this comes from places like
76
-- a/src/third_party/s2/hash.h
76
++ b/src/third_party/s2/hash.h
Lines 2-11 Link Here
2
#define THIRD_PARTY_S2_HASH_H_
2
#define THIRD_PARTY_S2_HASH_H_
3
3
4
#include <unordered_map>
4
#include <unordered_map>
5
#define hash_map std::unordered_map
5
#define my_hash_map std::unordered_map
6
6
7
#include <unordered_set>
7
#include <unordered_set>
8
#define hash_set std::unordered_set
8
#define my_hash_set std::unordered_set
9
9
10
#define HASH_NAMESPACE_START namespace std {
10
#define HASH_NAMESPACE_START namespace std {
11
#define HASH_NAMESPACE_END }
11
#define HASH_NAMESPACE_END }
12
-- a/src/third_party/s2/s2_test.cc
12
++ b/src/third_party/s2/s2_test.cc
Lines 10-16 using std::reverse; Link Here
10
10
11
#include <hash_set>
11
#include <hash_set>
12
#include <hash_map>
12
#include <hash_map>
13
using __gnu_cxx::hash_set;
13
using __gnu_cxx::hash_set = my_hash_map;
14
14
15
#include "s2.h"
15
#include "s2.h"
16
#include "base/logging.h"
16
#include "base/logging.h"
Lines 709-716 TEST(S2, Frames) { Link Here
709
#if 0
709
#if 0
710
TEST(S2, S2PointHashSpreads) {
710
TEST(S2, S2PointHashSpreads) {
711
  int kTestPoints = 1 << 16;
711
  int kTestPoints = 1 << 16;
712
  hash_set<size_t> set;
712
  my_hash_set<size_t> set;
713
  hash_set<S2Point> points;
713
  my_hash_set<S2Point> points;
714
  hash<S2Point> hasher;
714
  hash<S2Point> hasher;
715
  S2Point base = S2Point(1, 1, 1);
715
  S2Point base = S2Point(1, 1, 1);
716
  for (int i = 0; i < kTestPoints; ++i) {
716
  for (int i = 0; i < kTestPoints; ++i) {
Lines 733-739 TEST(S2, S2PointHashCollapsesZero) { Link Here
733
  double minus_zero = -zero;
733
  double minus_zero = -zero;
734
  EXPECT_NE(*reinterpret_cast<uint64 const*>(&zero),
734
  EXPECT_NE(*reinterpret_cast<uint64 const*>(&zero),
735
            *reinterpret_cast<uint64 const*>(&minus_zero));
735
            *reinterpret_cast<uint64 const*>(&minus_zero));
736
  hash_map<S2Point, int> map;
736
  my_hash_map<S2Point, int> map;
737
  S2Point zero_pt(zero, zero, zero);
737
  S2Point zero_pt(zero, zero, zero);
738
  S2Point minus_zero_pt(minus_zero, minus_zero, minus_zero);
738
  S2Point minus_zero_pt(minus_zero, minus_zero, minus_zero);
739
739
740
-- a/src/third_party/s2/s2cellid_test.cc
740
++ b/src/third_party/s2/s2cellid_test.cc
Lines 10-16 using std::reverse; Link Here
10
10
11
#include <cstdio>
11
#include <cstdio>
12
#include <hash_map>
12
#include <hash_map>
13
using __gnu_cxx::hash_map;
13
using __gnu_cxx::hash_map = my_hash_map;
14
14
15
#include <sstream>
15
#include <sstream>
16
#include <vector>
16
#include <vector>
Lines 170-176 TEST(S2CellId, Tokens) { Link Here
170
static const int kMaxExpandLevel = 3;
170
static const int kMaxExpandLevel = 3;
171
171
172
static void ExpandCell(S2CellId const& parent, vector<S2CellId>* cells,
172
static void ExpandCell(S2CellId const& parent, vector<S2CellId>* cells,
173
                       hash_map<S2CellId, S2CellId>* parent_map) {
173
                       my_hash_map<S2CellId, S2CellId>* parent_map) {
174
  cells->push_back(parent);
174
  cells->push_back(parent);
175
  if (parent.level() == kMaxExpandLevel) return;
175
  if (parent.level() == kMaxExpandLevel) return;
176
  int i, j, orientation;
176
  int i, j, orientation;
Lines 194-200 static void ExpandCell(S2CellId const& parent, vector<S2CellId>* cells, Link Here
194
194
195
TEST(S2CellId, Containment) {
195
TEST(S2CellId, Containment) {
196
  // Test contains() and intersects().
196
  // Test contains() and intersects().
197
  hash_map<S2CellId, S2CellId> parent_map;
197
  my_hash_map<S2CellId, S2CellId> parent_map;
198
  vector<S2CellId> cells;
198
  vector<S2CellId> cells;
199
  for (int face = 0; face < 6; ++face) {
199
  for (int face = 0; face < 6; ++face) {
200
    ExpandCell(S2CellId::FromFacePosLevel(face, 0, 0), &cells, &parent_map);
200
    ExpandCell(S2CellId::FromFacePosLevel(face, 0, 0), &cells, &parent_map);
201
-- a/src/third_party/s2/s2loop.cc
201
++ b/src/third_party/s2/s2loop.cc
Lines 120-126 bool S2Loop::IsValid(string* err) const { Link Here
120
    }
120
    }
121
  }
121
  }
122
  // Loops are not allowed to have any duplicate vertices.
122
  // Loops are not allowed to have any duplicate vertices.
123
  hash_map<S2Point, int> vmap;
123
  my_hash_map<S2Point, int> vmap;
124
  for (int i = 0; i < num_vertices(); ++i) {
124
  for (int i = 0; i < num_vertices(); ++i) {
125
    if (!vmap.insert(make_pair(vertex(i), i)).second) {
125
    if (!vmap.insert(make_pair(vertex(i), i)).second) {
126
      VLOG(2) << "Duplicate vertices: " << vmap[vertex(i)] << " and " << i;
126
      VLOG(2) << "Duplicate vertices: " << vmap[vertex(i)] << " and " << i;
127
-- a/src/third_party/s2/s2polygon.cc
127
++ b/src/third_party/s2/s2polygon.cc
Lines 117-123 HASH_NAMESPACE_END Link Here
117
bool S2Polygon::IsValid(const vector<S2Loop*>& loops, string* err) {
117
bool S2Polygon::IsValid(const vector<S2Loop*>& loops, string* err) {
118
  // If a loop contains an edge AB, then no other loop may contain AB or BA.
118
  // If a loop contains an edge AB, then no other loop may contain AB or BA.
119
  if (loops.size() > 1) {
119
  if (loops.size() > 1) {
120
    hash_map<S2PointPair, pair<int, int> > edges;
120
    my_hash_map<S2PointPair, pair<int, int> > edges;
121
    for (size_t i = 0; i < loops.size(); ++i) {
121
    for (size_t i = 0; i < loops.size(); ++i) {
122
      S2Loop* lp = loops[i];
122
      S2Loop* lp = loops[i];
123
      for (int j = 0; j < lp->num_vertices(); ++j) {
123
      for (int j = 0; j < lp->num_vertices(); ++j) {
124
-- a/src/third_party/s2/s2polygonbuilder.cc
124
++ b/src/third_party/s2/s2polygonbuilder.cc
Lines 175-181 S2Loop* S2PolygonBuilder::AssembleLoop(S2Point const& v0, S2Point const& v1, Link Here
175
  // This ensures that only CCW loops are constructed when possible.
175
  // This ensures that only CCW loops are constructed when possible.
176
176
177
  vector<S2Point> path;          // The path so far.
177
  vector<S2Point> path;          // The path so far.
178
  hash_map<S2Point, int> index;  // Maps a vertex to its index in "path".
178
  my_hash_map<S2Point, int> index;  // Maps a vertex to its index in "path".
179
  path.push_back(v0);
179
  path.push_back(v0);
180
  path.push_back(v1);
180
  path.push_back(v1);
181
  index[v1] = 1;
181
  index[v1] = 1;
Lines 361-367 void S2PolygonBuilder::BuildMergeMap(PointIndex* index, MergeMap* merge_map) { Link Here
361
361
362
  // First, we build the set of all the distinct vertices in the input.
362
  // First, we build the set of all the distinct vertices in the input.
363
  // We need to include the source and destination of every edge.
363
  // We need to include the source and destination of every edge.
364
  hash_set<S2Point> vertices;
364
  my_hash_set<S2Point> vertices;
365
  for (EdgeSet::const_iterator i = edges_->begin(); i != edges_->end(); ++i) {
365
  for (EdgeSet::const_iterator i = edges_->begin(); i != edges_->end(); ++i) {
366
    vertices.insert(i->first);
366
    vertices.insert(i->first);
367
    VertexSet const& vset = i->second;
367
    VertexSet const& vset = i->second;
Lines 370-376 void S2PolygonBuilder::BuildMergeMap(PointIndex* index, MergeMap* merge_map) { Link Here
370
  }
370
  }
371
371
372
  // Build a spatial index containing all the distinct vertices.
372
  // Build a spatial index containing all the distinct vertices.
373
  for (hash_set<S2Point>::const_iterator i = vertices.begin();
373
  for (my_hash_set<S2Point>::const_iterator i = vertices.begin();
374
       i != vertices.end(); ++i) {
374
       i != vertices.end(); ++i) {
375
    index->Insert(*i);
375
    index->Insert(*i);
376
  }
376
  }
Lines 378-384 void S2PolygonBuilder::BuildMergeMap(PointIndex* index, MergeMap* merge_map) { Link Here
378
  // Next, we loop through all the vertices and attempt to grow a maximial
378
  // Next, we loop through all the vertices and attempt to grow a maximial
379
  // mergeable group starting from each vertex.
379
  // mergeable group starting from each vertex.
380
  vector<S2Point> frontier, mergeable;
380
  vector<S2Point> frontier, mergeable;
381
  for (hash_set<S2Point>::const_iterator vstart = vertices.begin();
381
  for (my_hash_set<S2Point>::const_iterator vstart = vertices.begin();
382
       vstart != vertices.end(); ++vstart) {
382
       vstart != vertices.end(); ++vstart) {
383
    // Skip any vertices that have already been merged with another vertex.
383
    // Skip any vertices that have already been merged with another vertex.
384
    if (merge_map->find(*vstart) != merge_map->end()) continue;
384
    if (merge_map->find(*vstart) != merge_map->end()) continue;
385
-- a/src/third_party/s2/s2polygonbuilder.h
385
++ b/src/third_party/s2/s2polygonbuilder.h
Lines 262-268 class S2PolygonBuilder { Link Here
262
  // current position to a new position, and also returns a spatial index
262
  // current position to a new position, and also returns a spatial index
263
  // containing all of the vertices that do not need to be moved.
263
  // containing all of the vertices that do not need to be moved.
264
  class PointIndex;
264
  class PointIndex;
265
  typedef hash_map<S2Point, S2Point> MergeMap;
265
  typedef my_hash_map<S2Point, S2Point> MergeMap;
266
  void BuildMergeMap(PointIndex* index, MergeMap* merge_map);
266
  void BuildMergeMap(PointIndex* index, MergeMap* merge_map);
267
267
268
  // Moves a set of vertices from old to new positions.
268
  // Moves a set of vertices from old to new positions.
Lines 282-288 class S2PolygonBuilder { Link Here
282
  // once.  We could have also used a multiset<pair<S2Point, S2Point> >,
282
  // once.  We could have also used a multiset<pair<S2Point, S2Point> >,
283
  // but this representation is a bit more convenient.
283
  // but this representation is a bit more convenient.
284
  typedef multiset<S2Point> VertexSet;
284
  typedef multiset<S2Point> VertexSet;
285
  typedef hash_map<S2Point, VertexSet> EdgeSet;
285
  typedef my_hash_map<S2Point, VertexSet> EdgeSet;
286
  scoped_ptr<EdgeSet> edges_;
286
  scoped_ptr<EdgeSet> edges_;
287
287
288
  // Unique collection of the starting (first) vertex of all edges,
288
  // Unique collection of the starting (first) vertex of all edges,
289
-- a/src/third_party/s2/s2regioncoverer.cc
289
++ b/src/third_party/s2/s2regioncoverer.cc
Lines 321-327 void S2RegionCoverer::GetInteriorCellUnion(S2Region const& region, Link Here
321
321
322
void S2RegionCoverer::FloodFill(
322
void S2RegionCoverer::FloodFill(
323
    S2Region const& region, S2CellId const& start, vector<S2CellId>* output) {
323
    S2Region const& region, S2CellId const& start, vector<S2CellId>* output) {
324
  hash_set<S2CellId> all;
324
  my_hash_set<S2CellId> all;
325
  vector<S2CellId> frontier;
325
  vector<S2CellId> frontier;
326
  output->clear();
326
  output->clear();
327
  all.insert(start);
327
  all.insert(start);
328
-- a/src/third_party/s2/s2regioncoverer_test.cc
328
++ b/src/third_party/s2/s2regioncoverer_test.cc
Lines 11-17 using std::swap; Link Here
11
using std::reverse;
11
using std::reverse;
12
12
13
#include <hash_map>
13
#include <hash_map>
14
using __gnu_cxx::hash_map;
14
using __gnu_cxx::hash_map = my_hash_map;
15
15
16
#include <queue>
16
#include <queue>
17
using std::priority_queue;
17
using std::priority_queue;
Lines 65-71 static void CheckCovering(S2RegionCoverer const& coverer, Link Here
65
                          vector<S2CellId> const& covering,
65
                          vector<S2CellId> const& covering,
66
                          bool interior) {
66
                          bool interior) {
67
  // Keep track of how many cells have the same coverer.min_level() ancestor.
67
  // Keep track of how many cells have the same coverer.min_level() ancestor.
68
  hash_map<S2CellId, int> min_level_cells;
68
  my_hash_map<S2CellId, int> min_level_cells;
69
  for (int i = 0; i < covering.size(); ++i) {
69
  for (int i = 0; i < covering.size(); ++i) {
70
    int level = covering[i].level();
70
    int level = covering[i].level();
71
    EXPECT_GE(level, coverer.min_level());
71
    EXPECT_GE(level, coverer.min_level());
Lines 76-82 static void CheckCovering(S2RegionCoverer const& coverer, Link Here
76
  if (covering.size() > coverer.max_cells()) {
76
  if (covering.size() > coverer.max_cells()) {
77
    // If the covering has more than the requested number of cells, then check
77
    // If the covering has more than the requested number of cells, then check
78
    // that the cell count cannot be reduced by using the parent of some cell.
78
    // that the cell count cannot be reduced by using the parent of some cell.
79
    for (hash_map<S2CellId, int>::const_iterator i = min_level_cells.begin();
79
    for (my_hash_map<S2CellId, int>::const_iterator i = min_level_cells.begin();
80
         i != min_level_cells.end(); ++i) {
80
         i != min_level_cells.end(); ++i) {
81
      EXPECT_EQ(i->second, 1);
81
      EXPECT_EQ(i->second, 1);
82
    }
82
    }
83
-- a/src/third_party/s2/strings/split.cc
83
++ b/src/third_party/s2/strings/split.cc
Lines 156-162 struct simple_insert_iterator { Link Here
156
// SplitStringToIterator{Using|AllowEmpty}().
156
// SplitStringToIterator{Using|AllowEmpty}().
157
template <typename T>
157
template <typename T>
158
struct simple_hash_map_iterator {
158
struct simple_hash_map_iterator {
159
  typedef hash_map<T, T> hashmap;
159
  typedef my_hash_map<T, T> hashmap;
160
  hashmap* t;
160
  hashmap* t;
161
  bool even;
161
  bool even;
162
  typename hashmap::iterator curr;
162
  typename hashmap::iterator curr;
Lines 246-253 void SplitStringAllowEmpty(const string& full, const char* delim, Link Here
246
}
246
}
247
247
248
void SplitStringToHashsetAllowEmpty(const string& full, const char* delim,
248
void SplitStringToHashsetAllowEmpty(const string& full, const char* delim,
249
                                    hash_set<string>* result) {
249
                                    my_hash_set<string>* result) {
250
  simple_insert_iterator<hash_set<string> > it(result);
250
  simple_insert_iterator<my_hash_set<string> > it(result);
251
  SplitStringToIteratorAllowEmpty(full, delim, 0, it);
251
  SplitStringToIteratorAllowEmpty(full, delim, 0, it);
252
}
252
}
253
253
Lines 258-264 void SplitStringToSetAllowEmpty(const string& full, const char* delim, Link Here
258
}
258
}
259
259
260
void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
260
void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
261
                                    hash_map<string, string>* result) {
261
                                    my_hash_map<string, string>* result) {
262
  simple_hash_map_iterator<string> it(result);
262
  simple_hash_map_iterator<string> it(result);
263
  SplitStringToIteratorAllowEmpty(full, delim, 0, it);
263
  SplitStringToIteratorAllowEmpty(full, delim, 0, it);
264
}
264
}
Lines 352-359 void SplitStringUsing(const string& full, Link Here
352
}
352
}
353
353
354
void SplitStringToHashsetUsing(const string& full, const char* delim,
354
void SplitStringToHashsetUsing(const string& full, const char* delim,
355
                               hash_set<string>* result) {
355
                               my_hash_set<string>* result) {
356
  simple_insert_iterator<hash_set<string> > it(result);
356
  simple_insert_iterator<my_hash_set<string> > it(result);
357
  SplitStringToIteratorUsing(full, delim, it);
357
  SplitStringToIteratorUsing(full, delim, it);
358
}
358
}
359
359
Lines 364-370 void SplitStringToSetUsing(const string& full, const char* delim, Link Here
364
}
364
}
365
365
366
void SplitStringToHashmapUsing(const string& full, const char* delim,
366
void SplitStringToHashmapUsing(const string& full, const char* delim,
367
                               hash_map<string, string>* result) {
367
                               my_hash_map<string, string>* result) {
368
  simple_hash_map_iterator<string> it(result);
368
  simple_hash_map_iterator<string> it(result);
369
  SplitStringToIteratorUsing(full, delim, it);
369
  SplitStringToIteratorUsing(full, delim, it);
370
}
370
}
371
-- a/src/third_party/s2/strings/split.h
371
++ b/src/third_party/s2/strings/split.h
Lines 41-47 using namespace std; Link Here
41
void SplitStringAllowEmpty(const string& full, const char* delim,
41
void SplitStringAllowEmpty(const string& full, const char* delim,
42
                           vector<string>* res);
42
                           vector<string>* res);
43
void SplitStringToHashsetAllowEmpty(const string& full, const char* delim,
43
void SplitStringToHashsetAllowEmpty(const string& full, const char* delim,
44
                                    hash_set<string>* res);
44
                                    my_hash_set<string>* res);
45
void SplitStringToSetAllowEmpty(const string& full, const char* delim,
45
void SplitStringToSetAllowEmpty(const string& full, const char* delim,
46
                                set<string>* res);
46
                                set<string>* res);
47
// The even-positioned (0-based) components become the keys for the
47
// The even-positioned (0-based) components become the keys for the
Lines 50-56 void SplitStringToSetAllowEmpty(const string& full, const char* delim, Link Here
50
// if the key was already present in the hash table, or will be the
50
// if the key was already present in the hash table, or will be the
51
// empty string if the key is a newly inserted key.
51
// empty string if the key is a newly inserted key.
52
void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
52
void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
53
                                    hash_map<string, string>* result);
53
                                    my_hash_map<string, string>* result);
54
54
55
// ----------------------------------------------------------------------
55
// ----------------------------------------------------------------------
56
// SplitStringUsing()
56
// SplitStringUsing()
Lines 66-72 void SplitStringToHashmapAllowEmpty(const string& full, const char* delim, Link Here
66
void SplitStringUsing(const string& full, const char* delim,
66
void SplitStringUsing(const string& full, const char* delim,
67
                      vector<string>* res);
67
                      vector<string>* res);
68
void SplitStringToHashsetUsing(const string& full, const char* delim,
68
void SplitStringToHashsetUsing(const string& full, const char* delim,
69
                               hash_set<string>* res);
69
                               my_hash_set<string>* res);
70
void SplitStringToSetUsing(const string& full, const char* delim,
70
void SplitStringToSetUsing(const string& full, const char* delim,
71
                           set<string>* res);
71
                           set<string>* res);
72
// The even-positioned (0-based) components become the keys for the
72
// The even-positioned (0-based) components become the keys for the
Lines 75-81 void SplitStringToSetUsing(const string& full, const char* delim, Link Here
75
// if the key was already present in the hash table, or will be the
75
// if the key was already present in the hash table, or will be the
76
// empty string if the key is a newly inserted key.
76
// empty string if the key is a newly inserted key.
77
void SplitStringToHashmapUsing(const string& full, const char* delim,
77
void SplitStringToHashmapUsing(const string& full, const char* delim,
78
                               hash_map<string, string>* result);
78
                               my_hash_map<string, string>* result);
79
79
80
// ----------------------------------------------------------------------
80
// ----------------------------------------------------------------------
81
// SplitOneIntToken()
81
// SplitOneIntToken()

Return to bug 887037