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:
@@ -51,7 +51,7 @@ DHCP::DHCP(const uint8_t *buffer, uint32_t total_sz)
|
||||
: BootP(buffer, total_sz, 0), _size(sizeof(uint32_t))
|
||||
{
|
||||
buffer += BootP::header_size() - vend().size();
|
||||
total_sz -= BootP::header_size() - vend().size();
|
||||
total_sz -= static_cast<uint32_t>(BootP::header_size() - vend().size());
|
||||
uint8_t args[2] = {0};
|
||||
uint32_t uint32_t_buffer;
|
||||
std::memcpy(&uint32_t_buffer, buffer, sizeof(uint32_t));
|
||||
@@ -86,7 +86,7 @@ void DHCP::add_option(const option &opt) {
|
||||
}
|
||||
|
||||
void DHCP::internal_add_option(const option &opt) {
|
||||
_size += opt.data_size() + (sizeof(uint8_t) << 1);
|
||||
_size += static_cast<uint32_t>(opt.data_size() + (sizeof(uint8_t) << 1));
|
||||
}
|
||||
|
||||
const DHCP::option *DHCP::search_option(OptionTypes opt) const {
|
||||
@@ -216,7 +216,7 @@ PDU::serialization_type DHCP::serialize_list(const std::vector<ipaddress_type> &
|
||||
}
|
||||
|
||||
uint32_t DHCP::header_size() const {
|
||||
return BootP::header_size() - vend().size() + _size;
|
||||
return static_cast<uint32_t>(BootP::header_size() - vend().size() + _size);
|
||||
}
|
||||
|
||||
void DHCP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent) {
|
||||
@@ -231,7 +231,7 @@ void DHCP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *pa
|
||||
*((uint32_t*)&result[0]) = Endian::host_to_be<uint32_t>(0x63825363);
|
||||
for(options_type::const_iterator it = _options.begin(); it != _options.end(); ++it) {
|
||||
*(ptr++) = it->option();
|
||||
*(ptr++) = it->length_field();
|
||||
*(ptr++) = static_cast<uint8_t>(it->length_field());
|
||||
std::copy(it->data_ptr(), it->data_ptr() + it->data_size(), ptr);
|
||||
ptr += it->data_size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user