Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Grégoire Roussel committed Aug 8, 2024
1 parent 584a1c8 commit b9323c1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
20 changes: 14 additions & 6 deletions profiler/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static void UpdateBroadcastClients()
auto parsedMessageOpt = tracy::ParseBroadcastMessage(msg, len);
if (parsedMessageOpt.has_value())
{
auto parsedMessage = parsedMessageOpt.value();
auto parsedMessage = parsedMessageOpt.value();
auto address = addr.GetText();
const auto clientId = tracy::ClientUniqueID(addr, parsedMessage.listenPort);
const auto ipNumerical = addr.GetNumber();
Expand All @@ -478,16 +478,24 @@ static void UpdateBroadcastClients()
} );
}
resolvLock.unlock();
clients.emplace( clientId, ClientData { time, parsedMessage.protocolVersion, parsedMessage.activeTime, parsedMessage.listenPort, parsedMessage.pid, parsedMessage.programName, std::move( ip ) } );
clients.emplace(clientId,
ClientData{time,
parsedMessage.protocolVersion,
parsedMessage.activeTime,
parsedMessage.listenPort,
parsedMessage.pid,
parsedMessage.programName,
std::move(ip)});
}
else
{
it->second.time = time;
it->second.activeTime = parsedMessage.activeTime;
it->second.port = parsedMessage.listenPort;
it->second.pid = parsedMessage.pid;
it->second.activeTime = parsedMessage.activeTime;
it->second.port = parsedMessage.listenPort;
it->second.pid = parsedMessage.pid;
it->second.protocolVersion = parsedMessage.protocolVersion;
if( strcmp( it->second.procName.c_str(), parsedMessage.programName ) != 0 ) it->second.procName = parsedMessage.programName;
if (strcmp(it->second.procName.c_str(), parsedMessage.programName) != 0)
it->second.procName = parsedMessage.programName;
}
}
else if( it != clients.end() )
Expand Down
2 changes: 1 addition & 1 deletion public/common/TracySocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ void IpAddress::Set( const struct sockaddr& addr )
#else
auto ai = (const struct sockaddr_in*)&addr;
#endif
inet_ntop( AF_INET, &ai->sin_addr, m_text, TEXT_SIZE );
inet_ntop(AF_INET, &ai->sin_addr, m_text, TEXT_SIZE);
m_number = ai->sin_addr.s_addr;
}

Expand Down
2 changes: 1 addition & 1 deletion server/TracyProtocolServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ uint64_t ClientUniqueID(tracy::IpAddress const& addr, uint16_t port)
{
return uint64_t(addr.GetNumber()) | (uint64_t(port) << 32);
}
}
} // namespace tracy
2 changes: 1 addition & 1 deletion server/TracyProtocolServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ namespace tracy
std::optional<tracy::BroadcastMessage> ParseBroadcastMessage(const char* msg, size_t msgLen);
// internal unique ID for a client
uint64_t ClientUniqueID(tracy::IpAddress const& addr, uint16_t port);
}
} // namespace tracy

#endif

0 comments on commit b9323c1

Please sign in to comment.