Skip to content

Commit

Permalink
fix: pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Jan 19, 2024
1 parent 7d9516d commit 8aee7ae
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v18
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-22.11
- run: nix build '.?submodules=1#lib'
nix_path: nixpkgs=channel:nixos-23.05
# Usually, this would be called as 'nix build ".?submodules=1#app-esp32" '
# However, Nix 2.19 has a regression with submodule path handling, hence the odd syntax
# See https://github.com/NixOS/nix/issues/9530
- run: nix build "git+file://$(pwd)?shallow=1&submodules=1#lib"
4 changes: 1 addition & 3 deletions main/io/include/TCPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ class TCPSocket : public bell::Socket {
#endif
return value;
}
bool isOpen() {
return !isClosed;
}
bool isOpen() { return !isClosed; }

void close() {
if (!isClosed) {
Expand Down
19 changes: 11 additions & 8 deletions main/platform/linux/MDNSService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <net/if.h>
#include <netdb.h>
#include <unistd.h>
#include <atomic>
#include <cstring>
#include <vector>
#include <mutex>
#include <atomic>
#include <vector>

#if __has_include("avahi-client/client.h")
#include <avahi-client/client.h>
Expand Down Expand Up @@ -44,7 +44,9 @@ class implMDNSService : public MDNSService {
static in_addr_t host;
static std::atomic<size_t> instances;

implMDNSService(struct mdns_service* service) : service(service){ instances++; };
implMDNSService(struct mdns_service* service) : service(service) {
instances++;
};
#ifndef BELL_DISABLE_AVAHI
implMDNSService(AvahiEntryGroup* avahiGroup) : avahiGroup(avahiGroup){};
#endif
Expand Down Expand Up @@ -80,10 +82,10 @@ void implMDNSService::unregisterService() {
{
mdns_service_remove(implMDNSService::mdnsServer, service);
if (!--instances && implMDNSService::mdnsServer) {
mdnsd_stop(implMDNSService::mdnsServer);
implMDNSService::mdnsServer = nullptr;
mdnsd_stop(implMDNSService::mdnsServer);
implMDNSService::mdnsServer = nullptr;
}
}
}
}

std::unique_ptr<MDNSService> MDNSService::registerService(
Expand Down Expand Up @@ -195,9 +197,10 @@ std::unique_ptr<MDNSService> MDNSService::registerService(
BELL_LOG(info, "MDNS", "using built-in mDNS for %s", serviceName.c_str());
auto service =
mdnsd_register_svc(implMDNSService::mdnsServer, serviceName.c_str(),
type.c_str(), servicePort, NULL, txt.data());
type.c_str(), servicePort, NULL, txt.data());

if (service) return std::make_unique<implMDNSService>(service);
if (service)
return std::make_unique<implMDNSService>(service);
}

BELL_LOG(error, "MDNS", "cannot start any mDNS listener for %s",
Expand Down
6 changes: 4 additions & 2 deletions main/platform/win32/MDNSService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class implMDNSService : public MDNSService {
public:
static struct mdnsd* mdnsServer;
static std::atomic<size_t> instances;
implMDNSService(struct mdns_service* service) : service(service) { instances++; };
implMDNSService(struct mdns_service* service) : service(service) {
instances++;
};
};

/**
Expand All @@ -41,7 +43,7 @@ void implMDNSService::unregisterService() {
if (!--instances && implMDNSService::mdnsServer) {
mdnsd_stop(implMDNSService::mdnsServer);
implMDNSService::mdnsServer = nullptr;
}
}
}

std::unique_ptr<MDNSService> MDNSService::registerService(
Expand Down
4 changes: 2 additions & 2 deletions main/utilities/include/BellTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class Task {
return thread != NULL;
#else
if (!pthread_create(&thread, NULL, taskEntryFunc, this)) {
pthread_detach(thread);
return true;
pthread_detach(thread);
return true;
}
return false;
#endif
Expand Down
4 changes: 1 addition & 3 deletions main/utilities/include/BellUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ struct tv {
int32_t sec;
int32_t usec;

int64_t ms() {
return (sec * (int64_t)1000) + (usec / 1000);
}
int64_t ms() { return (sec * (int64_t)1000) + (usec / 1000); }

tv operator+(const tv& other) const {
tv result(*this);
Expand Down

0 comments on commit 8aee7ae

Please sign in to comment.