Formatted the entire codebase and added a CI check for formatting

This commit is contained in:
AlexandreRouma
2021-12-19 22:11:44 +01:00
parent 8644957881
commit ea587db0cb
161 changed files with 3302 additions and 3393 deletions

View File

@ -13,7 +13,7 @@
#define CONCAT(a, b) ((std::string(a) + b).c_str())
SDRPP_MOD_INFO {
SDRPP_MOD_INFO{
/* Name: */ "rfspace_source",
/* Description: */ "RFspace source module for SDR++",
/* Author: */ "Ryzerth",
@ -88,7 +88,7 @@ private:
gui::mainWindow.playButtonLocked = false;
spdlog::info("SpyServerSourceModule '{0}': Menu Deselect!", _this->name);
}
static void start(void* ctx) {
SpyServerSourceModule* _this = (SpyServerSourceModule*)ctx;
if (_this->running) { return; }
@ -98,17 +98,17 @@ private:
_this->running = true;
spdlog::info("SpyServerSourceModule '{0}': Start!", _this->name);
}
static void stop(void* ctx) {
SpyServerSourceModule* _this = (SpyServerSourceModule*)ctx;
if (!_this->running) { return; }
// TODO: Stop
_this->running = false;
spdlog::info("SpyServerSourceModule '{0}': Stop!", _this->name);
}
static void tune(double freq, void* ctx) {
SpyServerSourceModule* _this = (SpyServerSourceModule*)ctx;
if (_this->running) {
@ -117,7 +117,7 @@ private:
_this->freq = freq;
spdlog::info("SpyServerSourceModule '{0}': Tune: {1}!", _this->name, freq);
}
static void menuHandler(void* ctx) {
SpyServerSourceModule* _this = (SpyServerSourceModule*)ctx;
float menuWidth = ImGui::GetContentRegionAvailWidth();
@ -154,7 +154,6 @@ private:
}
if (_this->running) { style::endDisabled(); }
if (connected) {
// TODO: Options here

View File

@ -24,7 +24,7 @@ namespace rfspace {
udpClient->readAsync(sizeof(udpHeader), (uint8_t*)&udpHeader, udpHandler, this);
// Start SDR
uint8_t args[4] = {0x70, 2, 0, 0};
uint8_t args[4] = { 0x70, 2, 0, 0 };
setControlItem(0x18, args, 4);
}

View File

@ -4,7 +4,7 @@
#include <dsp/types.h>
#include <atomic>
#define RFSPACE_MAX_SIZE 8192
#define RFSPACE_MAX_SIZE 8192
namespace rfspace {
enum {
@ -40,7 +40,7 @@ namespace rfspace {
// Wait for data
std::unique_lock<std::mutex> lck(mtx);
return cnd.wait_for(lck, std::chrono::milliseconds(timeoutMS), [this](){ return triggered; });
return cnd.wait_for(lck, std::chrono::milliseconds(timeoutMS), [this]() { return triggered; });
// Mark as not waiting
{
@ -75,7 +75,7 @@ namespace rfspace {
// Wait for waiter to handle
{
std::unique_lock<std::mutex> lck(mtx);
cnd.wait(lck, [this](){ return !triggered; });
cnd.wait(lck, [this]() { return !triggered; });
}
}
@ -86,7 +86,6 @@ namespace rfspace {
bool waiting;
std::mutex waitingmtx;
};
class RFspaceClientClass {
@ -122,9 +121,9 @@ namespace rfspace {
SyncEvent SCIRRecv;
int SCIRSize;
};
typedef std::unique_ptr<RFspaceClientClass> RFspaceClient;
RFspaceClient connect(std::string host, uint16_t port, dsp::stream<dsp::complex_t>* out);
}