change unsigned long to size_type

This commit is contained in:
andyque 2014-07-29 16:17:10 +08:00
parent 7abea5dc58
commit e7da7b3e42
2 changed files with 4 additions and 4 deletions

View File

@ -109,13 +109,13 @@ Widget* Helper::seekActionWidgetByActionTag(Widget* root, int tag)
return nullptr;
}
std::string Helper::utf8_substr(const std::string& str, unsigned long start, unsigned long length)
std::string Helper::utf8_substr(const std::string& str, std::string::size_type start, std::string::size_type length)
{
if (length==0)
{
return "";
}
unsigned long c, i, ix, q, min=std::string::npos, max=std::string::npos;
std::string::size_type c, i, ix, q, min=std::string::npos, max=std::string::npos;
for (q=0, i=0, ix=str.length(); i < ix; i++, q++)
{
if (q==start)

View File

@ -75,8 +75,8 @@ public:
* @return a utf8 substring
*/
static std::string utf8_substr(const std::string& str,
unsigned long start,
unsigned long length);
std::string::size_type start,
std::string::size_type length);
};
}