mirror of
https://github.com/nodejs/node.git
synced 2026-12-04 02:19:15 -05:00
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:
16 files changed
+83
-75
No files matched your search
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user