Skip to content

Commit

Permalink
Run formatter and remove some unneeded includes
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Nov 27, 2024
1 parent f87fa59 commit abfaa76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 3 additions & 1 deletion include/reactor-uc/macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef REACTOR_UC_MACROS_H
#define REACTOR_UC_MACROS_H

#define LF_STRINGIFY(x) #x

// Sets an output port, copies data and triggers all downstream reactions.
#define lf_set(port, val) \
do { \
Expand Down Expand Up @@ -187,7 +189,7 @@
(void)_bundle_idx;

#define REACTOR_CTOR(ReactorName) \
Reactor_ctor(&self->super, __STRING(ReactorName), env, parent, self->_children, \
Reactor_ctor(&self->super, LF_STRINGIFY(ReactorName), env, parent, self->_children, \
sizeof(self->_children) / sizeof(self->_children[0]), self->_reactions, \
sizeof(self->_reactions) / sizeof(self->_reactions[0]), self->_triggers, \
sizeof(self->_triggers) / sizeof(self->_triggers[0]));
Expand Down
2 changes: 0 additions & 2 deletions include/reactor-uc/network_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#define REACTOR_UC_NETWORK_CHANNEL_H

#include <nanopb/pb.h>
#include <pthread.h>
#include <sys/select.h>

#include "proto/message.pb.h"
#include "reactor-uc/tag.h"
Expand Down
12 changes: 3 additions & 9 deletions src/platform/riot/coap_udp_ip_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ static lf_ret_t CoapUdpIpChannel_open_connection(NetworkChannel *untyped_self) {
// Do nothing

mutex_lock(&self->state_mutex);
{
_update_state(self, NETWORK_CHANNEL_STATE_OPEN);
}
{ _update_state(self, NETWORK_CHANNEL_STATE_OPEN); }
mutex_unlock(&self->state_mutex);

return LF_OK;
Expand Down Expand Up @@ -280,9 +278,7 @@ static void CoapUdpIpChannel_close_connection(NetworkChannel *untyped_self) {

// Immediately close the channel
mutex_lock(&self->state_mutex);
{
_update_state(self, NETWORK_CHANNEL_STATE_CLOSED);
}
{ _update_state(self, NETWORK_CHANNEL_STATE_CLOSED); }
mutex_unlock(&self->state_mutex);

// Inform the other federate that the channel is closed
Expand Down Expand Up @@ -337,9 +333,7 @@ static NetworkChannelState CoapUdpIpChannel_get_connection_state(NetworkChannel
NetworkChannelState state;

mutex_lock(&self->state_mutex);
{
state = self->state;
}
{ state = self->state; }
mutex_unlock(&self->state_mutex);

return state;
Expand Down

0 comments on commit abfaa76

Please sign in to comment.