[core] Fix google-readability-casting errors

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 18:30:35 +02:00
parent 4362e27ab2
commit 31338c5d88
2 changed files with 3 additions and 3 deletions

View File

@@ -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;

View File

@@ -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);
};