]> git.tdb.fi Git - libs/core.git/blobdiff - source/windows1252.cpp
Further style and comment adjustments
[libs/core.git] / source / windows1252.cpp
index d809c3ff9bad7616a0e053f600edd72f2a207866..bbd67536348894552e9163a9aaae664878cdd60e 100644 (file)
@@ -21,19 +21,20 @@ unsigned short table[32]=
 
 }
 
+
 namespace Msp {
 namespace Codecs {
 
 void Windows1252::Encoder::encode_char(UnicodeChar ch, string &buf)
 {
        if((ch>=0 && ch<=0x7F) || (ch>=0xA0 && ch<=0xFF))
-               buf+=ch;
+               buf += ch;
        else
        {
                for(unsigned i=0; i<32; ++i)
                        if(table[i]==ch)
                        {
-                               buf+=ch;
+                               buf += ch;
                                return;
                        }
 
@@ -43,7 +44,7 @@ void Windows1252::Encoder::encode_char(UnicodeChar ch, string &buf)
 
 void Windows1252::Encoder::transliterate(UnicodeChar, string &buf)
 {
-       buf+='?';
+       buf += '?';
 }
 
 
@@ -52,16 +53,16 @@ UnicodeChar Windows1252::Decoder::decode_char(const string &str, string::const_i
        if(i==str.end())
                return error("No input");
 
-       int ch=static_cast<unsigned char>(*i);
+       int ch = static_cast<unsigned char>(*i);
        UnicodeChar result;
        if(ch>=0x80 && ch<=0x9F)
        {
-               result=table[ch-0x80];
+               result = table[ch-0x80];
                if(result==0)
-                       result=error("Undefined Windows-1252 character");
+                       result = error("Undefined Windows-1252 character");
        }
        else
-               result=ch;
+               result = ch;
 
        ++i;
        return result;