diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2017-01-15 12:33:45 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2017-01-15 22:22:42 +0100 |
commit | 39ff4d7adde80b87c994649559921b9189b9612f (patch) | |
tree | 1cd6f6022342c955d58c48c13d76e948e91da18a /crypto/asn1 | |
parent | b17d15f07ab02b8449db096eaafa56e93b242dee (diff) |
Fix VC warnings about unary minus to an unsigned type.
Reviewed-by: Andy Polyakov <appro@openssl.org>
GH: #2230
(cherry picked from commit 68d4bcfd0651c7ea5d37ca52abc0d2e6e6b3bd20)
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_int.c | 2 | ||||
-rw-r--r-- | crypto/asn1/x_long.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 833322e89b..e0bcd6e502 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -289,7 +289,7 @@ static int asn1_get_int64(int64_t *pr, const unsigned char *b, size_t blen, ASN1err(ASN1_F_ASN1_GET_INT64, ASN1_R_TOO_SMALL); return 0; } - *pr = -(uint64_t)r; + *pr = 0 - (uint64_t)r; } else { if (r > INT64_MAX) { ASN1err(ASN1_F_ASN1_GET_INT64, ASN1_R_TOO_LARGE); diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c index e86e4c72c7..c2844713cf 100644 --- a/crypto/asn1/x_long.c +++ b/crypto/asn1/x_long.c @@ -76,7 +76,7 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, * set. */ if (ltmp < 0) - utmp = -(unsigned long)ltmp - 1; + utmp = 0 - (unsigned long)ltmp - 1; else utmp = ltmp; clen = BN_num_bits_word(utmp); |