Mercurial > vim
diff src/message.c @ 19477:2bb0e80fcd32 v8.2.0296
patch 8.2.0296: mixing up "long long" and __int64 may cause problems
Commit: https://github.com/vim/vim/commit/f9706e9df0e37d214fb08eda30ba29627e97a607
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 22 14:27:04 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 22 Feb 2020 14:30:04 +0100 |
parents | fdfe44ac6a1a |
children | b38d73f36467 |
line wrap: on
line diff
--- 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