X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Funicode.cpp;h=5ea21aad0520cf231abf81c9b7eeb64e26f8e192;hb=9a1b26a156c913f484ca2293fb2ec1c4986d2a3e;hp=2620ddb5e44e895854d239cd1748b779088a7478;hpb=7d456a93e411ad5b6185d7342e213bfe442c0252;p=lyx.git diff --git a/src/support/unicode.cpp b/src/support/unicode.cpp index 2620ddb5e4..5ea21aad05 100644 --- a/src/support/unicode.cpp +++ b/src/support/unicode.cpp @@ -19,9 +19,8 @@ #include -#include - #include +#include #include #include //Needed in MSVC @@ -52,7 +51,7 @@ namespace lyx { struct IconvProcessor::Handler { // assumes cd is valid - Handler(iconv_t const cd) : cd(cd) {} + explicit Handler(iconv_t const cd) : cd(cd) {} ~Handler() { if (iconv_close(cd) == -1) LYXERR0("Error returned from iconv_close(" << errno << ')'); @@ -66,13 +65,6 @@ IconvProcessor::IconvProcessor(string tocode, string fromcode) {} -// for gcc 4.6 -IconvProcessor::IconvProcessor(IconvProcessor && other) - : tocode_(move(other.tocode_)), fromcode_(move(other.fromcode_)), - h_(move(other.h_)) -{} - - bool IconvProcessor::init() { if (h_) @@ -115,7 +107,7 @@ int IconvProcessor::convert(char const * buf, size_t buflen, // flush out remaining data. This is needed because iconv sometimes // holds back chars in the stream, waiting for a combination character // (see e.g. http://sources.redhat.com/bugzilla/show_bug.cgi?id=1124) - iconv(h_->cd, NULL, NULL, &outbuf, &outbytesleft); + iconv(h_->cd, nullptr, nullptr, &outbuf, &outbytesleft); //lyxerr << dec; //lyxerr << "Inbytesleft: " << inbytesleft << endl; @@ -143,7 +135,7 @@ int IconvProcessor::convert(char const * buf, size_t buflen, for (size_t i = 0; i < buflen; ++i) { // char may be signed, avoid output of // something like 0xffffffc2 - boost::uint32_t const b = + uint32_t const b = *reinterpret_cast(buf + i); lyxerr << " 0x" << (unsigned int)b; } @@ -193,7 +185,7 @@ iconv_convert(IconvProcessor & processor, InType const * buf, size_t buflen) return vector(tmp, tmp + bytes / sizeof(RetType)); } -} // anon namespace +} // namespace IconvProcessor & utf8ToUcs4() @@ -264,7 +256,7 @@ IconvProcessor & getProc(map & processors, return it->second; } -} //anon namespace +} // namespace vector @@ -313,7 +305,7 @@ map & ucs4To8bitProcessors() return *processors.localData(); } -} +} // namespace vector ucs4_to_eightbit(char_type const * ucs4str, size_t ls, string const & encoding)