summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-22 14:27:04 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-22 14:27:04 +0100
commitf9706e9df0e37d214fb08eda30ba29627e97a607 (patch)
tree9d90ad2977ed759664a2c2d0776901f34a8e0350 /src/message.c
parentc036e87bd7001238ab7cc5d9e30e59bbf989a5fd (diff)
downloadvim-git-f9706e9df0e37d214fb08eda30ba29627e97a607.tar.gz
patch 8.2.0296: mixing up "long long" and __int64 may cause problemsv8.2.0296
Problem: Mixing up "long long" and __int64 may cause problems. (John Marriott) Solution: Pass varnumber_T to vim_snprintf(). Add v:numbersize.
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c14
1 files changed, 7 insertions, 7 deletions
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