aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn/transport/interfaces
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-02-10 12:49:21 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-02-11 14:32:16 +0100
commit4c8876424cca41c8ce8ce67c1c0a394932cbdd58 (patch)
tree03ce5e673a9409b35ba7abf65e1740309ef44653 /libtransport/src/hicn/transport/interfaces
parent731e1188262be87d962f5694022fc74928d889b0 (diff)
[HICN-46] Remove warnings libtransport on windows
Change-Id: I09456770dcbca979491cdcadb310eab95a0dea17 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/interfaces')
-rw-r--r--libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc14
-rw-r--r--libtransport/src/hicn/transport/interfaces/socket_consumer.cc4
-rw-r--r--libtransport/src/hicn/transport/interfaces/socket_options_default_values.h3
-rw-r--r--libtransport/src/hicn/transport/interfaces/socket_producer.cc10
-rw-r--r--libtransport/src/hicn/transport/interfaces/socket_producer.h2
5 files changed, 17 insertions, 16 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
index 84c80dad7..740e03c3c 100644
--- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
+++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
@@ -51,7 +51,7 @@ RTCProducerSocket::RTCProducerSocket(asio::io_service &io_service)
nack_payload->append(NACK_HEADER_SIZE);
nack_->appendPayload(std::move(nack_payload));
lastStats_ = std::chrono::steady_clock::now();
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
prodLabel_ = ((rand() % 255) << 24UL);
}
@@ -68,7 +68,7 @@ RTCProducerSocket::RTCProducerSocket()
nack_payload->append(NACK_HEADER_SIZE);
nack_->appendPayload(std::move(nack_payload));
lastStats_ = std::chrono::steady_clock::now();
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
prodLabel_ = ((rand() % 255) << 24UL);
}
@@ -117,7 +117,7 @@ void RTCProducerSocket::produce(const uint8_t *buf, size_t buffer_size) {
return;
}
- updateStats(buffer_size + headerSize_ + TIMESTAMP_LEN);
+ updateStats((uint32_t)(buffer_size + headerSize_ + TIMESTAMP_LEN));
ContentObject content_object(flowName_.setSuffix(currentSeg_));
@@ -148,10 +148,10 @@ void RTCProducerSocket::onInterest(Interest::Ptr &&interest) {
// XXX
// packetsProductionRate_ is modified by another thread in updateStats
// this should be safe since I just read here. but, you never know.
- max_gap =
- floor((double)((double)((double)lifetime *
- INTEREST_LIFETIME_REDUCTION_FACTOR / 1000.0) *
- (double)packetsProductionRate_));
+ max_gap = (uint32_t)floor(
+ (double)((double)((double)lifetime * INTEREST_LIFETIME_REDUCTION_FACTOR /
+ 1000.0) *
+ (double)packetsProductionRate_));
if (interestSeg < currentSeg_ || interestSeg > (max_gap + currentSeg_)) {
sendNack(*interest);
diff --git a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
index 89411e92c..eacaf932b 100644
--- a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
+++ b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
@@ -507,11 +507,11 @@ int ConsumerSocket::getSocketOption(int socket_option_key,
uint32_t &socket_option_value) {
switch (socket_option_key) {
case GeneralTransportOptions::INPUT_BUFFER_SIZE:
- socket_option_value = input_buffer_size_;
+ socket_option_value = (uint32_t)input_buffer_size_;
return SOCKET_OPTION_GET;
case GeneralTransportOptions::OUTPUT_BUFFER_SIZE:
- socket_option_value = output_buffer_size_;
+ socket_option_value = (uint32_t)output_buffer_size_;
return SOCKET_OPTION_GET;
case GeneralTransportOptions::MAX_INTEREST_RETX:
diff --git a/libtransport/src/hicn/transport/interfaces/socket_options_default_values.h b/libtransport/src/hicn/transport/interfaces/socket_options_default_values.h
index b4ff44f1e..f9cbb5a44 100644
--- a/libtransport/src/hicn/transport/interfaces/socket_options_default_values.h
+++ b/libtransport/src/hicn/transport/interfaces/socket_options_default_values.h
@@ -27,7 +27,8 @@ namespace default_values {
const uint32_t interest_lifetime = 1001; // milliseconds
const uint32_t never_expire_time = HICN_MAX_LIFETIME;
-const uint32_t content_object_expiry_time = never_expire_time; // milliseconds -> 50 seconds
+const uint32_t content_object_expiry_time =
+ never_expire_time; // milliseconds -> 50 seconds
const uint32_t content_object_packet_size = 1500; // The ethernet MTU
const uint32_t producer_socket_input_buffer_size = 150000; // Interests
const uint32_t producer_socket_output_buffer_size = 150000; // Content Object
diff --git a/libtransport/src/hicn/transport/interfaces/socket_producer.cc b/libtransport/src/hicn/transport/interfaces/socket_producer.cc
index ab9de4a95..66c656924 100644
--- a/libtransport/src/hicn/transport/interfaces/socket_producer.cc
+++ b/libtransport/src/hicn/transport/interfaces/socket_producer.cc
@@ -314,7 +314,7 @@ uint32_t ProducerSocket::produce(Name content_name, const uint8_t *buf,
if (packaged_segments == number_of_segments - 1) {
content_object->appendPayload(&buf[bytes_segmented],
buffer_size - bytes_segmented);
- bytes_segmented += buffer_size - bytes_segmented;
+ bytes_segmented += (int)(buffer_size - bytes_segmented);
if (is_last && making_manifest_) {
is_last_manifest = true;
@@ -325,7 +325,7 @@ uint32_t ProducerSocket::produce(Name content_name, const uint8_t *buf,
} else {
content_object->appendPayload(&buf[bytes_segmented],
free_space_for_content);
- bytes_segmented += free_space_for_content;
+ bytes_segmented += (int)(free_space_for_content);
}
if (making_manifest_) {
@@ -716,15 +716,15 @@ int ProducerSocket::getSocketOption(int socket_option_key,
uint32_t &socket_option_value) {
switch (socket_option_key) {
case GeneralTransportOptions::INPUT_BUFFER_SIZE:
- socket_option_value = input_buffer_capacity_;
+ socket_option_value = (int)input_buffer_capacity_;
return SOCKET_OPTION_GET;
case GeneralTransportOptions::OUTPUT_BUFFER_SIZE:
- socket_option_value = output_buffer_.getLimit();
+ socket_option_value = (uint32_t)output_buffer_.getLimit();
return SOCKET_OPTION_GET;
case GeneralTransportOptions::DATA_PACKET_SIZE:
- socket_option_value = data_packet_size_;
+ socket_option_value = (uint32_t)data_packet_size_;
return SOCKET_OPTION_GET;
case GeneralTransportOptions::CONTENT_OBJECT_EXPIRY_TIME:
diff --git a/libtransport/src/hicn/transport/interfaces/socket_producer.h b/libtransport/src/hicn/transport/interfaces/socket_producer.h
index bd7d3f35f..d51464b77 100644
--- a/libtransport/src/hicn/transport/interfaces/socket_producer.h
+++ b/libtransport/src/hicn/transport/interfaces/socket_producer.h
@@ -223,7 +223,7 @@ class ProducerSocket : public Socket<BasePortal>,
HashAlgorithm hash_algorithm_;
utils::CryptoSuite crypto_suite_;
- //std::unique_ptr<utils::Identity> identity_;
+ // std::unique_ptr<utils::Identity> identity_;
// utils::Signer& signer_;
// buffers