Enable compatibility with older versions of libconfig (such as the one shipped with RHEL/CentOS 7)

This commit is contained in:
Kevin Abraham
2020-11-22 12:12:29 -05:00
parent 4c582241d5
commit 28a93b2df4
13 changed files with 44 additions and 44 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ ChangeDPI::Config::Config(Device *device, libconfig::Setting &config) :
}
try {
auto& inc = config.lookup("inc");
auto& inc = config["inc"];
if(inc.getType() != libconfig::Setting::TypeInt)
logPrintf(WARN, "Line %d: inc must be an integer",
inc.getSourceLine());
@@ -88,7 +88,7 @@ ChangeDPI::Config::Config(Device *device, libconfig::Setting &config) :
}
try {
auto& sensor = config.lookup("sensor");
auto& sensor = config["sensor"];
if(sensor.getType() != libconfig::Setting::TypeInt)
logPrintf(WARN, "Line %d: sensor must be an integer",
sensor.getSourceLine());
@@ -106,4 +106,4 @@ uint16_t ChangeDPI::Config::interval() const
uint8_t ChangeDPI::Config::sensor() const
{
return _sensor;
}
}