[core] Fix -Wshadow when using GCC 4.9

This commit is contained in:
Thiago Marcos P. Santos
2019-12-12 16:44:41 +02:00
parent 79768743d8
commit 3bbea2e30c
2 changed files with 7 additions and 7 deletions

View File

@@ -63,12 +63,12 @@ class Collection<T, false /*persistentImplsOrder*/> : public CollectionBase<T> {
public:
T* add(std::unique_ptr<T> wrapper, const optional<std::string>& before = nullopt) {
std::size_t index = before ? Base::index(*before) : Base::size();
return Base::add(index, index, std::move(wrapper));
std::size_t idx = before ? Base::index(*before) : Base::size();
return Base::add(idx, idx, std::move(wrapper));
}
std::unique_ptr<T> remove(const std::string& id) {
std::size_t index = Base::index(id);
return Base::remove(index, index);
std::size_t idx = Base::index(id);
return Base::remove(idx, idx);
}
void update(const T& wrapper) { Base::update(Base::index(wrapper.getID()), wrapper); }
};

View File

@@ -78,16 +78,16 @@ void GeoJSONSource::loadDescription(FileSource& fileSource) {
} else {
auto makeImplInBackground = [currentImpl = baseImpl, data = res.data]() -> Immutable<Source::Impl> {
assert(data);
auto& impl = static_cast<const Impl&>(*currentImpl);
auto& current = static_cast<const Impl&>(*currentImpl);
conversion::Error error;
std::shared_ptr<GeoJSONData> geoJSONData;
if (optional<GeoJSON> geoJSON = conversion::convertJSON<GeoJSON>(*data, error)) {
geoJSONData = GeoJSONData::create(*geoJSON, impl.getOptions());
geoJSONData = GeoJSONData::create(*geoJSON, current.getOptions());
} else {
// Create an empty GeoJSON VT object to make sure we're not infinitely waiting for tiles to load.
Log::Error(Event::ParseStyle, "Failed to parse GeoJSON data: %s", error.message.c_str());
}
return makeMutable<Impl>(impl, std::move(geoJSONData));
return makeMutable<Impl>(current, std::move(geoJSONData));
};
auto onImplReady = [this, self = makeWeakPtr(), capturedReq = req.get()](Immutable<Source::Impl> newImpl) {
assert(capturedReq);