1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fix compilation warnings

This commit is contained in:
Matias Fontanini
2016-02-21 18:50:47 -08:00
parent 5920185288
commit e5282f8a3c
3 changed files with 12 additions and 4 deletions

View File

@@ -483,9 +483,17 @@ PDU* PacketSender::recv_match_loop(const vector<int>& sockets,
if (now > end) {
return 0;
}
// VC complains if we don't statically cast here
#ifdef _WIN32
typedef long tv_sec_type;
typedef long tv_usec_type;
#else
typedef time_t tv_sec_type;
typedef long tv_usec_type;
#endif
microseconds diff = end - now;
timeout.tv_sec = duration_cast<seconds>(diff).count();
timeout.tv_usec = (diff - seconds(timeout.tv_sec)).count();
timeout.tv_sec = static_cast<tv_sec_type>(duration_cast<seconds>(diff).count());
timeout.tv_usec = static_cast<tv_usec_type>((diff - seconds(timeout.tv_sec)).count());
#else
#ifdef _WIN32
// Can't do much

View File

@@ -581,7 +581,7 @@ TEST_F(ICMPv6Test, MLD2Fields) {
icmp.multicast_address_records(records);
ICMPv6::multicast_address_records_list stored_records;
stored_records = icmp.multicast_address_records();
ASSERT_EQ(1, stored_records.size());
ASSERT_EQ(1U, stored_records.size());
ICMPv6::multicast_address_record r2 = *stored_records.begin();
EXPECT_EQ(r.type, r2.type);

View File

@@ -346,7 +346,7 @@ TEST_F(FlowTest, StreamFollower_ThreeWayHandshake) {
if (i != 0) {
ts += milliseconds(100);
}
Packet packet(packets[i], ts);
Packet packet(packets[i], duration_cast<microseconds>(ts));
follower.process_packet(packet);
}
Stream& stream = follower.find_stream(IPv4Address("1.2.3.4"), 22,