Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/ipfixprobe/ipfix-elements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace ipxp {
/**
* Conversion from microseconds to NTP fraction (resolution 1/(2^32)s, ~233 picoseconds).
*/
#define NTP_USEC_TO_FRAC(usec) (uint32_t)(((uint64_t) usec << 32) / 1000000)
#define NTP_USEC_TO_FRAC(usec) (uint32_t) (((uint64_t) usec << 32) / 1000000)
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjust spacing after the cast in the macro to maintain consistency with clang-format guidelines.

Copilot uses AI. Check for mistakes.

/**
* Create 64 bit NTP timestamp which consist of 32 bit seconds part and 32 bit fraction part.
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ uint64_t pntoh64(const void* p)
int shift = 56;

for (unsigned x = 0; x < 8; x++) {
buffer |= (uint64_t) * ((const uint8_t*) (p) + x) << (shift - (x * 8));
buffer |= (uint64_t) *((const uint8_t*) (p) + x) << (shift - (x * 8));
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra spaces around the pointer dereference to align with clang-format styling.

Suggested change
buffer |= (uint64_t) *((const uint8_t*) (p) + x) << (shift - (x * 8));
buffer |= (uint64_t)*((const uint8_t*)(p) + x) << (shift - (x * 8));

Copilot uses AI. Check for mistakes.
}
return buffer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/input/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ inline uint16_t parse_tcp_hdr(const u_char* data_ptr, uint16_t data_len, Packet*
pkt->dst_port = ntohs(tcp->dest);
pkt->tcp_seq = ntohl(tcp->seq);
pkt->tcp_ack = ntohl(tcp->ack_seq);
pkt->tcp_flags = (uint8_t) * (data_ptr + 13) & 0xFF;
pkt->tcp_flags = (uint8_t) *(data_ptr + 13) & 0xFF;
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure pointer arithmetic and dereference formatting adheres to clang-format rules.

Suggested change
pkt->tcp_flags = (uint8_t) *(data_ptr + 13) & 0xFF;
pkt->tcp_flags = (uint8_t)(*(data_ptr + 13)) & 0xFF;

Copilot uses AI. Check for mistakes.
pkt->tcp_window = ntohs(tcp->window);

DEBUG_MSG("TCP header:\n");
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/process/dns/src/dns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ void DNSPlugin::process_rdata(
case DNS_TYPE_TXT: {
DEBUG_MSG("\tData TXT:\n");

size_t len = (uint8_t) * (data++);
size_t len = (uint8_t) *(data++);
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardize pointer dereference formatting as per clang-format style.

Suggested change
size_t len = (uint8_t) *(data++);
size_t len = static_cast<uint8_t>(*data++);

Copilot uses AI. Check for mistakes.
size_t total_len = len + 1;

while (length != 0 && total_len <= length) {
DEBUG_MSG("\t\tTXT data:\t%s\n", std::string(data, len).c_str());
rdata << std::string(data, len);

data += len;
len = (uint8_t) * (data++);
len = (uint8_t) *(data++);
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply consistent formatting for pointer dereference following clang-format guidelines.

Suggested change
len = (uint8_t) *(data++);
data++;
len = (uint8_t)(*data);

Copilot uses AI. Check for mistakes.
total_len += len + 1;

if (total_len <= length) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/process/dnssd/src/dnssd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void DNSSDPlugin::process_rdata(
if (!(txt_all_records || matches_service(it, name))) { // all_records overrides filter
break;
}
size_t len = (uint8_t) * (data++);
size_t len = (uint8_t) *(data++);
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardize the pointer dereference formatting by removing extra spaces in accordance with clang-format.

Suggested change
size_t len = (uint8_t) *(data++);
size_t len = (uint8_t)*(data++);

Copilot uses AI. Check for mistakes.
size_t total_len = len + 1;
std::list<std::string>::const_iterator sit;
std::string txt;
Expand All @@ -378,7 +378,7 @@ void DNSSDPlugin::process_rdata(
}

data += len;
len = (uint8_t) * (data++);
len = (uint8_t) *(data++);
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply consistent pointer dereference formatting to meet clang-format requirements.

Suggested change
len = (uint8_t) *(data++);
data++;
len = (uint8_t)(*data);

Copilot uses AI. Check for mistakes.
total_len += len + 1;
}
} break;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/storage/cache/src/xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ XXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align)
len -= 8;
}
if (len >= 4) {
hash ^= (xxh_u64) (XXH_get32bits(ptr)) * XXH_PRIME64_1;
hash ^= (xxh_u64) (XXH_get32bits(ptr)) *XXH_PRIME64_1;
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the missing space after the multiplication operator to align with the clang-format style guidelines.

Suggested change
hash ^= (xxh_u64) (XXH_get32bits(ptr)) *XXH_PRIME64_1;
hash ^= (xxh_u64) (XXH_get32bits(ptr)) * XXH_PRIME64_1;

Copilot uses AI. Check for mistakes.
ptr += 4;
hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
len -= 4;
Expand Down