Merge pull request #625 from gocha/vs2019fix

Fix Visual Studio 2019 (C3848 error in conffile.cpp)
This commit is contained in:
OV2 2020-01-21 21:21:02 +01:00 committed by GitHub
commit 0a8972524d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -452,7 +452,7 @@ void ConfigFile::ClearLines()
}
}
bool ConfigFile::ConfigEntry::section_then_key_less::operator()(const ConfigEntry &a, const ConfigEntry &b) {
bool ConfigFile::ConfigEntry::section_then_key_less::operator()(const ConfigEntry &a, const ConfigEntry &b) const{
if(curConfigFile && a.section!=b.section){
const int sva = curConfigFile->GetSectionSize(a.section);
const int svb = curConfigFile->GetSectionSize(b.section);

View File

@ -90,7 +90,7 @@ class ConfigFile {
mutable bool used;
struct section_then_key_less {
bool operator()(const ConfigEntry &a, const ConfigEntry &b);
bool operator()(const ConfigEntry &a, const ConfigEntry &b) const;
};
struct key_less {
@ -101,8 +101,8 @@ class ConfigFile {
};
struct line_less {
bool operator()(const ConfigEntry &a, const ConfigEntry &b){
if(a.line==b.line) return (b.val.empty() && !a.val.empty()) || a.key<b.key;
bool operator()(const ConfigEntry &a, const ConfigEntry &b) const{
if(a.line==b.line) return (b.val.empty() && !a.val.empty()) || a.key<b.key;
if(b.line<0) return true;
if(a.line<0) return false;
return a.line<b.line;