From ad5eb982de97d982bc808ece89903d1113ab9917 Mon Sep 17 00:00:00 2001 From: Mosder Date: Fri, 31 Jul 2026 20:59:31 +0200 Subject: refactor: apparently when you add , after last item in struct initalization it doesn't get formatted like shit by clang. crazy shit --- analyzer/utils/tcp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'analyzer/utils') diff --git a/analyzer/utils/tcp.c b/analyzer/utils/tcp.c index add2a76..a5d0366 100644 --- a/analyzer/utils/tcp.c +++ b/analyzer/utils/tcp.c @@ -12,15 +12,12 @@ // initalize default TCP segment TCPSegment new_segment() { - // clang-format off - TCPSegment segment = { + return (TCPSegment){ .payload = NULL, .len = 0, .seq = 0, - .port = 0 + .port = 0, }; - // clang-format on - return segment; } // segments compare function to use with heap @@ -75,16 +72,13 @@ TCPSegment get_segment_from_packet(const byte_t *packet, const struct pcap_pkthd } TCPStream new_stream(ConnectionSource src) { - // clang-format off - TCPStream stream = { + return (TCPStream){ .bytes = array_new(1, INIT_STREAM_CAPACITY, NULL), .seq = 0, .port = 0, .src = src, - .pending = NULL + .pending = NULL, }; - // clang-format on - return stream; } void destroy_stream(TCPStream stream) { -- cgit v1.2.3