mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
628a1caa69
commit
a3922e03a9
@ -900,6 +900,7 @@ int vim_vsnprintf_typval(
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (fmt_spec) {
|
switch (fmt_spec) {
|
||||||
|
case 'b': case 'B':
|
||||||
case 'd': case 'u': case 'o': case 'x': case 'X':
|
case 'd': case 'u': case 'o': case 'x': case 'X':
|
||||||
if (tvs && length_modifier == '\0') {
|
if (tvs && length_modifier == '\0') {
|
||||||
length_modifier = '2';
|
length_modifier = '2';
|
||||||
|
@ -125,22 +125,7 @@ func Test_option_value()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
function Test_printf_64bit()
|
function Test_printf_64bit()
|
||||||
if has('num64')
|
call assert_equal("123456789012345", printf('%d', 123456789012345))
|
||||||
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())
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
function Test_printf_spec_s()
|
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'])))
|
call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s'])))
|
||||||
endfunc
|
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()
|
function Test_printf_misc()
|
||||||
call assert_equal('123', printf('123'))
|
call assert_equal('123', printf('123'))
|
||||||
call assert_fails("call printf('123', 3)", "E767:")
|
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:')
|
call assert_fails('let OneByRef = funcref("One", repeat(["foo"], 21))', 'E118:')
|
||||||
endfunc
|
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()
|
func Test_empty_concatenate()
|
||||||
call assert_equal('b', 'a'[4:0] . 'b')
|
call assert_equal('b', 'a'[4:0] . 'b')
|
||||||
call assert_equal('b', 'b' . 'a'[4:0])
|
call assert_equal('b', 'b' . 'a'[4:0])
|
||||||
|
@ -24,11 +24,6 @@ func Test_largefile()
|
|||||||
w
|
w
|
||||||
" Check if the file size is 4,000,000,000 bytes.
|
" Check if the file size is 4,000,000,000 bytes.
|
||||||
let fsize=getfsize(fname)
|
let fsize=getfsize(fname)
|
||||||
if has('num64')
|
call assert_true(fsize == 4000000000)
|
||||||
call assert_true(fsize == 4000000000)
|
|
||||||
else
|
|
||||||
" getfsize() returns -2 if a Number is 32 bits.
|
|
||||||
call assert_true(fsize == -2)
|
|
||||||
endif
|
|
||||||
call delete(fname)
|
call delete(fname)
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -1257,9 +1257,8 @@ abc
|
|||||||
\ '2147483647'], getline(1, '$'))
|
\ '2147483647'], getline(1, '$'))
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
if has('num64')
|
new
|
||||||
new
|
a
|
||||||
a
|
|
||||||
-9223372036854775808
|
-9223372036854775808
|
||||||
-9223372036854775807
|
-9223372036854775807
|
||||||
|
|
||||||
@ -1274,22 +1273,21 @@ abc
|
|||||||
abc
|
abc
|
||||||
|
|
||||||
.
|
.
|
||||||
sort n
|
sort n
|
||||||
call assert_equal(['',
|
call assert_equal(['',
|
||||||
\ 'abc',
|
\ 'abc',
|
||||||
\ '',
|
\ '',
|
||||||
\ '-9223372036854775808',
|
\ '-9223372036854775808',
|
||||||
\ '-9223372036854775808',
|
\ '-9223372036854775808',
|
||||||
\ '-9223372036854775807',
|
\ '-9223372036854775807',
|
||||||
\ '-9223372036854775806',
|
\ '-9223372036854775806',
|
||||||
\ '-1',
|
\ '-1',
|
||||||
\ '0',
|
\ '0',
|
||||||
\ '1',
|
\ '1',
|
||||||
\ '9223372036854775806',
|
\ '9223372036854775806',
|
||||||
\ '9223372036854775807',
|
\ '9223372036854775807',
|
||||||
\ '9223372036854775807'], getline(1, '$'))
|
\ '9223372036854775807'], getline(1, '$'))
|
||||||
bwipe!
|
bwipe!
|
||||||
endif
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
@ -1068,10 +1068,6 @@ endfunc
|
|||||||
"-------------------------------------------------------------------------------
|
"-------------------------------------------------------------------------------
|
||||||
|
|
||||||
func Test_num64()
|
func Test_num64()
|
||||||
if !has('num64')
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
call assert_notequal( 4294967296, 0)
|
call assert_notequal( 4294967296, 0)
|
||||||
call assert_notequal(-4294967296, 0)
|
call assert_notequal(-4294967296, 0)
|
||||||
call assert_equal( 4294967296, 0xFFFFffff + 1)
|
call assert_equal( 4294967296, 0xFFFFffff + 1)
|
||||||
@ -1313,27 +1309,15 @@ func Test_compound_assignment_operators()
|
|||||||
" Test special cases: division or modulus with 0.
|
" Test special cases: division or modulus with 0.
|
||||||
let x = 1
|
let x = 1
|
||||||
let x /= 0
|
let x /= 0
|
||||||
if has('num64')
|
call assert_equal(0x7FFFFFFFFFFFFFFF, x)
|
||||||
call assert_equal(0x7FFFFFFFFFFFFFFF, x)
|
|
||||||
else
|
|
||||||
call assert_equal(0x7fffffff, x)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let x = -1
|
let x = -1
|
||||||
let x /= 0
|
let x /= 0
|
||||||
if has('num64')
|
call assert_equal(-0x7FFFFFFFFFFFFFFF, x)
|
||||||
call assert_equal(-0x7FFFFFFFFFFFFFFF, x)
|
|
||||||
else
|
|
||||||
call assert_equal(-0x7fffffff, x)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let x = 0
|
let x = 0
|
||||||
let x /= 0
|
let x /= 0
|
||||||
if has('num64')
|
call assert_equal(-0x7FFFFFFFFFFFFFFF - 1, x)
|
||||||
call assert_equal(-0x7FFFFFFFFFFFFFFF - 1, x)
|
|
||||||
else
|
|
||||||
call assert_equal(-0x7FFFFFFF - 1, x)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let x = 1
|
let x = 1
|
||||||
let x %= 0
|
let x %= 0
|
||||||
|
Loading…
Reference in New Issue
Block a user