All literal suffixes are upper case (U, L, F)

This commit is contained in:
Pavel Kirienko
2014-04-18 22:10:59 +04:00
parent b3769c9cb3
commit 707c3e3ed1
3 changed files with 36 additions and 36 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ namespace uavcan
void bitarrayCopy(const unsigned char* src_org, int src_offset, int src_len, unsigned char* dst_org, int dst_offset)
{
static const unsigned char reverse_mask[] = { 0x55U, 0x80U, 0xc0U, 0xe0U, 0xf0U, 0xf8U, 0xfcU, 0xfeU, 0xffU };
static const unsigned char reverse_mask_xor[] = { 0xffU, 0x7fU, 0x3fU, 0x1fU, 0x0fU, 0x07U, 0x03U, 0x01U, 0x00U };
static const unsigned char reverse_mask[] = { 0x55U, 0x80U, 0xC0U, 0xE0U, 0xF0U, 0xF8U, 0xFCU, 0xFEU, 0xFFU };
static const unsigned char reverse_mask_xor[] = { 0xFFU, 0x7FU, 0x3FU, 0x1FU, 0x0FU, 0x07U, 0x03U, 0x01U, 0x00U };
if (src_len > 0)
{
+2 -2
View File
@@ -84,7 +84,7 @@ uint16_t IEEE754Converter::nativeNonIeeeToHalf(float value)
const int32_t ival = static_cast<int32_t>(value);
hbits |= static_cast<uint16_t>(std::abs(ival) & 0x3FFU);
float diff = std::abs(value - static_cast<float>(ival));
hbits += diff >= 0.5f;
hbits += diff >= 0.5F;
return hbits;
}
@@ -94,7 +94,7 @@ float IEEE754Converter::halfToNativeNonIeee(uint16_t value)
unsigned abs = value & 0x7FFFU;
if (abs > 0x7C00U)
{
out = std::numeric_limits<float>::has_quiet_NaN ? std::numeric_limits<float>::quiet_NaN() : 0.0f;
out = std::numeric_limits<float>::has_quiet_NaN ? std::numeric_limits<float>::quiet_NaN() : 0.0F;
}
else if (abs == 0x7C00U)
{