]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/jisx0208.cpp
Use C++11 features with containers
[libs/core.git] / source / stringcodec / jisx0208.cpp
index d56ec33d22a2da43bc6ff8b8bc1d6af30e549706..c09782481537acd4a12a9cb342ce0997dfd20d1d 100644 (file)
@@ -12,7 +12,9 @@ void JisX0208::Encoder::encode_char(unichar ucs, string &buf)
        unsigned short jis = ucs_to_jisx0208(ucs);
        if(jis)
        {
-               char jbuf[2] = {jis>>8, jis};
+               char jbuf[2];
+               jbuf[0] = jis>>8;
+               jbuf[1] = jis;
                buf.append(jbuf, 2);
        }
        else
@@ -30,7 +32,7 @@ unichar JisX0208::Decoder::decode_char(const string &str, string::const_iterator
        if(i==str.end())
                return -1;
 
-       string::const_iterator j = i;
+       auto j = i;
        Kuten jis;
        jis.ku = *j++-0x20;