From: Mikko Rasa Date: Mon, 3 Jun 2019 11:36:37 +0000 (+0300) Subject: Formatting fixes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b65e1d0856c1fb677558a941f3cd858849ee3b28;p=libs%2Fcore.git Formatting fixes --- diff --git a/examples/grep.cpp b/examples/grep.cpp index 66d70f3..ca23499 100644 --- a/examples/grep.cpp +++ b/examples/grep.cpp @@ -17,12 +17,12 @@ int main(int argc, char **argv) Regex regex(re_str); if(debug) - cout<>8)&0xFF)*94-95 + parts = line.split(None, 3) + code = eval(parts[1])-0x2020 + code2 = (code&0xFF)+((code>>8)&0xFF)*94-95 data.append((code, eval(parts[2]), code2)) -out=file(out_fn, "w") +out = file(out_fn, "w") out.write("namespace {\n\n") data.sort(lambda x,y: cmp(x[0],y[0])) out.write("const unsigned short jisx0208_to_ucs_table[94*94] =\n{\n\t") -i=0 +i = 0 for code in xrange(94*94): if code>0: out.write(", ") @@ -29,7 +29,7 @@ for code in xrange(94*94): out.write("\n\t") if isize(), ' '), (*i)->get_help()); } - + return result; } diff --git a/source/strings/lexicalcast.h b/source/strings/lexicalcast.h index 13eab45..6fe3cb3 100644 --- a/source/strings/lexicalcast.h +++ b/source/strings/lexicalcast.h @@ -118,7 +118,7 @@ typename EnableIf::value, void>::Yes operator<<(LexicalConverter &c, const T &v) { std::ostringstream ss; - ss<>(const LexicalConverter &c, T &v) { std::istringstream ss(c.get()); ss.setf(std::ios_base::fmtflags(0), std::ios_base::skipws); - ss>>v; + ss >> v; if(ss.fail() || !ss.eof()) throw lexical_error("conversion failure"); } @@ -146,7 +146,7 @@ struct LexicalCast { LexicalConverter conv(s, f); T result; - conv>>result; + conv >> result; return result; } }; @@ -157,7 +157,7 @@ struct LexicalCast static std::string cast(const F &v, const Fmt &f = Fmt()) { LexicalConverter conv(f); - conv< static std::string cast(const std::string &v, const Fmt &f = Fmt()) { LexicalConverter conv(f); - conv<