diff options
author | Ilya Zverev <zverik@textual.ru> | 2015-09-25 15:15:25 +0300 |
---|---|---|
committer | Ilya Zverev <zverik@textual.ru> | 2015-09-25 15:15:25 +0300 |
commit | 16a02768e6d3119d8b8cce73e589336b870cfc28 (patch) | |
tree | 113182654018fe35485e7e4ae68cbe47af1a2fb8 /generator | |
parent | 809c16303781e049deb4e6f01f941be52fb19ec0 (diff) |
[generator] Static string constants
Diffstat (limited to 'generator')
-rw-r--r-- | generator/osm2meta.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generator/osm2meta.hpp b/generator/osm2meta.hpp index 946d75590a..a40456a442 100644 --- a/generator/osm2meta.hpp +++ b/generator/osm2meta.hpp @@ -206,7 +206,7 @@ protected: else if (c == ' ') escaped << '_'; else - escaped << '%' << std::uppercase << setw(2) << int((unsigned char) c); + escaped << '%' << std::uppercase << setw(2) << static_cast<int>(static_cast<unsigned char>(c)); } return escaped.str(); @@ -223,13 +223,13 @@ protected: if (i <= 3 || v.substr(0, i) == "be-x-old") return v.substr(0, i + 1) + url_encode(v.substr(i + 1)); - string::size_type const minUrlPartLength = string("//be.wikipedia.org/wiki/AB").length(); + static string::size_type const minUrlPartLength = string("//be.wikipedia.org/wiki/AB").length(); if (v[i+1] == '/' && i + minUrlPartLength < v.length()) { // Convert URL to "lang:title" i += 3; string::size_type const j = v.find('.', i + 1); - string const wikiUrlPart = ".wikipedia.org/wiki/"; + static string const wikiUrlPart = ".wikipedia.org/wiki/"; if (j != string::npos && v.substr(j, wikiUrlPart.length()) == wikiUrlPart) return v.substr(i, j - i) + ":" + v.substr(j + wikiUrlPart.length()); } |