[core] Fix google-readability-casting errors
As reported by clang-tidy-8.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user