From f9706e9df0e37d214fb08eda30ba29627e97a607 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 22 Feb 2020 14:27:04 +0100 Subject: patch 8.2.0296: mixing up "long long" and __int64 may cause problems Problem: Mixing up "long long" and __int64 may cause problems. (John Marriott) Solution: Pass varnumber_T to vim_snprintf(). Add v:numbersize. --- src/message.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/message.c') diff --git a/src/message.c b/src/message.c index 9ab0eaefe..c2855fb34 100644 --- a/src/message.c +++ b/src/message.c @@ -4129,7 +4129,7 @@ infinity_str(int positive, * Limited support for floating point was added: 'f', 'F', 'e', 'E', 'g', 'G'. * * Length modifiers 'h' (short int) and 'l' (long int) and 'll' (long long int) - * are supported. + * are supported. NOTE: for 'll' the argument is varnumber_T or uvarnumber_T. * * The locale is not used, the string is used as a byte string. This is only * relevant for double-byte encodings where the second byte may be '%'. @@ -4371,7 +4371,7 @@ vim_vsnprintf_typval( p++; if (length_modifier == 'l' && *p == 'l') { - // double l = long long + // double l = __int64 / varnumber_T length_modifier = 'L'; p++; } @@ -4501,20 +4501,20 @@ vim_vsnprintf_typval( // argument is never negative) int arg_sign = 0; - // only defined for length modifier h, or for no - // length modifiers + // only set for length modifier h, or for no length + // modifiers int int_arg = 0; unsigned int uint_arg = 0; - // only defined for length modifier l + // only set for length modifier l long int long_arg = 0; unsigned long int ulong_arg = 0; - // only defined for length modifier ll + // only set for length modifier ll varnumber_T llong_arg = 0; uvarnumber_T ullong_arg = 0; - // only defined for b conversion + // only set for b conversion uvarnumber_T bin_arg = 0; // pointer argument value -only defined for p -- cgit v1.2.1