Skip to content

Commit

Permalink
clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Dec 6, 2023
1 parent 59dc218 commit 56a518e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 23 deletions.
22 changes: 9 additions & 13 deletions ecal/core/src/io/udp/fragmentation/msg_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#include <stdint.h>
#include <cstdint>

namespace IO
{
Expand All @@ -45,27 +45,23 @@ namespace IO
head[1] = 'C';
head[2] = 'A';
head[3] = 'L';
version = 5;
type = msg_type_unknown;
id = 0;
num = 0;
len = 0;
}

char head[4]; //-V112
int32_t version;
int32_t type;
int32_t id; // unique id for all message parts
int32_t num; // header: number of all parts, data: current number of that part
int32_t len; // header: complete size of message, data: current size of that part
char head[4]{}; //-V112
int32_t version = 5;
int32_t type = msg_type_unknown;
int32_t id = 0; // unique id for all message parts
int32_t num = 0; // header: number of all parts, data: current number of that part
int32_t len = 0; // header: complete size of message, data: current size of that part
};

#define MSG_BUFFER_SIZE (64*1024 - 20 /* IP header */ - 8 /* UDP header */ - 1 /* don't ask */)
#define MSG_PAYLOAD_SIZE (MSG_BUFFER_SIZE-sizeof(struct SUDPMessageHead))

struct SUDPMessage
{
struct SUDPMessageHead header;
char payload[MSG_PAYLOAD_SIZE];
char payload[MSG_PAYLOAD_SIZE]{};
};
}
}
4 changes: 2 additions & 2 deletions ecal/core/src/io/udp/fragmentation/rcv_fragments.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ namespace IO
bool HasFinished() { return((m_recv_mode == rcm_aborted) || (m_recv_mode == rcm_completed)); };
bool HasTimedOut(const std::chrono::duration<double>& diff_time_) { m_timeout += diff_time_; return(m_timeout >= std::chrono::milliseconds(NET_UDP_RECBUFFER_TIMEOUT)); };

int32_t GetMessageTotalLength() { return(m_message_total_len); };
int32_t GetMessageCurrentLength() { return(m_message_curr_len); };
int32_t GetMessageTotalLength() const { return(m_message_total_len); };
int32_t GetMessageCurrentLength() const { return(m_message_curr_len); };

virtual int OnMessageCompleted(std::vector<char>&& msg_buffer_) = 0;

Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/fragmentation/snd_fragments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace
// random number generator
unsigned long xorshf96(unsigned long& x, unsigned long& y, unsigned long& z) // period 2^96-1
{
unsigned long t;
unsigned long t(0);
x ^= x << 16;
x ^= x >> 5;
x ^= x << 1;
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/io/udp/sendreceive/udp_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

#include "io/udp/ecal_udp_configurations.h"

#include "io/udp/sendreceive/udp_receiver_asio.h"
#include "udp_receiver_asio.h"
#ifdef ECAL_NPCAP_SUPPORT
#include "io/udp/sendreceive/udp_receiver_npcap.h"
#include "udp_receiver_npcap.h"
#endif

namespace IO
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/sendreceive/udp_receiver_asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <ecal/ecal_config.h>

#include "io/udp/sendreceive/udp_receiver_asio.h"
#include "udp_receiver_asio.h"

#ifdef __linux__
#include "linux/socket_os.h"
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/sendreceive/udp_receiver_asio.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#pragma once

#include "io/udp/sendreceive/udp_receiver.h"
#include "udp_receiver.h"

#ifdef _MSC_VER
#pragma warning(push)
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/sendreceive/udp_receiver_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#pragma once

#include "io/udp/udp_receiver.h"
#include "udp_receiver.h"

namespace eCAL
{
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/sendreceive/udp_receiver_npcap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* ========================= eCAL LICENSE =================================
*/

#include "io/udp/sendreceive/udp_receiver_npcap.h"
#include "udp_receiver_npcap.h"

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/sendreceive/udp_receiver_npcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "io/udp/sendreceive/udp_receiver.h"
#include "udp_receiver.h"

#include "config/ecal_config_reader_hlp.h"
#include <udpcap/npcap_helpers.h>
Expand Down

0 comments on commit 56a518e

Please sign in to comment.