Fix compiler warnings

This commit is contained in:
pixl
2020-07-10 04:20:15 -04:00
parent d478ef3309
commit 41049deb35
9 changed files with 12 additions and 37 deletions

View File

@@ -50,9 +50,9 @@ std::shared_ptr<Action> Action::makeAction(Device *device, libconfig::Setting
if(type == "keypress")
return std::make_shared<KeypressAction>(device, setting);
else if(type == "togglesmartshift")
return std::make_shared<ToggleSmartShift>(device, setting);
return std::make_shared<ToggleSmartShift>(device);
else if(type == "togglehiresscroll")
return std::make_shared<ToggleHiresScroll>(device, setting);
return std::make_shared<ToggleHiresScroll>(device);
else
throw InvalidAction(type);

View File

@@ -52,6 +52,8 @@ namespace actions {
virtual void release() = 0;
virtual void move(int16_t x, int16_t y)
{
// Suppress unused warning
(void)x; (void)y;
}
virtual bool pressed()

View File

@@ -17,15 +17,13 @@
*/
#include "ToggleHiresScroll.h"
#include "../Device.h"
#include "../util/log.h"
#include "../util/task.h"
#include "../backend/hidpp20/features/ReprogControls.h"
using namespace logid::actions;
using namespace logid::backend;
ToggleHiresScroll::ToggleHiresScroll(Device *dev, libconfig::Setting &config) :
Action (dev), _config (dev, config)
ToggleHiresScroll::ToggleHiresScroll(Device *dev) : Action (dev)
{
_hires_scroll = _device->getFeature<features::HiresScroll>("hiresscroll");
if(!_hires_scroll)
@@ -56,9 +54,4 @@ void ToggleHiresScroll::release()
uint8_t ToggleHiresScroll::reprogFlags() const
{
return hidpp20::ReprogControls::TemporaryDiverted;
}
ToggleHiresScroll::Config::Config(Device *device, libconfig::Setting &root) :
Action::Config(device)
{
}

View File

@@ -27,20 +27,13 @@ namespace actions
class ToggleHiresScroll : public Action
{
public:
ToggleHiresScroll(Device* dev, libconfig::Setting& config);
explicit ToggleHiresScroll(Device* dev);
virtual void press();
virtual void release();
virtual uint8_t reprogFlags() const;
class Config : public Action::Config
{
public:
explicit Config(Device* device, libconfig::Setting& root);
};
protected:
Config _config;
std::shared_ptr<features::HiresScroll> _hires_scroll;
};
}}

View File

@@ -23,8 +23,7 @@
using namespace logid::actions;
using namespace logid::backend;
ToggleSmartShift::ToggleSmartShift(Device *dev, libconfig::Setting &config) :
Action (dev), _config (dev, config)
ToggleSmartShift::ToggleSmartShift(Device *dev) : Action (dev)
{
_smartshift = _device->getFeature<features::SmartShift>("smartshift");
if(!_smartshift)
@@ -56,9 +55,4 @@ void ToggleSmartShift::release()
uint8_t ToggleSmartShift::reprogFlags() const
{
return hidpp20::ReprogControls::TemporaryDiverted;
}
ToggleSmartShift::Config::Config(Device *device, libconfig::Setting &root) :
Action::Config(device)
{
}

View File

@@ -27,20 +27,13 @@ namespace actions {
class ToggleSmartShift : public Action
{
public:
ToggleSmartShift(Device* dev, libconfig::Setting& config);
explicit ToggleSmartShift(Device* dev);
virtual void press();
virtual void release();
virtual uint8_t reprogFlags() const;
class Config : public Action::Config
{
public:
explicit Config(Device* device, libconfig::Setting& root);
};
protected:
Config _config;
std::shared_ptr<features::SmartShift> _smartshift;
};
}}