Fix compiler warnings

master
pixl 4 years ago
parent d478ef3309
commit 41049deb35
No known key found for this signature in database
GPG Key ID: 1866C148CD593B6E
  1. 1
      src/logid/Configuration.cpp
  2. 4
      src/logid/actions/Action.cpp
  3. 2
      src/logid/actions/Action.h
  4. 9
      src/logid/actions/ToggleHiresScroll.cpp
  5. 9
      src/logid/actions/ToggleHiresScroll.h
  6. 8
      src/logid/actions/ToggleSmartShift.cpp
  7. 9
      src/logid/actions/ToggleSmartShift.h
  8. 1
      src/logid/backend/hidpp20/features/ReprogControls.cpp
  9. 6
      src/logid/util/worker_thread.h

@ -70,7 +70,6 @@ Configuration::Configuration(const std::string& config_file)
try {
auto& timeout = root["io_timeout"];
if(timeout.isNumber()) {
auto t = timeout.getType();
if(timeout.getType() == Setting::TypeFloat)
_io_timeout = duration_cast<milliseconds>(
duration<double, std::milli>(timeout));

@ -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);

@ -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()

@ -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)
{
}

@ -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;
};
}}

@ -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)
{
}

@ -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;
};
}}

@ -116,6 +116,7 @@ ReprogControls::ControlInfo ReprogControls::getControlReporting(uint16_t cid)
void ReprogControls::setControlReporting(uint8_t cid, ControlInfo info)
{
// This function does not exist pre-v4 and cannot be emulated, ignore.
(void)cid; (void)info; // Suppress unused warnings
}
std::set<uint16_t> ReprogControls::divertedButtonEvent(

@ -42,13 +42,13 @@ namespace logid
workqueue* _parent;
std::size_t _worker_number;
std::unique_ptr<thread> _thread;
std::mutex _busy;
std::mutex _run_lock;
std::atomic<bool> _continue_run;
std::condition_variable _queue_cv;
std::unique_ptr<thread> _thread;
std::mutex _busy;
mutex_queue<std::shared_ptr<task>> _queue;
};
}

Loading…
Cancel
Save