Silence a warning
This commit is contained in:
parent
e4368d59e4
commit
9ebb8d7df1
2 changed files with 5 additions and 5 deletions
|
@ -64,26 +64,26 @@ std::vector<Thesaurus::Entry> Thesaurus::Lookup(std::string const& word) {
|
||||||
auto buff_end = buff + len;
|
auto buff_end = buff + len;
|
||||||
|
|
||||||
std::string temp;
|
std::string temp;
|
||||||
auto read_line = [&] () -> std::string const& {
|
auto read_line = [&] (std::string& temp) -> std::string * {
|
||||||
auto start = buff;
|
auto start = buff;
|
||||||
auto end = std::find(buff, buff_end, '\n');
|
auto end = std::find(buff, buff_end, '\n');
|
||||||
buff = end < buff_end ? end + 1 : buff_end;
|
buff = end < buff_end ? end + 1 : buff_end;
|
||||||
if (end > start && end[-1] == '\r') --end;
|
if (end > start && end[-1] == '\r') --end;
|
||||||
temp.clear();
|
temp.clear();
|
||||||
conv->Convert(start, end - start, temp);
|
conv->Convert(start, end - start, temp);
|
||||||
return temp;
|
return &temp;
|
||||||
};
|
};
|
||||||
|
|
||||||
// First line is the word and meaning count
|
// First line is the word and meaning count
|
||||||
std::vector<std::string> header;
|
std::vector<std::string> header;
|
||||||
boost::split(header, read_line(), [](char c) { return c == '|'; });
|
boost::split(header, *read_line(temp), [](char c) { return c == '|'; });
|
||||||
if (header.size() != 2) return out;
|
if (header.size() != 2) return out;
|
||||||
int meanings = atoi(header[1].c_str());
|
int meanings = atoi(header[1].c_str());
|
||||||
|
|
||||||
out.reserve(meanings);
|
out.reserve(meanings);
|
||||||
for (int i = 0; i < meanings; ++i) {
|
for (int i = 0; i < meanings; ++i) {
|
||||||
std::vector<std::string> line;
|
std::vector<std::string> line;
|
||||||
boost::split(line, read_line(), [](char c) { return c == '|'; });
|
boost::split(line, *read_line(temp), [](char c) { return c == '|'; });
|
||||||
|
|
||||||
if (line.size() < 2)
|
if (line.size() < 2)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -194,8 +194,8 @@ double VideoController::GetARFromType(AspectRatio type) const {
|
||||||
case AspectRatio::Fullscreen: return 4.0/3.0;
|
case AspectRatio::Fullscreen: return 4.0/3.0;
|
||||||
case AspectRatio::Widescreen: return 16.0/9.0;
|
case AspectRatio::Widescreen: return 16.0/9.0;
|
||||||
case AspectRatio::Cinematic: return 2.35;
|
case AspectRatio::Cinematic: return 2.35;
|
||||||
|
default: throw agi::InternalError("Bad AR type");
|
||||||
}
|
}
|
||||||
throw agi::InternalError("Bad AR type");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoController::SetAspectRatio(double value) {
|
void VideoController::SetAspectRatio(double value) {
|
||||||
|
|
Loading…
Reference in a new issue