From 3c647c95611343018ce4574ef8a3b3d2ec0f088a Mon Sep 17 00:00:00 2001 From: btolsch Date: Wed, 12 Feb 2020 16:48:48 -0800 Subject: Change CastSocket to use signed ID This change aligns CastSocket both with the style guide recommendation to prefer signed integers and to the Chrome CastSocket implementation, which will make it easier to integrate into Chrome. Bug: openscreen:59 Change-Id: If22691c41d46d1baa8350b402f8f3b3450cb7c32 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2051212 Commit-Queue: Brandon Tolsch Reviewed-by: Ryan Keane --- cast/sender/channel/sender_socket_factory.cc | 4 ++-- cast/sender/channel/sender_socket_factory.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'cast/sender') diff --git a/cast/sender/channel/sender_socket_factory.cc b/cast/sender/channel/sender_socket_factory.cc index 8dff73c4..6f8d9a51 100644 --- a/cast/sender/channel/sender_socket_factory.cc +++ b/cast/sender/channel/sender_socket_factory.cc @@ -16,11 +16,11 @@ namespace openscreen { namespace cast { bool operator<(const std::unique_ptr& a, - uint32_t b) { + int32_t b) { return a && a->socket->socket_id() < b; } -bool operator<(uint32_t a, +bool operator<(int32_t a, const std::unique_ptr& b) { return b && a < b->socket->socket_id(); } diff --git a/cast/sender/channel/sender_socket_factory.h b/cast/sender/channel/sender_socket_factory.h index 9cb31066..094530dd 100644 --- a/cast/sender/channel/sender_socket_factory.h +++ b/cast/sender/channel/sender_socket_factory.h @@ -79,8 +79,8 @@ class SenderSocketFactory final : public TlsConnectionFactory::Client, bssl::UniquePtr peer_cert; }; - friend bool operator<(const std::unique_ptr& a, uint32_t b); - friend bool operator<(uint32_t a, const std::unique_ptr& b); + friend bool operator<(const std::unique_ptr& a, int32_t b); + friend bool operator<(int32_t a, const std::unique_ptr& b); std::vector::iterator FindPendingConnection( const IPEndpoint& endpoint); -- cgit v1.2.3