mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
Fix VC warnings about unary minus to an unsigned type.
Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #2230
This commit is contained in:
parent
244d7b288f
commit
68d4bcfd06
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -451,7 +451,7 @@ fmtint(char **sbuffer,
|
||||
if (!(flags & DP_F_UNSIGNED)) {
|
||||
if (value < 0) {
|
||||
signvalue = '-';
|
||||
uvalue = -(unsigned LLONG)value;
|
||||
uvalue = 0 - (unsigned LLONG)value;
|
||||
} else if (flags & DP_F_PLUS)
|
||||
signvalue = '+';
|
||||
else if (flags & DP_F_SPACE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user