refactor: lint

This commit is contained in:
Alex
2022-04-06 08:37:19 +02:00
parent 168ba2ca5b
commit f2fcadbf62
99 changed files with 3173 additions and 3512 deletions

View File

@ -4,9 +4,11 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <cstring>
#include <memory>
#include <mutex>
#include "ipc.hpp"
#include "util/sleeper_thread.hpp"
@ -18,8 +20,8 @@ class Ipc {
~Ipc();
struct ipc_response {
uint32_t size;
uint32_t type;
uint32_t size;
uint32_t type;
std::string payload;
};
@ -33,16 +35,16 @@ class Ipc {
protected:
static inline const std::string ipc_magic_ = "i3-ipc";
static inline const size_t ipc_header_size_ = ipc_magic_.size() + 8;
static inline const size_t ipc_header_size_ = ipc_magic_.size() + 8;
const std::string getSocketPath() const;
int open(const std::string &) const;
const std::string getSocketPath() const;
int open(const std::string &) const;
struct ipc_response send(int fd, uint32_t type, const std::string &payload = "");
struct ipc_response recv(int fd);
int fd_;
int fd_event_;
std::mutex mutex_;
int fd_;
int fd_event_;
std::mutex mutex_;
util::SleeperThread thread_;
};

View File

@ -30,7 +30,7 @@ enum ipc_command_type {
IPC_EVENT_SHUTDOWN = ((1 << 31) | 6),
IPC_EVENT_TICK = ((1 << 31) | 7),
// sway-specific event types
IPC_EVENT_BAR_STATE_UPDATE = ((1<<31) | 20),
IPC_EVENT_INPUT = ((1<<31) | 21),
// sway-specific event types
IPC_EVENT_BAR_STATE_UPDATE = ((1 << 31) | 20),
IPC_EVENT_INPUT = ((1 << 31) | 21),
};