X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FTermlib%2FTerminfo.cc;h=44bdb6f80c1b56b5c51f06a4a9e48a0ea40bbbe3;hb=f2f5d59e83863f3b513950173baee1b6da2aee3c;hp=232a1886fdaa3cf429301efcf4c150e6c9e64c39;hpb=54b5df35c9877b91730f4e79da29f1a470b81754;p=senf.git diff --git a/Utils/Termlib/Terminfo.cc b/Utils/Termlib/Terminfo.cc index 232a188..44bdb6f 100644 --- a/Utils/Termlib/Terminfo.cc +++ b/Utils/Termlib/Terminfo.cc @@ -240,15 +240,15 @@ prefix_ std::string senf::term::Terminfo::formatString(properties::String p, std::string result; for (std::string::const_iterator i (prgstr.begin()); i != prgstr.end(); ++i) { - if (*i != '%') { - result += *i; - continue; - } - int width = 0, base = 0; - switch (*++i) { + if (*i != '%') { + result += *i; + continue; + } + int width = 0, base = 0; + switch (*++i) { case '%': result += *i; break; case 'i': ++arg1; ++arg2; break; - case 'c': result += char(stack.pop()); break; + case 'c': result += char(stack.pop()); break; case 'x': base = 16; continue; case '0': if (!base) base = 8; case '1': case '2': case '3': case '4': @@ -264,7 +264,7 @@ prefix_ std::string senf::term::Terminfo::formatString(properties::String p, continue; } case '}': stack.push(width); break; - // Binary operands are in infix (reversed) order + // Binary operands are in infix (reversed) order case '+': stack.push(stack.pop() + stack.pop()); break; case '-': stack.push(-stack.pop() + stack.pop()); break; case '*': stack.push(stack.pop() * stack.pop()); break; @@ -450,7 +450,7 @@ prefix_ void senf::term::Terminfo::load(std::istream & is) strings_.resize(offsets.size()); StringVec::iterator j (strings_.begin()); for (OffsetVec::iterator i (offsets.begin()); i != offsets.end(); ++i, ++j) - if (*i != NoValue && *i >= 0 && *i < stringPool_.size()) + if (*i != NoValue && *i >= 0 && unsigned(*i) < stringPool_.size()) *j = &(stringPool_[0]) + *i; else *j = 0;