vim-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.
f9706e9df0
This commit is contained in:
Jan Edmund Lazo
2021-04-26 22:47:12 -04:00
parent e257aff016
commit 25c0675fe3
4 changed files with 14 additions and 0 deletions

View File

@@ -213,6 +213,7 @@ static struct vimvar {
VV(VV_FALSE, "false", VAR_BOOL, VV_RO),
VV(VV_TRUE, "true", VAR_BOOL, VV_RO),
VV(VV_NULL, "null", VAR_SPECIAL, VV_RO),
VV(VV_NUMBERSIZE, "numbersize", VAR_NUMBER, VV_RO),
VV(VV_VIM_DID_ENTER, "vim_did_enter", VAR_NUMBER, VV_RO),
VV(VV_TESTING, "testing", VAR_NUMBER, 0),
VV(VV_TYPE_NUMBER, "t_number", VAR_NUMBER, VV_RO),
@@ -394,6 +395,7 @@ void eval_init(void)
set_vim_var_bool(VV_FALSE, kBoolVarFalse);
set_vim_var_bool(VV_TRUE, kBoolVarTrue);
set_vim_var_special(VV_NULL, kSpecialVarNull);
set_vim_var_nr(VV_NUMBERSIZE, sizeof(varnumber_T) * 8);
set_vim_var_special(VV_EXITING, kSpecialVarNull);
set_vim_var_nr(VV_ECHOSPACE, sc_col - 1);

View File

@@ -142,6 +142,7 @@ typedef enum {
VV_FALSE,
VV_TRUE,
VV_NULL,
VV_NUMBERSIZE,
VV_VIM_DID_ENTER,
VV_TESTING,
VV_TYPE_NUMBER,

View File

@@ -120,6 +120,12 @@ func Test_skip_after_throw()
endtry
endfunc
func Test_numbersize()
" This will fail on systems without 64 bit int support or when not configured
" correctly.
call assert_equal(64, v:numbersize)
endfunc
func Test_curly_assignment()
let s:svar = 'svar'
let g:gvar = 'gvar'