Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
19476:381e5000c519 | 19477:2bb0e80fcd32 |
---|---|
4127 * An asterisk is supported for field width as well as precision. | 4127 * An asterisk is supported for field width as well as precision. |
4128 * | 4128 * |
4129 * Limited support for floating point was added: 'f', 'F', 'e', 'E', 'g', 'G'. | 4129 * Limited support for floating point was added: 'f', 'F', 'e', 'E', 'g', 'G'. |
4130 * | 4130 * |
4131 * Length modifiers 'h' (short int) and 'l' (long int) and 'll' (long long int) | 4131 * Length modifiers 'h' (short int) and 'l' (long int) and 'll' (long long int) |
4132 * are supported. | 4132 * are supported. NOTE: for 'll' the argument is varnumber_T or uvarnumber_T. |
4133 * | 4133 * |
4134 * The locale is not used, the string is used as a byte string. This is only | 4134 * The locale is not used, the string is used as a byte string. This is only |
4135 * relevant for double-byte encodings where the second byte may be '%'. | 4135 * relevant for double-byte encodings where the second byte may be '%'. |
4136 * | 4136 * |
4137 * It is permitted for "str_m" to be zero, and it is permitted to specify NULL | 4137 * It is permitted for "str_m" to be zero, and it is permitted to specify NULL |
4369 { | 4369 { |
4370 length_modifier = *p; | 4370 length_modifier = *p; |
4371 p++; | 4371 p++; |
4372 if (length_modifier == 'l' && *p == 'l') | 4372 if (length_modifier == 'l' && *p == 'l') |
4373 { | 4373 { |
4374 // double l = long long | 4374 // double l = __int64 / varnumber_T |
4375 length_modifier = 'L'; | 4375 length_modifier = 'L'; |
4376 p++; | 4376 p++; |
4377 } | 4377 } |
4378 } | 4378 } |
4379 fmt_spec = *p; | 4379 fmt_spec = *p; |
4499 // NULL for 'p'), +1 if greater than zero (or nonzero | 4499 // NULL for 'p'), +1 if greater than zero (or nonzero |
4500 // for unsigned arguments), -1 if negative (unsigned | 4500 // for unsigned arguments), -1 if negative (unsigned |
4501 // argument is never negative) | 4501 // argument is never negative) |
4502 int arg_sign = 0; | 4502 int arg_sign = 0; |
4503 | 4503 |
4504 // only defined for length modifier h, or for no | 4504 // only set for length modifier h, or for no length |
4505 // length modifiers | 4505 // modifiers |
4506 int int_arg = 0; | 4506 int int_arg = 0; |
4507 unsigned int uint_arg = 0; | 4507 unsigned int uint_arg = 0; |
4508 | 4508 |
4509 // only defined for length modifier l | 4509 // only set for length modifier l |
4510 long int long_arg = 0; | 4510 long int long_arg = 0; |
4511 unsigned long int ulong_arg = 0; | 4511 unsigned long int ulong_arg = 0; |
4512 | 4512 |
4513 // only defined for length modifier ll | 4513 // only set for length modifier ll |
4514 varnumber_T llong_arg = 0; | 4514 varnumber_T llong_arg = 0; |
4515 uvarnumber_T ullong_arg = 0; | 4515 uvarnumber_T ullong_arg = 0; |
4516 | 4516 |
4517 // only defined for b conversion | 4517 // only set for b conversion |
4518 uvarnumber_T bin_arg = 0; | 4518 uvarnumber_T bin_arg = 0; |
4519 | 4519 |
4520 // pointer argument value -only defined for p | 4520 // pointer argument value -only defined for p |
4521 // conversion | 4521 // conversion |
4522 void *ptr_arg = NULL; | 4522 void *ptr_arg = NULL; |