Commit e4543dee authored by Ocean Wang's avatar Ocean Wang
Browse files

[trac838] Add more comments to skipSpaces() function and fix style problems.

parent c4412dfa
......@@ -174,11 +174,15 @@ public:
return (*this);
}
void skipSpaces() {
// If *base_ < 0, on Windows platform with Visual Studio compiler
// it may trigger _ASSERTE((unsigned)(c + 1) <= 256);
// so make sure that the parameter of isspace() is larger than 0
while (base_ != base_end_ && ((*base_) >= 0) && isspace(*base_))
{
// If (char is signed and) *base_ < 0, on Windows platform with Visual
// Studio compiler it may trigger _ASSERTE((unsigned)(c + 1) <= 256);
// so make sure that the parameter of isspace() is larger than 0.
// We don't simply cast it to unsigned char to avoid confusing the
// isspace() implementation with a possible extension for values
// larger than 127. Also note the check is not ">= 0"; for systems
// where char is unsigned that would always be true and would possibly
// trigger a compiler warning that could stop the build.
while (base_ != base_end_ && *base_ > 0 && isspace(*base_)) {
++base_;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment