From de2a1735b723ff9b9eedc7649a594085e4ffc500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 17 Feb 2019 20:25:30 -0800 Subject: [PATCH] Fixing MSVC warnings. --- 3rdparty/astc-codec/src/decoder/astc_file.cc | 2 +- 3rdparty/astc-codec/src/decoder/codec.cc | 2 +- 3rdparty/astc-codec/src/decoder/endpoint_codec.cc | 4 ++-- 3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc | 4 ++-- 3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc | 6 +++--- 3rdparty/astc-codec/src/decoder/logical_astc_block.cc | 2 +- 3rdparty/astc-codec/src/decoder/quantization.cc | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/3rdparty/astc-codec/src/decoder/astc_file.cc b/3rdparty/astc-codec/src/decoder/astc_file.cc index 4770064..9999ee2 100644 --- a/3rdparty/astc-codec/src/decoder/astc_file.cc +++ b/3rdparty/astc-codec/src/decoder/astc_file.cc @@ -131,7 +131,7 @@ std::unique_ptr ASTCFile::LoadFile(const std::string& path, } base::Optional ASTCFile::GetFootprint() const { - return Footprint::FromDimensions(header_.block_width_, header_.block_height_); + return Footprint::FromDimensions(int(header_.block_width_), int(header_.block_height_)); } std::string ASTCFile::GetFootprintString() const { diff --git a/3rdparty/astc-codec/src/decoder/codec.cc b/3rdparty/astc-codec/src/decoder/codec.cc index 322656a..baa50b4 100644 --- a/3rdparty/astc-codec/src/decoder/codec.cc +++ b/3rdparty/astc-codec/src/decoder/codec.cc @@ -90,7 +90,7 @@ bool DecompressToImage(const uint8_t* astc_data, size_t astc_data_size, } uint8_t* pixel = out_row + px * kBytesPerPixelUNORM8; - const RgbaColor decoded_color = logical_block.ColorAt(x, y); + const RgbaColor decoded_color = logical_block.ColorAt(int(x), int(y)); for (size_t i = 0; i < kBytesPerPixelUNORM8; ++i) { pixel[i] = static_cast(decoded_color[i]); } diff --git a/3rdparty/astc-codec/src/decoder/endpoint_codec.cc b/3rdparty/astc-codec/src/decoder/endpoint_codec.cc index 9f85ea0..1097021 100644 --- a/3rdparty/astc-codec/src/decoder/endpoint_codec.cc +++ b/3rdparty/astc-codec/src/decoder/endpoint_codec.cc @@ -79,7 +79,7 @@ void InvertBitTransferSigned(int* const a, int* const b) { template void Quantize(ContainerType* const c, size_t max_value) { for (auto& x : *c) { - x = QuantizeCEValueToRange(x, max_value); + x = QuantizeCEValueToRange(x, int(max_value)); } } @@ -93,7 +93,7 @@ ArrayType QuantizeColor(const ArrayType& c, size_t max_value) { template void Unquantize(ContainerType* const c, size_t max_value) { for (auto& x : *c) { - x = UnquantizeCEValueFromRange(x, max_value); + x = UnquantizeCEValueFromRange(x, int(max_value)); } } diff --git a/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc b/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc index e32b19c..cb17773 100644 --- a/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc +++ b/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc @@ -299,8 +299,8 @@ void EncodeISEBlock(const std::vector& vals, int bits_per_val, // We only need to add as many bits as necessary, so let's limit it based // on the computation described in Section C.2.22 of the ASTC specification const int total_num_bits = - ((vals.size() * kNumEncodedBitsPerBlock + kNumVals - 1) / kNumVals) - + vals.size() * bits_per_val; + int(((vals.size() * kNumEncodedBitsPerBlock + kNumVals - 1) / kNumVals) + + vals.size() * bits_per_val); int bits_added = 0; // The number of bits used for the quint/trit encoding is necessary to know diff --git a/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc b/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc index 18f0137..a550c6d 100644 --- a/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc +++ b/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc @@ -214,7 +214,7 @@ int ExtraConfigBitPosition(const IntermediateBlockData& data) { int extra_config_bits = 0; if (!SharedEndpointModes(data)) { - const int num_encoded_cem_bits = 2 + data.endpoints.size() * 3; + const int num_encoded_cem_bits = 2 + int(data.endpoints.size()) * 3; extra_config_bits = num_encoded_cem_bits - 6; } @@ -304,7 +304,7 @@ int EndpointRangeForBlock(const IntermediateBlockData& data) { return kEndpointRange_ReturnInvalidWeightDims; } - const int num_partitions = data.endpoints.size(); + const int num_partitions = int(data.endpoints.size()); // Calculate the number of bits that we would write prior to getting to the // color endpoint data @@ -406,7 +406,7 @@ base::Optional Pack(const IntermediateBlockData& data, } // Next, we place the number of partitions minus one. - const int num_partitions = data.endpoints.size(); + const int num_partitions = int(data.endpoints.size()); bit_sink.PutBits(num_partitions - 1, 2); // If we have more than one partition, then we also have a partition ID. diff --git a/3rdparty/astc-codec/src/decoder/logical_astc_block.cc b/3rdparty/astc-codec/src/decoder/logical_astc_block.cc index 412581c..4889ce2 100644 --- a/3rdparty/astc-codec/src/decoder/logical_astc_block.cc +++ b/3rdparty/astc-codec/src/decoder/logical_astc_block.cc @@ -60,7 +60,7 @@ Partition ComputePartition(const Footprint& footprint, const IntermediateBlockData& block) { if (block.partition_id) { const int part_id = block.partition_id.value(); - const size_t num_parts = block.endpoints.size(); + const int num_parts = int(block.endpoints.size()); return GetASTCPartition(footprint, num_parts, part_id); } else { return GenerateSinglePartition(footprint); diff --git a/3rdparty/astc-codec/src/decoder/quantization.cc b/3rdparty/astc-codec/src/decoder/quantization.cc index e6507fe..233d13c 100644 --- a/3rdparty/astc-codec/src/decoder/quantization.cc +++ b/3rdparty/astc-codec/src/decoder/quantization.cc @@ -311,7 +311,7 @@ class BitQuantizationMap : public QuantizationMap { } assert(num_unquantized_bits == TotalUnquantizedBits); - unquantization_map_.push_back(unquantized); + unquantization_map_.push_back(int(unquantized)); // Fill half of the quantization map with the previous value for bits // and the other half with the current value for bits