vim-patch:8.2.0271: the "num64" feature is available everywhere

Problem:    The "num64" feature is available everywhere and building without
            it causes problems.
Solution:   Graduage the "num64" feature. (James McCoy, closes vim/vim#5650)
82f654e092

Restore Test_printf_spec_b() from patch 7.4.2221..

N/A patches for version.c:

vim-patch:8.2.0594: MS-Windows: cannot build with WINVER set to 0x0501

Problem:    MS-Windows: cannot build with WINVER set to 0x0501.
Solution:   Only use inet_ntop() when available. (Ozaki Kiichi, closes vim/vim#5946)
b6fb0516ec

vim-patch:8.2.0965: has_funcundefined() is not used

Problem:    Has_funcundefined() is not used.
Solution:   Delete the function. (Dominique Pellé, closes vim/vim#6242)
5055c56cfb

vim-patch:8.2.1370: MS-Windows: warning for using fstat() with stat_T

Problem:    MS-Windows: warning for using fstat() with stat_T.
Solution:   use _fstat64() if available. (Naruhiko Nishino, closes vim/vim#6625)
c753478b82

vim-patch:8.2.2056: configure fails when building with implicit-function-declaration

Problem:    Configure fails when building with the
            "implicit-function-declaration" error enabled, specifically on Mac.
Solution:   Declear the functions like in the source code. (suggestion by
            Clemens Lang, closes vim/vim#7380)
ce7be3a0e6
This commit is contained in:
Jan Edmund Lazo 2020-11-26 22:36:57 -05:00
parent 628a1caa69
commit a3922e03a9
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
5 changed files with 49 additions and 60 deletions

View File

@ -900,6 +900,7 @@ int vim_vsnprintf_typval(
}
switch (fmt_spec) {
case 'b': case 'B':
case 'd': case 'u': case 'o': case 'x': case 'X':
if (tvs && length_modifier == '\0') {
length_modifier = '2';

View File

@ -125,22 +125,7 @@ func Test_option_value()
endfunc
function Test_printf_64bit()
if has('num64')
call assert_equal("123456789012345", printf('%d', 123456789012345))
endif
endfunc
func Test_setmatches()
hi def link 1 Comment
hi def link 2 PreProc
let set = [{"group": 1, "pattern": 2, "id": 3, "priority": 4}]
let exp = [{"group": '1', "pattern": '2', "id": 3, "priority": 4}]
if has('conceal')
let set[0]['conceal'] = 5
let exp[0]['conceal'] = '5'
endif
call setmatches(set)
call assert_equal(exp, getmatches())
call assert_equal("123456789012345", printf('%d', 123456789012345))
endfunc
function Test_printf_spec_s()
@ -168,6 +153,19 @@ function Test_printf_spec_s()
call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s'])))
endfunc
function Test_printf_spec_b()
call assert_equal("0", printf('%b', 0))
call assert_equal("00001100", printf('%08b', 12))
call assert_equal("11111111", printf('%08b', 0xff))
call assert_equal(" 1111011", printf('%10b', 123))
call assert_equal("0001111011", printf('%010b', 123))
call assert_equal(" 0b1111011", printf('%#10b', 123))
call assert_equal("0B01111011", printf('%#010B', 123))
call assert_equal("1001001100101100000001011010010", printf('%b', 1234567890))
call assert_equal("11100000100100010000110000011011101111101111001", printf('%b', 123456789012345))
call assert_equal("1111111111111111111111111111111111111111111111111111111111111111", printf('%b', -1))
endfunc
function Test_printf_misc()
call assert_equal('123', printf('123'))
call assert_fails("call printf('123', 3)", "E767:")
@ -482,6 +480,19 @@ func Test_funcref()
call assert_fails('let OneByRef = funcref("One", repeat(["foo"], 21))', 'E118:')
endfunc
func Test_setmatches()
hi def link 1 Comment
hi def link 2 PreProc
let set = [{"group": 1, "pattern": 2, "id": 3, "priority": 4}]
let exp = [{"group": '1', "pattern": '2', "id": 3, "priority": 4}]
if has('conceal')
let set[0]['conceal'] = 5
let exp[0]['conceal'] = '5'
endif
call setmatches(set)
call assert_equal(exp, getmatches())
endfunc
func Test_empty_concatenate()
call assert_equal('b', 'a'[4:0] . 'b')
call assert_equal('b', 'b' . 'a'[4:0])

View File

@ -24,11 +24,6 @@ func Test_largefile()
w
" Check if the file size is 4,000,000,000 bytes.
let fsize=getfsize(fname)
if has('num64')
call assert_true(fsize == 4000000000)
else
" getfsize() returns -2 if a Number is 32 bits.
call assert_true(fsize == -2)
endif
call assert_true(fsize == 4000000000)
call delete(fname)
endfunc

View File

@ -1257,9 +1257,8 @@ abc
\ '2147483647'], getline(1, '$'))
bwipe!
if has('num64')
new
a
new
a
-9223372036854775808
-9223372036854775807
@ -1274,22 +1273,21 @@ abc
abc
.
sort n
call assert_equal(['',
\ 'abc',
\ '',
\ '-9223372036854775808',
\ '-9223372036854775808',
\ '-9223372036854775807',
\ '-9223372036854775806',
\ '-1',
\ '0',
\ '1',
\ '9223372036854775806',
\ '9223372036854775807',
\ '9223372036854775807'], getline(1, '$'))
bwipe!
endif
sort n
call assert_equal(['',
\ 'abc',
\ '',
\ '-9223372036854775808',
\ '-9223372036854775808',
\ '-9223372036854775807',
\ '-9223372036854775806',
\ '-1',
\ '0',
\ '1',
\ '9223372036854775806',
\ '9223372036854775807',
\ '9223372036854775807'], getline(1, '$'))
bwipe!
endfunc

View File

@ -1068,10 +1068,6 @@ endfunc
"-------------------------------------------------------------------------------
func Test_num64()
if !has('num64')
return
endif
call assert_notequal( 4294967296, 0)
call assert_notequal(-4294967296, 0)
call assert_equal( 4294967296, 0xFFFFffff + 1)
@ -1313,27 +1309,15 @@ func Test_compound_assignment_operators()
" Test special cases: division or modulus with 0.
let x = 1
let x /= 0
if has('num64')
call assert_equal(0x7FFFFFFFFFFFFFFF, x)
else
call assert_equal(0x7fffffff, x)
endif
call assert_equal(0x7FFFFFFFFFFFFFFF, x)
let x = -1
let x /= 0
if has('num64')
call assert_equal(-0x7FFFFFFFFFFFFFFF, x)
else
call assert_equal(-0x7fffffff, x)
endif
call assert_equal(-0x7FFFFFFFFFFFFFFF, x)
let x = 0
let x /= 0
if has('num64')
call assert_equal(-0x7FFFFFFFFFFFFFFF - 1, x)
else
call assert_equal(-0x7FFFFFFF - 1, x)
endif
call assert_equal(-0x7FFFFFFFFFFFFFFF - 1, x)
let x = 1
let x %= 0