Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Fix platform dependent number type unsigned long -> uint64_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheem Mamoowala committed Sep 20, 2017
1 parent 2fcbd78 commit 2d84e2a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/mbgl/storage/offline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class OfflineTilePyramidRegionDefinition {

/* Private */
std::vector<CanonicalTileID> tileCover(SourceType, uint16_t tileSize, const Range<uint8_t>& zoomRange) const;
unsigned long tileCount(SourceType, uint16_t tileSize, const Range<uint8_t>& zoomRange) const;
uint64_t tileCount(SourceType, uint16_t tileSize, const Range<uint8_t>& zoomRange) const;
const std::string styleURL;
const LatLngBounds bounds;
const double minZoom;
Expand Down
2 changes: 1 addition & 1 deletion platform/default/mbgl/storage/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::vector<CanonicalTileID> OfflineTilePyramidRegionDefinition::tileCover(Sourc
return result;
}

unsigned long OfflineTilePyramidRegionDefinition::tileCount(SourceType type, uint16_t tileSize, const Range<uint8_t>& zoomRange) const {
uint64_t OfflineTilePyramidRegionDefinition::tileCount(SourceType type, uint16_t tileSize, const Range<uint8_t>& zoomRange) const {

const Range<uint8_t> clampedZoomRange = coveringZoomRange(type, tileSize, zoomRange);
unsigned long result = 0;;
Expand Down
4 changes: 2 additions & 2 deletions src/mbgl/util/tile_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ std::vector<UnwrappedTileID> tileCover(const TransformState& state, int32_t z) {
}

// Taken from https://github.com/mapbox/sphericalmercator#xyzbbox-zoom-tms_style-srs
// Computes the projected tiles for the lower left and uppoer right points of the bounds
// Computes the projected tiles for the lower left and upper right points of the bounds
// and uses that to compute the tile cover count
unsigned long tileCount(const LatLngBounds& bounds, uint8_t zoom, uint16_t tileSize_){
uint64_t tileCount(const LatLngBounds& bounds, uint8_t zoom, uint16_t tileSize_){

auto sw = Projection::project(bounds.southwest().wrapped(), zoom, tileSize_);
auto ne = Projection::project(bounds.northeast().wrapped(), zoom, tileSize_);
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/util/tile_cover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::vector<UnwrappedTileID> tileCover(const TransformState&, int32_t z);
std::vector<UnwrappedTileID> tileCover(const LatLngBounds&, int32_t z);

// Compute only the count of tiles needed for tileCover
unsigned long tileCount(const LatLngBounds&, uint8_t z, uint16_t tileSize);
uint64_t tileCount(const LatLngBounds&, uint8_t z, uint16_t tileSize);

} // namespace util
} // namespace mbgl

0 comments on commit 2d84e2a

Please sign in to comment.