src: avoid implicit type conversions (take 2)

This fixes more C4244 MSVC warnings in the code base.

Refs: https://github.com/nodejs/node/pull/37149

PR-URL: https://github.com/nodejs/node/pull/37334
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Michaël Zasso committed 2021-02-20 10:50:28 +01:00
1 parent 5421e15bdc
commit d1f1fcfe0c
16 files changed
+83 -75

No files matched your search

+2 -2
View File
@@ -250,8 +250,8 @@ static size_t hex_decode(char* buf,
const size_t srcLen) {
size_t i;
for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) {
unsigned a = unhex(src[i * 2 + 0]);
unsigned b = unhex(src[i * 2 + 1]);
unsigned a = unhex(static_cast<uint8_t>(src[i * 2 + 0]));
unsigned b = unhex(static_cast<uint8_t>(src[i * 2 + 1]));
if (!~a || !~b)
return i;
buf[i] = (a << 4) | b;