Fix C++20 compilation on systems where char_type is wchar_t

This commit is contained in:
Yuriy Skalko 2020-12-29 16:54:37 +02:00
parent 950eaae5e6
commit cafa1d4ae4
4 changed files with 5 additions and 5 deletions

View File

@ -1771,7 +1771,7 @@ Buffer::ExportStatus Buffer::makeLaTeXFile(FileName const & fname,
catch (EncodingException const & e) {
docstring const failed(1, e.failed_char);
ostringstream oss;
oss << "0x" << hex << e.failed_char << dec;
oss << "0x" << hex << static_cast<uint32_t>(e.failed_char) << dec;
if (getParFromID(e.par_id).paragraph().layout().pass_thru) {
docstring msg = bformat(_("Uncodable character '%1$s'"
" (code point %2$s)"),

View File

@ -866,7 +866,7 @@ int LyXComm::startPipe(string const & file, bool write)
if (!write) {
// Make sure not to call read_ready after destruction.
weak_ptr<void> tracker = tracker_.p();
theApp()->registerSocketCallback(fd, [=](){
theApp()->registerSocketCallback(fd, [this, tracker](){
if (!tracker.expired())
read_ready();
});

View File

@ -370,9 +370,9 @@ ostream & operator<<(ostream & os, Token const & t)
os << '\\' << to_utf8(cs);
}
else if (t.cat() == catLetter)
os << t.character();
os << static_cast<uint32_t>(t.character());
else
os << '[' << t.character() << ',' << t.cat() << ']';
os << '[' << static_cast<uint32_t>(t.character()) << ',' << t.cat() << ']';
return os;
}

View File

@ -854,7 +854,7 @@ void Parser::tokenize_one()
}
case catIgnore: {
cerr << "ignoring a char: " << c << "\n";
cerr << "ignoring a char: " << static_cast<uint32_t>(c) << "\n";
break;
}