Skip to content

Commit

Permalink
deal with -Wunqualified-std-casts-call
Browse files Browse the repository at this point in the history
Signed-off-by: Wolfgang Bumiller <[email protected]>
  • Loading branch information
Blub committed Apr 22, 2023
1 parent efde253 commit 82459fb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
16 changes: 8 additions & 8 deletions src/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ finishClientRemoval(int fd) {
static void
queueCommand(int clientfd, string line)
{
gCommandQueue.emplace_back(Command{clientfd, move(line)});
gCommandQueue.emplace_back(Command{clientfd, std::move(line)});
}


Expand Down Expand Up @@ -281,7 +281,7 @@ newCommandClient(Socket& server)
[fd]() { disconnectClient(fd); },
[fd]() { finishClientRemoval(fd); },
};
gCommandClients.emplace(fd, move(bufhandle));
gCommandClients.emplace(fd, std::move(bufhandle));
}

#pragma clang diagnostic push
Expand Down Expand Up @@ -522,7 +522,7 @@ addDevice(const string& name, const char *path)
},
[=]() { finishDeviceRemoval(weakdevptr); },
};
gInputs.emplace(name, move(input));
gInputs.emplace(name, std::move(input));
} catch (const std::exception&) {
freeInputID(id);
throw;
Expand Down Expand Up @@ -575,7 +575,7 @@ addOutput_Finish(const string& name, IOHandle handle, bool skip_announce)
writeHello(fd);
if (!skip_announce)
announceAllDevices(fd);
gOutputs.emplace(name, move(handle));
gOutputs.emplace(name, std::move(handle));
gFDCBs.emplace(fd, FDCallbacks {
[fd]() {
::fprintf(stderr, "onRead on output");
Expand Down Expand Up @@ -665,7 +665,7 @@ addOutput(const string& name, const char *path, bool skip_announce)
else
handle = addOutput_Open(path);

return addOutput_Finish(name, move(handle), skip_announce);
return addOutput_Finish(name, std::move(handle), skip_announce);
}

static void
Expand Down Expand Up @@ -727,7 +727,7 @@ addHotkey(uint16_t device, uint16_t type, uint16_t code, int32_t value,
throw MsgException("unknown event type: %u", type);


gHotkeys[HotkeyDef{device, type, code, value}] = move(command);
gHotkeys[HotkeyDef{device, type, code, value}] = std::move(command);
}

static void
Expand Down Expand Up @@ -1081,7 +1081,7 @@ clientCommand_Action(int clientfd, const vector<string>& args)
else
toClient(clientfd, "added on-'%s' command\n",
action.c_str());
gEventCommands[action] = move(cmdstring);
gEventCommands[action] = std::move(cmdstring);
}
else
throw MsgException("'action': unknown subcommand: %s",
Expand Down Expand Up @@ -1209,7 +1209,7 @@ parseClientCommand(int clientfd, const char *cmd, size_t length)
}
} while (*cmd && !isWhite(*cmd) && (escape || *cmd != ';'));
arg.append(beg, cmd);
args.emplace_back(move(arg));
args.emplace_back(std::move(arg));
escape = false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,15 @@ cmd_create(int argc, char **argv)
if (optDuplicates == DuplicateMode::Replace) {
auto dev =
OutDevice::newFromNE2AddCommand(infd, pkt);
devices[pkt.add_device.id] = move(dev);
devices[pkt.add_device.id] = std::move(dev);
break;
}

auto old = devices.find(pkt.add_device.id);
if (old == devices.end()) {
auto dev =
OutDevice::newFromNE2AddCommand(infd, pkt);
devices[pkt.add_device.id] = move(dev);
devices[pkt.add_device.id] = std::move(dev);
break;
}

Expand Down
2 changes: 0 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include <memory>
#include <functional>

using std::move;

#include "config.h"
#include "types.h"
#include "iohandle.h"
Expand Down
4 changes: 2 additions & 2 deletions src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ InDevice::InDevice(InDevice&& o)
, eof_(o.eof_)
, grabbing_(o.grabbing_)
, user_dev_(o.user_dev_)
, name_(move(o.name_))
, evbits_(move(o.evbits_))
, name_(std::move(o.name_))
, evbits_(std::move(o.evbits_))
{
o.fd_ = -1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

struct ScopeGuard {
ScopeGuard() = delete;
ScopeGuard(ScopeGuard&& o) : f_(move(o.f_)) {}
ScopeGuard(ScopeGuard&& o) : f_(std::move(o.f_)) {}
ScopeGuard(const ScopeGuard&) = delete;
ScopeGuard(std::function<void()> f) : f_(f) {}
~ScopeGuard() { f_(); }
Expand All @@ -19,7 +19,7 @@ struct ScopeGuard {
struct ScopeGuardHelper { // actually gets rid of an unused-variable warning
constexpr ScopeGuardHelper() {}
ScopeGuard operator+(std::function<void()> f) {
return {move(f)};
return {std::move(f)};
}
};
#define NE2_CPP_CAT_INDIR(X,Y) X ## Y
Expand Down
4 changes: 2 additions & 2 deletions src/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ OutDevice::newFromNeteventStream(int fd)
}
// remember the absolute bits:
if (type.code == EV_ABS)
absbits = move(entrybits);
absbits = std::move(entrybits);
}

// netevent 1 dumps the key state, LED state and SW state at this point
Expand Down Expand Up @@ -361,7 +361,7 @@ OutDevice::newFromNE2AddCommand(int fd, NE2Packet& pkt, bool skip)
}

if (ev.index() == EV_ABS)
absbits = move(entrybits);
absbits = std::move(entrybits);
}

struct {
Expand Down

0 comments on commit 82459fb

Please sign in to comment.