Skip to content

Commit

Permalink
fixes for clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
egecetin committed Jan 4, 2025
1 parent 3667f77 commit 90cf3f0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Packet++/header/TelnetLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace pcpp
{
private:
// Position iterator for next command
size_t lastPositionOffset{SIZE_MAX};
size_t lastPositionOffset{ SIZE_MAX };

// Checks if position is a data field
static bool isDataField(const uint8_t* pos);
Expand Down
4 changes: 1 addition & 3 deletions Packet++/src/NtpLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,7 @@ namespace pcpp
timeStruct = 0;
timer = gmtime(&timeStruct);
#else
struct tm timer_r
{
};
struct tm timer_r{};
timer = gmtime_r(&timeStruct, &timer_r);

if (timer != nullptr)
Expand Down
12 changes: 1 addition & 11 deletions Packet++/src/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,23 @@ namespace pcpp
}

Packet::Packet(RawPacket* rawPacket, bool freeRawPacket, ProtocolType parseUntil, OsiModelLayer parseUntilLayer)

{

setRawPacket(rawPacket, freeRawPacket, parseUntil, parseUntilLayer);
}

Packet::Packet(RawPacket* rawPacket, ProtocolType parseUntil)

{

auto parseUntilFamily = static_cast<ProtocolTypeFamily>(parseUntil);
setRawPacket(rawPacket, false, parseUntilFamily, OsiModelLayerUnknown);
}

Packet::Packet(RawPacket* rawPacket, ProtocolTypeFamily parseUntilFamily)

{

setRawPacket(rawPacket, false, parseUntilFamily, OsiModelLayerUnknown);
}

Packet::Packet(RawPacket* rawPacket, OsiModelLayer parseUntilLayer)

{

setRawPacket(rawPacket, false, UnknownProtocol, parseUntilLayer);
}

Expand Down Expand Up @@ -754,9 +746,7 @@ namespace pcpp
// but they're defined only in newer compilers (>= C++0x).
// on Windows localtime and gmtime are already thread-safe so there is not need
// to use localtime_r and gmtime_r
struct tm nowtm_r
{
};
struct tm nowtm_r{};
if (timeAsLocalTime)
{
nowtm = localtime_r(&nowtime, &nowtm_r);
Expand Down
5 changes: 3 additions & 2 deletions Packet++/src/SingleCommandTextProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ namespace pcpp
return std::min(posSpace, posHyphen);
// If nothing found but there is a CRLF it is a only command packet
}
if (posCRLF != std::string::npos) {
if (posCRLF != std::string::npos)
{
return posCRLF;
}
}

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions Packet++/src/TLVData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ namespace pcpp
}

TLVRecordBuilder::TLVRecordBuilder(uint32_t recType, const std::string& recValue, bool valueIsHexString)

{

if (valueIsHexString)
{
uint8_t recValueByteArr[512];
Expand Down
4 changes: 1 addition & 3 deletions Packet++/src/TcpReassembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ namespace pcpp
std::chrono::duration_cast<std::chrono::microseconds>(duration).count() -
std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::seconds(seconds)).count();

struct timeval out
{
};
struct timeval out{};
out.tv_sec = seconds;
out.tv_usec = microseconds;
return out;
Expand Down

0 comments on commit 90cf3f0

Please sign in to comment.