From 2d9374044b7b6b175d4a5e28490b20d83f48d67d Mon Sep 17 00:00:00 2001 From: Ben Dyer Date: Sun, 25 Oct 2015 17:44:44 +1100 Subject: [PATCH] Use std::size_t --- libuavcan/include/uavcan/marshal/bit_stream.hpp | 4 ++-- libuavcan/src/marshal/uc_bit_array_copy.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libuavcan/include/uavcan/marshal/bit_stream.hpp b/libuavcan/include/uavcan/marshal/bit_stream.hpp index 07046a0850..edbe1a522d 100644 --- a/libuavcan/include/uavcan/marshal/bit_stream.hpp +++ b/libuavcan/include/uavcan/marshal/bit_stream.hpp @@ -21,8 +21,8 @@ namespace uavcan * @param dst_org Destination array * @param dst_offset Bit offset of the first destination byte */ -void bitarrayCopy(const unsigned char* src_org, size_t src_offset, size_t src_len, - unsigned char* dst_org, size_t dst_offset); +void bitarrayCopy(const unsigned char* src_org, std::size_t src_offset, std::size_t src_len, + unsigned char* dst_org, std::size_t dst_offset); /** * This class treats a chunk of memory as an array of bits. diff --git a/libuavcan/src/marshal/uc_bit_array_copy.cpp b/libuavcan/src/marshal/uc_bit_array_copy.cpp index 286322dd86..3512ffaafa 100644 --- a/libuavcan/src/marshal/uc_bit_array_copy.cpp +++ b/libuavcan/src/marshal/uc_bit_array_copy.cpp @@ -9,8 +9,8 @@ namespace uavcan { -void bitarrayCopy(const unsigned char* src, size_t src_offset, size_t src_len, - unsigned char* dst, size_t dst_offset) +void bitarrayCopy(const unsigned char* src, std::size_t src_offset, std::size_t src_len, + unsigned char* dst, std::size_t dst_offset) { /* * Should never be called on a zero-length buffer. The caller will also ensure that the bit @@ -20,7 +20,7 @@ void bitarrayCopy(const unsigned char* src, size_t src_offset, size_t src_len, UAVCAN_ASSERT(src_len > 0U); UAVCAN_ASSERT(src_offset < 8U && dst_offset < 8U); - const size_t last_bit = src_offset + src_len; + const std::size_t last_bit = src_offset + src_len; while (last_bit - src_offset) { const uint8_t src_bit_offset = src_offset % 8U; @@ -28,7 +28,7 @@ void bitarrayCopy(const unsigned char* src, size_t src_offset, size_t src_len, // The number of bits to copy const uint8_t max_offset = uavcan::max(src_bit_offset, dst_bit_offset); - const size_t copy_bits = uavcan::min(last_bit - src_offset, (size_t)(8U - max_offset)); + const std::size_t copy_bits = uavcan::min(last_bit - src_offset, (std::size_t)(8U - max_offset)); /* * The mask indicating which bits of dest to update: