smell: avoid uncasting with left-shift

This commit is contained in:
Scott Giese
2020-11-23 16:17:28 -06:00
parent 7673da3832
commit 59809ab61f

View File

@@ -179,7 +179,7 @@ public:
* @return tile index
*/
inline long int gen_index() const {
return ((lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x;
return ((lon + 180) << 14) + ((lat + 90) << 6) + static_cast<unsigned char>(y << 3) + x;
}
/**
@@ -200,6 +200,7 @@ public:
* @return base path in string form
*/
std::string gen_vpb_base() const;
std::string gen_vpb_base_alt() const;
/**
* @return the center lon of a tile.