]> git.tdb.fi Git - libs/core.git/blobdiff - source/iso646fi.cpp
Further style and comment adjustments
[libs/core.git] / source / iso646fi.cpp
index 779eadf0d887fa89b30b60b8e33a3669d31cf821..100ce1313f699a441e13b0f88795ef3e192b5dbf 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 
 namespace {
 
-const unsigned map_size=9;
+const unsigned map_size = 9;
 
 const int mapping[map_size*2]=
 {
@@ -27,23 +27,24 @@ const int mapping[map_size*2]=
        0xFC, 0x7E
 };
 
-} // namespace
+}
+
 
 namespace Msp {
 namespace Codecs {
 
 void Iso646Fi::Encoder::encode_char(UnicodeChar ch, string &buf)
 {
-       int tch=transform_mapping_or_direct(mapping, map_size, ch, false);
+       int tch = transform_mapping_or_direct(mapping, map_size, ch, false);
        if(tch<0 || tch>0x7F)
                error(ch, buf, "Can't express character in ISO-646-FI");
        else
-               buf+=tch;
+               buf += tch;
 }
 
 void Iso646Fi::Encoder::transliterate(UnicodeChar, string &buf)
 {
-       buf+='?';
+       buf += '?';
 }
 
 
@@ -52,14 +53,14 @@ UnicodeChar Iso646Fi::Decoder::decode_char(const string &str, string::const_iter
        if(i==str.end())
                return error("No input");
 
-       unsigned char ch=*i;
-       int tch=(ch<=0x7F ? transform_mapping_or_direct(mapping, map_size, ch, true) : -1);
+       unsigned char ch = *i;
+       int tch = (ch<=0x7F ? transform_mapping_or_direct(mapping, map_size, ch, true) : -1);
 
        UnicodeChar result;
        if(tch==-1)
-               result=error("Undefined ISO-646-FI character");
+               result = error("Undefined ISO-646-FI character");
        else
-               result=tch;
+               result = tch;
 
        ++i;
        return result;