1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 04:11:35 +01:00

Fix compilation warnings on Windows x64.

This commit is contained in:
Matias Fontanini
2015-05-17 17:30:54 -07:00
parent 5cd0c8e41b
commit c42cd0114f
47 changed files with 167 additions and 137 deletions

View File

@@ -203,7 +203,7 @@ void IPv6::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *pa
}
set_last_next_header(new_flag);
}
payload_length(total_sz - sizeof(_header));
payload_length(static_cast<uint16_t>(total_sz - sizeof(_header)));
std::memcpy(buffer, &_header, sizeof(_header));
buffer += sizeof(_header);
for(headers_type::const_iterator it = ext_headers.begin(); it != ext_headers.end(); ++it) {
@@ -227,7 +227,7 @@ void IPv6::send(PacketSender &sender, const NetworkInterface &) {
void IPv6::add_ext_header(const ext_header &header) {
ext_headers.push_back(header);
headers_size += header.data_size() + sizeof(uint8_t) * 2;
headers_size += static_cast<uint32_t>(header.data_size() + sizeof(uint8_t) * 2);
}
const IPv6::ext_header *IPv6::search_header(ExtensionHeader id) const {
@@ -251,7 +251,7 @@ void IPv6::set_last_next_header(uint8_t value) {
uint8_t *IPv6::write_header(const ext_header &header, uint8_t *buffer) {
*buffer++ = header.option();
*buffer++ = (header.length_field() > 8) ? (header.length_field() - 8) : 0;
*buffer++ = static_cast<uint8_t>((header.length_field() > 8) ? (header.length_field() - 8) : 0);
return std::copy(header.data_ptr(), header.data_ptr() + header.data_size(), buffer);
}