@@ -54,9 +54,9 @@ pcl::AdaptiveRangeCoder::encodeCharVectorToStream (const std::vector<char>& inpu
54
54
DWord freq[257 ];
55
55
56
56
// define limits
57
- const DWord top = static_cast <DWord> (1 ) << 24 ;
58
- const DWord bottom = static_cast <DWord> (1 ) << 16 ;
59
- const DWord maxRange = static_cast <DWord> (1 ) << 16 ;
57
+ constexpr DWord top = static_cast <DWord>(1 ) << 24 ;
58
+ constexpr DWord bottom = static_cast <DWord>(1 ) << 16 ;
59
+ constexpr DWord maxRange = static_cast <DWord>(1 ) << 16 ;
60
60
61
61
auto input_size = static_cast <unsigned > (inputByteVector_arg.size ());
62
62
@@ -132,9 +132,9 @@ pcl::AdaptiveRangeCoder::decodeStreamToCharVector (std::istream& inputByteStream
132
132
DWord freq[257 ];
133
133
134
134
// define limits
135
- const DWord top = static_cast <DWord> (1 ) << 24 ;
136
- const DWord bottom = static_cast <DWord> (1 ) << 16 ;
137
- const DWord maxRange = static_cast <DWord> (1 ) << 16 ;
135
+ constexpr DWord top = static_cast <DWord>(1 ) << 24 ;
136
+ constexpr DWord bottom = static_cast <DWord>(1 ) << 16 ;
137
+ constexpr DWord maxRange = static_cast <DWord>(1 ) << 16 ;
138
138
139
139
auto output_size = static_cast <unsigned > (outputByteVector_arg.size ());
140
140
@@ -222,9 +222,9 @@ pcl::StaticRangeCoder::encodeIntVectorToStream (std::vector<unsigned int>& input
222
222
std::ostream& outputByteStream_arg)
223
223
{
224
224
// define numerical limits
225
- const std::uint64_t top = static_cast <std::uint64_t > (1 ) << 56 ;
226
- const std::uint64_t bottom = static_cast <std::uint64_t > (1 ) << 48 ;
227
- const std::uint64_t maxRange = static_cast <std::uint64_t > (1 ) << 48 ;
225
+ constexpr std::uint64_t top = static_cast <std::uint64_t >(1 ) << 56 ;
226
+ constexpr std::uint64_t bottom = static_cast <std::uint64_t >(1 ) << 48 ;
227
+ constexpr std::uint64_t maxRange = static_cast <std::uint64_t >(1 ) << 48 ;
228
228
229
229
auto input_size = static_cast <unsigned long > (inputIntVector_arg.size ());
230
230
@@ -353,8 +353,8 @@ pcl::StaticRangeCoder::decodeStreamToIntVector (std::istream& inputByteStream_ar
353
353
std::vector<unsigned int >& outputIntVector_arg)
354
354
{
355
355
// define range limits
356
- const std::uint64_t top = static_cast <std::uint64_t > (1 ) << 56 ;
357
- const std::uint64_t bottom = static_cast <std::uint64_t > (1 ) << 48 ;
356
+ constexpr std::uint64_t top = static_cast <std::uint64_t >(1 ) << 56 ;
357
+ constexpr std::uint64_t bottom = static_cast <std::uint64_t >(1 ) << 48 ;
358
358
359
359
std::uint64_t frequencyTableSize;
360
360
unsigned char frequencyTableByteSize;
@@ -445,9 +445,9 @@ pcl::StaticRangeCoder::encodeCharVectorToStream (const std::vector<char>& inputB
445
445
DWord freq[257 ];
446
446
447
447
// define numerical limits
448
- const DWord top = static_cast <DWord> (1 ) << 24 ;
449
- const DWord bottom = static_cast <DWord> (1 ) << 16 ;
450
- const DWord maxRange = static_cast <DWord> (1 ) << 16 ;
448
+ constexpr DWord top = static_cast <DWord>(1 ) << 24 ;
449
+ constexpr DWord bottom = static_cast <DWord>(1 ) << 16 ;
450
+ constexpr DWord maxRange = static_cast <DWord>(1 ) << 16 ;
451
451
452
452
DWord low, range;
453
453
@@ -543,8 +543,8 @@ pcl::StaticRangeCoder::decodeStreamToCharVector (std::istream& inputByteStream_a
543
543
DWord freq[257 ];
544
544
545
545
// define range limits
546
- const DWord top = static_cast <DWord> (1 ) << 24 ;
547
- const DWord bottom = static_cast <DWord> (1 ) << 16 ;
546
+ constexpr DWord top = static_cast <DWord>(1 ) << 24 ;
547
+ constexpr DWord bottom = static_cast <DWord>(1 ) << 16 ;
548
548
549
549
DWord low, range;
550
550
DWord code;
0 commit comments