summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-27 18:30:35 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-30 23:37:44 +0300
commit31338c5d88264422da7ac1d2e8672b3ef45b54b0 (patch)
treed94599924104a531121e73eeccd77813090ef29a
parent4362e27ab2e3d4e6ac94ea5eb13014594c2c68d9 (diff)
downloadqtlocation-mapboxgl-31338c5d88264422da7ac1d2e8672b3ef45b54b0.tar.gz
[core] Fix google-readability-casting errors
As reported by clang-tidy-8.
-rw-r--r--platform/default/src/mbgl/util/compression.cpp4
-rw-r--r--platform/node/src/node_expression.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/platform/default/src/mbgl/util/compression.cpp b/platform/default/src/mbgl/util/compression.cpp
index 1742898f9e..bd498ae471 100644
--- a/platform/default/src/mbgl/util/compression.cpp
+++ b/platform/default/src/mbgl/util/compression.cpp
@@ -40,7 +40,7 @@ std::string compress(const std::string &raw) {
throw std::runtime_error("failed to initialize deflate");
}
- deflate_stream.next_in = (Bytef *)raw.data();
+ deflate_stream.next_in = reinterpret_cast<Bytef *>(const_cast<char *>(raw.data()));
deflate_stream.avail_in = uInt(raw.size());
std::string result;
@@ -75,7 +75,7 @@ std::string decompress(const std::string &raw) {
throw std::runtime_error("failed to initialize inflate");
}
- inflate_stream.next_in = (Bytef *)raw.data();
+ inflate_stream.next_in = reinterpret_cast<Bytef *>(const_cast<char *>(raw.data()));
inflate_stream.avail_in = uInt(raw.size());
std::string result;
diff --git a/platform/node/src/node_expression.cpp b/platform/node/src/node_expression.cpp
index 7e59847da9..f2feaf8ea4 100644
--- a/platform/node/src/node_expression.cpp
+++ b/platform/node/src/node_expression.cpp
@@ -94,7 +94,7 @@ void NodeExpression::Parse(const Nan::FunctionCallbackInfo<v8::Value>& info) {
Nan::Set(err,
Nan::New("error").ToLocalChecked(),
Nan::New(error.message.c_str()).ToLocalChecked());
- Nan::Set(result, Nan::New((uint32_t)i), err);
+ Nan::Set(result, Nan::New(static_cast<uint32_t>(i)), err);
}
info.GetReturnValue().Set(result);
};