From 08169bf624ec46658654dab4a31dd2d295d739b9 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 31 Dec 2018 18:39:55 -0500 Subject: Fix MSVC warnings --- src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp | 2 +- src/lib/utils/bit_ops.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp b/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp index 6555183d1..d04fb47b3 100644 --- a/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp +++ b/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp @@ -63,7 +63,7 @@ uint8_t RFC4880_encode_count(size_t desired_iterations) auto i = std::upper_bound(OPENPGP_S2K_ITERS, OPENPGP_S2K_ITERS + 256, desired_iterations); - return (i - OPENPGP_S2K_ITERS); + return static_cast(i - OPENPGP_S2K_ITERS); } size_t RFC4880_decode_count(uint8_t iter) diff --git a/src/lib/utils/bit_ops.h b/src/lib/utils/bit_ops.h index 36a8d0259..352035bf4 100644 --- a/src/lib/utils/bit_ops.h +++ b/src/lib/utils/bit_ops.h @@ -107,7 +107,7 @@ inline size_t ctz(T n) for(size_t s = 8*sizeof(T) / 2; s > 0; s /= 2) { const T mask = (static_cast(1) << s) - 1; - const T z = s * (ct_is_zero(n & mask) & 1); + const size_t z = s * (ct_is_zero(n & mask) & 1); lb += z; n >>= z; } -- cgit v1.2.3