From 84ce70b5b70fe2adae67681f5deb6474fa339978 Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Fri, 15 Dec 2017 00:51:35 -0500 Subject: [PATCH 1/3] const Cvoid = Void --- base/boot.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/base/boot.jl b/base/boot.jl index d409957535667..3d0e43f4d3bc4 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -123,7 +123,7 @@ export # key types Any, DataType, Vararg, ANY, NTuple, - Tuple, Type, UnionAll, TypeName, TypeVar, Union, Void, + Tuple, Type, UnionAll, TypeName, TypeVar, Union, Void, Cvoid, SimpleVector, AbstractArray, DenseArray, NamedTuple, # special objects Function, CodeInfo, Method, MethodTable, TypeMapEntry, TypeMapLevel, @@ -282,6 +282,9 @@ end String(s::String) = s # no constructor yet +const Cvoid = Void +Void() = nothing + # This should always be inlined getptls() = ccall(:jl_get_ptls_states, Ptr{Void}, ()) @@ -318,8 +321,6 @@ TypeVar(n::Symbol, @nospecialize(lb), @nospecialize(ub)) = UnionAll(v::TypeVar, @nospecialize(t)) = ccall(:jl_type_unionall, Any, (Any, Any), v, t) -Void() = nothing - (::Type{Tuple{}})() = () # Tuple{}() struct VecElement{T} From e5fa92b826c7210b83897fd0d8cb3d5f50d71c8a Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Mon, 18 Dec 2017 10:16:13 -0500 Subject: [PATCH 2/3] rename Void => Cvoid, Nothing (depending on usage) git ls-files base doc examples src stdlib test | xargs perl -i -ple '/\b(ccall|cglobal|cfunction)\b/ && s/\bVoid\b/Cvoid/g' git ls-files base doc examples src stdlib test | xargs perl -i -ple 's/\bPtr\{Void\}/Ptr{Cvoid}/g' git ls-files base doc examples src stdlib test | xargs perl -i -ple 's/\Ref\{Void\}/Ref{Cvoid}/g' perl -i -ple 's/\bVoid\b/Cvoid/g' base/atomics.jl base/libgit2/status.jl base/random/dSFMT.jl doc/src/manual/calling-c-and-fortran-code.md test/llvmcall.jl test/threads.jl git ls-files base doc examples src stdlib test | xargs perl -i -ple 's/\bVoid\b/Nothing/g' --- base/abstractarray.jl | 2 +- base/abstractdict.jl | 2 +- base/array.jl | 38 +-- base/arrayshow.jl | 2 +- base/atomics.jl | 6 +- base/bitarray.jl | 30 +- base/boot.jl | 36 +- base/broadcast.jl | 6 +- base/c.jl | 18 +- base/channels.jl | 2 +- base/checked.jl | 2 +- base/client.jl | 2 +- base/codevalidation.jl | 4 +- base/coreimg.jl | 4 +- base/deepcopy.jl | 4 +- base/deprecated.jl | 22 +- base/dict.jl | 6 +- base/docs/basedocs.jl | 34 +- base/docs/utils.jl | 4 +- base/error.jl | 12 +- base/essentials.jl | 10 +- base/event.jl | 40 +-- base/fastmath.jl | 4 +- base/file.jl | 14 +- base/filesystem.jl | 16 +- base/gcutils.jl | 10 +- base/gmp.jl | 36 +- base/hashing2.jl | 4 +- base/inference.jl | 42 +-- base/initdefs.jl | 2 +- base/interactiveutil.jl | 14 +- base/io.jl | 4 +- base/iostream.jl | 64 ++-- base/libc.jl | 50 +-- base/libdl.jl | 22 +- base/libgit2/blame.jl | 8 +- base/libgit2/blob.jl | 8 +- base/libgit2/callbacks.jl | 36 +- base/libgit2/commit.jl | 16 +- base/libgit2/config.jl | 54 +-- base/libgit2/diff.jl | 24 +- base/libgit2/gitcredential.jl | 22 +- base/libgit2/index.jl | 24 +- base/libgit2/libgit2.jl | 10 +- base/libgit2/merge.jl | 20 +- base/libgit2/oid.jl | 10 +- base/libgit2/rebase.jl | 22 +- base/libgit2/reference.jl | 74 ++-- base/libgit2/remote.jl | 48 +-- base/libgit2/repository.jl | 74 ++-- base/libgit2/signature.jl | 2 +- base/libgit2/status.jl | 12 +- base/libgit2/tag.jl | 10 +- base/libgit2/tree.jl | 24 +- base/libgit2/types.jl | 114 +++---- base/libgit2/utils.jl | 2 +- base/libgit2/walker.jl | 16 +- base/libuv.jl | 60 ++-- base/linalg/bidiag.jl | 4 +- base/linalg/blas.jl | 58 ++-- base/linalg/lapack.jl | 284 +++++++-------- base/linalg/linalg.jl | 2 +- base/linalg/lq.jl | 2 +- base/linalg/qr.jl | 2 +- base/linalg/svd.jl | 12 +- base/loading.jl | 6 +- base/lock.jl | 2 +- base/locks.jl | 28 +- base/methodshow.jl | 6 +- base/missing.jl | 8 +- base/mpfr.jl | 10 +- base/namedtuple.jl | 2 +- base/options.jl | 2 +- base/ordering.jl | 2 +- base/parse.jl | 4 +- base/path.jl | 2 +- base/pcre.jl | 50 +-- base/pkg/pkg.jl | 4 +- base/pkg/query.jl | 2 +- base/pointer.jl | 12 +- base/precompile.jl | 342 +++++++++---------- base/printf.jl | 14 +- base/process.jl | 58 ++-- base/random/RNGs.jl | 4 +- base/random/dSFMT.jl | 20 +- base/random/generation.jl | 2 +- base/random/random.jl | 2 +- base/reflection.jl | 12 +- base/refpointer.jl | 10 +- base/regex.jl | 12 +- base/repl/LineEdit.jl | 6 +- base/repl/REPL.jl | 8 +- base/repl/Terminals.jl | 4 +- base/replutil.jl | 10 +- base/rounding.jl | 2 +- base/serialize.jl | 16 +- base/set.jl | 6 +- base/show.jl | 4 +- base/socket.jl | 138 ++++---- base/some.jl | 18 +- base/sort.jl | 18 +- base/sparse/higherorderfns.jl | 4 +- base/stacktraces.jl | 18 +- base/stream.jl | 134 ++++---- base/strings/io.jl | 4 +- base/strings/string.jl | 4 +- base/sysimg.jl | 6 +- base/sysinfo.jl | 4 +- base/threadcall.jl | 12 +- base/threadingconstructs.jl | 2 +- base/util.jl | 18 +- doc/images/jltypes.ai | 2 +- doc/src/assets/logo.png | Bin 18350 -> 18351 bytes doc/src/devdocs/debuggingtips.md | 4 +- doc/src/devdocs/llvm.md | 4 +- doc/src/devdocs/object.md | 2 +- doc/src/devdocs/types.md | 32 +- doc/src/manual/calling-c-and-fortran-code.md | 42 +-- doc/src/manual/faq.md | 8 +- doc/src/manual/interfaces.md | 2 +- doc/src/manual/modules.md | 6 +- doc/src/manual/parallel-computing.md | 20 +- doc/src/manual/stacktraces.md | 46 +-- doc/src/manual/strings.md | 4 +- doc/src/manual/style-guide.md | 4 +- doc/src/stdlib/arrays.md | 6 +- doc/src/stdlib/base.md | 2 +- examples/clustermanager/0mq/ZMQCM.jl | 2 +- examples/embedding/embedding.c | 2 +- src/abi_aarch64.cpp | 2 +- src/builtins.c | 2 +- src/ccall.cpp | 2 +- src/common_symbols2.inc | 2 +- src/jltypes.c | 6 +- src/julia-syntax.scm | 2 +- src/julia.h | 8 +- stdlib/Dates/src/parse.jl | 4 +- stdlib/Dates/src/types.jl | 4 +- stdlib/Distributed/src/cluster.jl | 40 +-- stdlib/Distributed/src/managers.jl | 4 +- stdlib/Distributed/src/messages.jl | 2 +- stdlib/Distributed/src/precompile.jl | 8 +- stdlib/Distributed/src/remotecall.jl | 6 +- stdlib/Distributed/src/workerpool.jl | 2 +- stdlib/FileWatching/src/FileWatching.jl | 50 +-- stdlib/FileWatching/test/runtests.jl | 6 +- stdlib/IterativeEigensolvers/src/arpack.jl | 12 +- stdlib/Mmap/src/Mmap.jl | 18 +- stdlib/Profile/src/Profile.jl | 10 +- stdlib/SharedArrays/test/runtests.jl | 2 +- stdlib/SuiteSparse/src/cholmod.jl | 46 +-- stdlib/SuiteSparse/src/spqr.jl | 28 +- stdlib/SuiteSparse/src/umfpack.jl | 66 ++-- stdlib/SuiteSparse/test/cholmod.jl | 22 +- stdlib/Test/src/Test.jl | 2 +- stdlib/Test/src/logging.jl | 2 +- stdlib/Unicode/test/runtests.jl | 2 +- test/ambiguous.jl | 4 +- test/arrayops.jl | 2 +- test/ccall.jl | 24 +- test/channels.jl | 10 +- test/codegen.jl | 28 +- test/core.jl | 186 +++++----- test/deprecation_exec.jl | 2 +- test/docs.jl | 2 +- test/file.jl | 2 +- test/inference.jl | 12 +- test/intfuncs.jl | 4 +- test/libdl.jl | 4 +- test/libgit2-helpers.jl | 12 +- test/linalg/generic.jl | 2 +- test/llvmcall.jl | 8 +- test/llvmpasses/.gitignore | 2 +- test/misc.jl | 4 +- test/missing.jl | 10 +- test/namedtuple.jl | 18 +- test/netload/memtest.jl | 2 +- test/perf/perfutil.jl | 2 +- test/perf/threads/laplace3d/laplace3d.jl | 4 +- test/perf/threads/lbm3d/lbm3d.jl | 2 +- test/perf/threads/stockcorr/pstockcorr.jl | 2 +- test/reflection.jl | 24 +- test/repl.jl | 4 +- test/show.jl | 8 +- test/socket.jl | 2 +- test/some.jl | 30 +- test/spawn.jl | 8 +- test/staged.jl | 2 +- test/strings/basic.jl | 2 +- test/strings/io.jl | 4 +- test/strings/types.jl | 2 +- test/subtype.jl | 14 +- test/threads.jl | 20 +- test/tuple.jl | 2 +- test/worlds.jl | 8 +- 195 files changed, 1850 insertions(+), 1850 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 5f1386b729500..c998dca6cccce 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1697,7 +1697,7 @@ end ## iteration utilities ## """ - foreach(f, c...) -> Void + foreach(f, c...) -> Nothing Call function `f` on each element of iterable `c`. For multiple iterable arguments, `f` is called elementwise. diff --git a/base/abstractdict.jl b/base/abstractdict.jl index 5264f002a9e99..bdcd083c2084c 100644 --- a/base/abstractdict.jl +++ b/base/abstractdict.jl @@ -581,7 +581,7 @@ end function empty!(t::ObjectIdDict) resize!(t.ht, 32) - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), t.ht, 0, sizeof(t.ht)) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), t.ht, 0, sizeof(t.ht)) t.ndel = 0 return t end diff --git a/base/array.jl b/base/array.jl index bea192e129ea3..fb7925e37482b 100644 --- a/base/array.jl +++ b/base/array.jl @@ -161,7 +161,7 @@ segfault your program, in the same manner as C. function unsafe_copyto!(dest::Ptr{T}, src::Ptr{T}, n) where T # Do not use this to copy data between pointer arrays. # It can't be made safe no matter how carefully you checked. - ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt), + ccall(:memmove, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), dest, src, n*sizeof(T)) return dest end @@ -182,15 +182,15 @@ function unsafe_copyto!(dest::Array{T}, doffs, src::Array{T}, soffs, n) where T if isbits(T) unsafe_copyto!(pointer(dest, doffs), pointer(src, soffs), n) elseif isbitsunion(T) - ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt), + ccall(:memmove, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), pointer(dest, doffs), pointer(src, soffs), n * Base.bitsunionsize(T)) # copy selector bytes - ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt), + ccall(:memmove, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), convert(Ptr{UInt8}, pointer(dest)) + length(dest) * Base.bitsunionsize(T) + doffs - 1, convert(Ptr{UInt8}, pointer(src)) + length(src) * Base.bitsunionsize(T) + soffs - 1, n) else - ccall(:jl_array_ptr_copy, Void, (Any, Ptr{Void}, Any, Ptr{Void}, Int), + ccall(:jl_array_ptr_copy, Cvoid, (Any, Ptr{Cvoid}, Any, Ptr{Cvoid}, Int), dest, pointer(dest, doffs), src, pointer(src, soffs), n) end @_gc_preserve_end t2 @@ -304,7 +304,7 @@ end getindex(::Type{Any}) = Vector{Any}() function fill!(a::Union{Array{UInt8}, Array{Int8}}, x::Integer) - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), a, x, length(a)) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), a, x, length(a)) return a end @@ -727,20 +727,20 @@ setindex!(A::Array{T, N}, x::Number, ::Vararg{Colon, N}) where {T, N} = fill!(A, # efficiently grow an array _growbeg!(a::Vector, delta::Integer) = - ccall(:jl_array_grow_beg, Void, (Any, UInt), a, delta) + ccall(:jl_array_grow_beg, Cvoid, (Any, UInt), a, delta) _growend!(a::Vector, delta::Integer) = - ccall(:jl_array_grow_end, Void, (Any, UInt), a, delta) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), a, delta) _growat!(a::Vector, i::Integer, delta::Integer) = - ccall(:jl_array_grow_at, Void, (Any, Int, UInt), a, i - 1, delta) + ccall(:jl_array_grow_at, Cvoid, (Any, Int, UInt), a, i - 1, delta) # efficiently delete part of an array _deletebeg!(a::Vector, delta::Integer) = - ccall(:jl_array_del_beg, Void, (Any, UInt), a, delta) + ccall(:jl_array_del_beg, Cvoid, (Any, UInt), a, delta) _deleteend!(a::Vector, delta::Integer) = - ccall(:jl_array_del_end, Void, (Any, UInt), a, delta) + ccall(:jl_array_del_end, Cvoid, (Any, UInt), a, delta) _deleteat!(a::Vector, i::Integer, delta::Integer) = - ccall(:jl_array_del_at, Void, (Any, Int, UInt), a, i - 1, delta) + ccall(:jl_array_del_at, Cvoid, (Any, Int, UInt), a, i - 1, delta) ## Dequeue functionality ## @@ -918,7 +918,7 @@ julia> a[1:6] function resize!(a::Vector, nl::Integer) l = length(a) if nl > l - ccall(:jl_array_grow_end, Void, (Any, UInt), a, nl-l) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), a, nl-l) else if nl < 0 throw(ArgumentError("new length must be ≥ 0")) @@ -936,7 +936,7 @@ Suggest that collection `s` reserve capacity for at least `n` elements. This can function sizehint! end function sizehint!(a::Vector, sz::Integer) - ccall(:jl_array_sizehint, Void, (Any, UInt), a, sz) + ccall(:jl_array_sizehint, Cvoid, (Any, UInt), a, sz) a end @@ -1302,7 +1302,7 @@ function empty!(a::Vector) return a end -_memcmp(a, b, len) = ccall(:memcmp, Int32, (Ptr{Void}, Ptr{Void}, Csize_t), a, b, len) % Int +_memcmp(a, b, len) = ccall(:memcmp, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), a, b, len) % Int # use memcmp for lexcmp on byte arrays function lexcmp(a::Array{UInt8,1}, b::Array{UInt8,1}) @@ -1450,24 +1450,24 @@ function vcat(arrays::Vector{T}...) where T elsz = bitsunionsize(T) selptr = convert(Ptr{UInt8}, ptr) + n * elsz else - elsz = Core.sizeof(Ptr{Void}) + elsz = Core.sizeof(Ptr{Cvoid}) end t = @_gc_preserve_begin arr for a in arrays na = length(a) nba = na * elsz if isbits(T) - ccall(:memcpy, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt), + ccall(:memcpy, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), ptr, a, nba) elseif isbitsunion(T) - ccall(:memcpy, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt), + ccall(:memcpy, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), ptr, a, nba) # copy selector bytes - ccall(:memcpy, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt), + ccall(:memcpy, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), selptr, convert(Ptr{UInt8}, pointer(a)) + nba, na) selptr += na else - ccall(:jl_array_ptr_copy, Void, (Any, Ptr{Void}, Any, Ptr{Void}, Int), + ccall(:jl_array_ptr_copy, Cvoid, (Any, Ptr{Cvoid}, Any, Ptr{Cvoid}, Int), arr, ptr, a, pointer(a), na) end ptr += nba diff --git a/base/arrayshow.jl b/base/arrayshow.jl index b20f9286c86a8..9fc7f6e9e144b 100644 --- a/base/arrayshow.jl +++ b/base/arrayshow.jl @@ -461,7 +461,7 @@ show(io::IO, X::AbstractVector) = show_vector(io, X) # not set to Any, then the problem would be similar one layer below # when printing an array like Any[Any[1]]; hence we must treat Any # specially -function typeinfo_eltype(typeinfo::Type)::Union{Type,Void} +function typeinfo_eltype(typeinfo::Type)::Union{Type,Nothing} if typeinfo == Any # the current context knows nothing about what is being displayed, not even # whether it's a collection or scalar diff --git a/base/atomics.jl b/base/atomics.jl index 5b0799f38754b..039cfe13ef619 100644 --- a/base/atomics.jl +++ b/base/atomics.jl @@ -354,7 +354,7 @@ for typ in atomictypes %ptr = inttoptr i$WORD_SIZE %0 to $lt* store atomic $lt %1, $lt* %ptr release, align $(alignment(typ)) ret void - """, Void, Tuple{Ptr{$typ}, $typ}, unsafe_convert(Ptr{$typ}, x), v) + """, Cvoid, Tuple{Ptr{$typ}, $typ}, unsafe_convert(Ptr{$typ}, x), v) # Note: atomic_cas! succeeded (i.e. it stored "new") if and only if the result is "cmp" if typ <: Integer @@ -421,7 +421,7 @@ for op in [:+, :-, :max, :min] old = atomic_cas!(var, cmp, new) reinterpret(IT, old) == reinterpret(IT, cmp) && return new # Temporary solution before we have gc transition support in codegen. - ccall(:jl_gc_safepoint, Void, ()) + ccall(:jl_gc_safepoint, Cvoid, ()) end end end @@ -444,4 +444,4 @@ For further details, see LLVM's `fence` instruction. atomic_fence() = llvmcall(""" fence seq_cst ret void - """, Void, Tuple{}) + """, Cvoid, Tuple{}) diff --git a/base/bitarray.jl b/base/bitarray.jl index 93db5579d59d6..9da097162ace0 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -737,7 +737,7 @@ function push!(B::BitVector, item) l = _mod64(length(B)) if l == 0 - ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, 1) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, 1) Bc[end] = UInt64(0) end B.len += 1 @@ -755,7 +755,7 @@ function append!(B::BitVector, items::BitVector) k0 = length(Bc) k1 = num_bit_chunks(n0 + n1) if k1 > k0 - ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, k1 - k0) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, k1 - k0) Bc[end] = UInt64(0) end B.len += n1 @@ -774,7 +774,7 @@ function prepend!(B::BitVector, items::BitVector) k0 = length(Bc) k1 = num_bit_chunks(n0 + n1) if k1 > k0 - ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, k1 - k0) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, k1 - k0) Bc[end] = UInt64(0) end B.len += n1 @@ -787,7 +787,7 @@ prepend!(B::BitVector, items::AbstractVector{Bool}) = prepend!(B, BitArray(items prepend!(A::Vector{Bool}, items::BitVector) = prepend!(A, Array(items)) function sizehint!(B::BitVector, sz::Integer) - ccall(:jl_array_sizehint, Void, (Any, UInt), B.chunks, num_bit_chunks(sz)) + ccall(:jl_array_sizehint, Cvoid, (Any, UInt), B.chunks, num_bit_chunks(sz)) return B end @@ -803,7 +803,7 @@ function resize!(B::BitVector, n::Integer) k0 = length(Bc) k1 = num_bit_chunks(Int(n)) if k1 > k0 - ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, k1 - k0) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, k1 - k0) Bc[end] = UInt64(0) end B.len = n @@ -816,7 +816,7 @@ function pop!(B::BitVector) B[end] = false l = _mod64(length(B)) - l == 1 && ccall(:jl_array_del_end, Void, (Any, UInt), B.chunks, 1) + l == 1 && ccall(:jl_array_del_end, Cvoid, (Any, UInt), B.chunks, 1) B.len -= 1 return item @@ -829,7 +829,7 @@ function unshift!(B::BitVector, item) l = _mod64(length(B)) if l == 0 - ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, 1) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, 1) Bc[end] = UInt64(0) end B.len += 1 @@ -857,7 +857,7 @@ function shift!(B::BitVector) l = _mod64(length(B)) if l == 1 - ccall(:jl_array_del_end, Void, (Any, UInt), Bc, 1) + ccall(:jl_array_del_end, Cvoid, (Any, UInt), Bc, 1) else Bc[end] >>>= 1 end @@ -878,7 +878,7 @@ function insert!(B::BitVector, i::Integer, item) l = _mod64(length(B)) if l == 0 - ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, 1) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, 1) Bc[end] = UInt64(0) end B.len += 1 @@ -916,7 +916,7 @@ function _deleteat!(B::BitVector, i::Integer) l = _mod64(length(B)) if l == 1 - ccall(:jl_array_del_end, Void, (Any, UInt), Bc, 1) + ccall(:jl_array_del_end, Cvoid, (Any, UInt), Bc, 1) elseif length(Bc) > k Bc[end] >>>= 1 end @@ -947,7 +947,7 @@ function deleteat!(B::BitVector, r::UnitRange{Int}) copy_chunks!(Bc, i_f, Bc, i_l+1, n-i_l) - delta_k < 0 && ccall(:jl_array_del_end, Void, (Any, UInt), Bc, -delta_k) + delta_k < 0 && ccall(:jl_array_del_end, Cvoid, (Any, UInt), Bc, -delta_k) B.len = new_l @@ -985,7 +985,7 @@ function deleteat!(B::BitVector, inds) q <= n && copy_chunks!(Bc, p, Bc, q, n-q+1) delta_k = num_bit_chunks(new_l) - length(Bc) - delta_k < 0 && ccall(:jl_array_del_end, Void, (Any, UInt), Bc, -delta_k) + delta_k < 0 && ccall(:jl_array_del_end, Cvoid, (Any, UInt), Bc, -delta_k) B.len = new_l @@ -1032,12 +1032,12 @@ function splice!(B::BitVector, r::Union{UnitRange{Int}, Integer}, ins::AbstractA new_l = length(B) + lins - ldel delta_k = num_bit_chunks(new_l) - length(Bc) - delta_k > 0 && ccall(:jl_array_grow_end, Void, (Any, UInt), Bc, delta_k) + delta_k > 0 && ccall(:jl_array_grow_end, Cvoid, (Any, UInt), Bc, delta_k) copy_chunks!(Bc, i_f+lins, Bc, i_l+1, n-i_l) copy_chunks!(Bc, i_f, Bins.chunks, 1, lins) - delta_k < 0 && ccall(:jl_array_del_end, Void, (Any, UInt), Bc, -delta_k) + delta_k < 0 && ccall(:jl_array_del_end, Cvoid, (Any, UInt), Bc, -delta_k) B.len = new_l @@ -1060,7 +1060,7 @@ end function empty!(B::BitVector) - ccall(:jl_array_del_end, Void, (Any, UInt), B.chunks, length(B.chunks)) + ccall(:jl_array_del_end, Cvoid, (Any, UInt), B.chunks, length(B.chunks)) B.len = 0 return B end diff --git a/base/boot.jl b/base/boot.jl index 3d0e43f4d3bc4..d9194a79f1b87 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -45,9 +45,9 @@ # body #end -#struct Void +#struct Nothing #end -#const nothing = Void() +#const nothing = Nothing() #abstract type AbstractArray{T,N} end #abstract type DenseArray{T,N} <: AbstractArray{T,N} end @@ -87,7 +87,7 @@ #struct LineNumberNode # line::Int -# file::Any # nominally Union{Symbol,Void} +# file::Any # nominally Union{Symbol,Nothing} #end #struct LabelNode @@ -123,7 +123,7 @@ export # key types Any, DataType, Vararg, ANY, NTuple, - Tuple, Type, UnionAll, TypeName, TypeVar, Union, Void, Cvoid, + Tuple, Type, UnionAll, TypeName, TypeVar, Union, Nothing, Cvoid, SimpleVector, AbstractArray, DenseArray, NamedTuple, # special objects Function, CodeInfo, Method, MethodTable, TypeMapEntry, TypeMapLevel, @@ -282,11 +282,11 @@ end String(s::String) = s # no constructor yet -const Cvoid = Void -Void() = nothing +const Cvoid = Nothing +Nothing() = nothing # This should always be inlined -getptls() = ccall(:jl_get_ptls_states, Ptr{Void}, ()) +getptls() = ccall(:jl_get_ptls_states, Ptr{Cvoid}, ()) include(m::Module, fname::String) = ccall(:jl_load_, Any, (Any, Any), m, fname) @@ -309,7 +309,7 @@ mutable struct WeakRef value WeakRef() = WeakRef(nothing) WeakRef(@nospecialize(v)) = ccall(:jl_gc_new_weakref_th, Ref{WeakRef}, - (Ptr{Void}, Any), getptls(), v) + (Ptr{Cvoid}, Any), getptls(), v) end TypeVar(n::Symbol) = @@ -415,23 +415,23 @@ mutable struct CoreSTDOUT <: IO end mutable struct CoreSTDERR <: IO end const STDOUT = CoreSTDOUT() const STDERR = CoreSTDERR() -io_pointer(::CoreSTDOUT) = Intrinsics.pointerref(Intrinsics.cglobal(:jl_uv_stdout, Ptr{Void}), 1, 1) -io_pointer(::CoreSTDERR) = Intrinsics.pointerref(Intrinsics.cglobal(:jl_uv_stderr, Ptr{Void}), 1, 1) +io_pointer(::CoreSTDOUT) = Intrinsics.pointerref(Intrinsics.cglobal(:jl_uv_stdout, Ptr{Cvoid}), 1, 1) +io_pointer(::CoreSTDERR) = Intrinsics.pointerref(Intrinsics.cglobal(:jl_uv_stderr, Ptr{Cvoid}), 1, 1) unsafe_write(io::IO, x::Ptr{UInt8}, nb::UInt) = - (ccall(:jl_uv_puts, Void, (Ptr{Void}, Ptr{UInt8}, UInt), io_pointer(io), x, nb); nb) + (ccall(:jl_uv_puts, Cvoid, (Ptr{Cvoid}, Ptr{UInt8}, UInt), io_pointer(io), x, nb); nb) unsafe_write(io::IO, x::Ptr{UInt8}, nb::Int) = - (ccall(:jl_uv_puts, Void, (Ptr{Void}, Ptr{UInt8}, Int), io_pointer(io), x, nb); nb) + (ccall(:jl_uv_puts, Cvoid, (Ptr{Cvoid}, Ptr{UInt8}, Int), io_pointer(io), x, nb); nb) write(io::IO, x::UInt8) = - (ccall(:jl_uv_putb, Void, (Ptr{Void}, UInt8), io_pointer(io), x); 1) + (ccall(:jl_uv_putb, Cvoid, (Ptr{Cvoid}, UInt8), io_pointer(io), x); 1) function write(io::IO, x::String) nb = sizeof(x) unsafe_write(io, ccall(:jl_string_ptr, Ptr{UInt8}, (Any,), x), nb) return nb end -show(io::IO, @nospecialize x) = ccall(:jl_static_show, Void, (Ptr{Void}, Any), io_pointer(io), x) -print(io::IO, x::Char) = ccall(:jl_uv_putc, Void, (Ptr{Void}, Char), io_pointer(io), x) +show(io::IO, @nospecialize x) = ccall(:jl_static_show, Cvoid, (Ptr{Cvoid}, Any), io_pointer(io), x) +print(io::IO, x::Char) = ccall(:jl_uv_putc, Cvoid, (Ptr{Cvoid}, Char), io_pointer(io), x) print(io::IO, x::String) = (write(io, x); nothing) print(io::IO, @nospecialize x) = show(io, x) print(io::IO, @nospecialize(x), @nospecialize a...) = (print(io, x); print(io, a...)) @@ -445,7 +445,7 @@ println(@nospecialize a...) = println(STDOUT, a...) struct GeneratedFunctionStub gen argnames::Array{Any,1} - spnames::Union{Void, Array{Any,1}} + spnames::Union{Nothing, Array{Any,1}} line::Int file::Symbol end @@ -504,8 +504,8 @@ function NamedTuple{names,T}(args::T) where {names, T <: Tuple} arrayset(false, flds, getfield(args, i), i) i = add_int(i, 1) end - ccall(:jl_new_structv, Any, (Any, Ptr{Void}, UInt32), NT, fields, N)::NT + ccall(:jl_new_structv, Any, (Any, Ptr{Cvoid}, UInt32), NT, fields, N)::NT end end -ccall(:jl_set_istopmod, Void, (Any, Bool), Core, true) +ccall(:jl_set_istopmod, Cvoid, (Any, Bool), Core, true) diff --git a/base/broadcast.jl b/base/broadcast.jl index 603f8ec54efc2..2996ea3bcb852 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -592,7 +592,7 @@ julia> string.(("one","two","three","four"), ": ", 1:4) @inline broadcast(f, A, Bs...) = broadcast(f, combine_styles(A, Bs...), nothing, nothing, A, Bs...) -@inline broadcast(f, s::BroadcastStyle, ::Void, ::Void, A, Bs...) = +@inline broadcast(f, s::BroadcastStyle, ::Nothing, ::Nothing, A, Bs...) = broadcast(f, s, combine_eltypes(f, A, Bs...), combine_indices(A, Bs...), A, Bs...) @@ -633,9 +633,9 @@ function broadcast_nonleaf(f, s::NonleafHandlingTypes, ::Type{ElType}, shape::In return _broadcast!(f, dest, keeps, Idefaults, As, Val(nargs), iter, st, 1) end -broadcast(f, ::Union{Scalar,Unknown}, ::Void, ::Void, a...) = f(a...) +broadcast(f, ::Union{Scalar,Unknown}, ::Nothing, ::Nothing, a...) = f(a...) -@inline broadcast(f, ::Style{Tuple}, ::Void, ::Void, A, Bs...) = +@inline broadcast(f, ::Style{Tuple}, ::Nothing, ::Nothing, A, Bs...) = tuplebroadcast(f, longest_tuple(A, Bs...), A, Bs...) @inline tuplebroadcast(f, ::NTuple{N,Any}, As...) where {N} = ntuple(k -> f(tuplebroadcast_getargs(As, k)...), Val(N)) diff --git a/base/c.jl b/base/c.jl index c57ce27d6130b..8972a809d1e11 100644 --- a/base/c.jl +++ b/base/c.jl @@ -5,11 +5,11 @@ import Core.Intrinsics: cglobal, bitcast """ - cglobal((symbol, library) [, type=Void]) + cglobal((symbol, library) [, type=Cvoid]) Obtain a pointer to a global variable in a C-exported shared library, specified exactly as in [`ccall`](@ref). -Returns a `Ptr{Type}`, defaulting to `Ptr{Void}` if no `Type` argument is +Returns a `Ptr{Type}`, defaulting to `Ptr{Cvoid}` if no `Type` argument is supplied. The values can be read or written by [`unsafe_load`](@ref) or [`unsafe_store!`](@ref), respectively. @@ -17,7 +17,7 @@ respectively. cglobal """ - cfunction(f::Function, returntype::Type, argtypes::Type) -> Ptr{Void} + cfunction(f::Function, returntype::Type, argtypes::Type) -> Ptr{Cvoid} Generate C-callable function pointer from the Julia function `f`. Type annotation of the return value in the callback function is a must for situations where Julia cannot infer the return @@ -30,10 +30,10 @@ julia> function foo(x::Int, y::Int) end julia> cfunction(foo, Int, Tuple{Int,Int}) -Ptr{Void} @0x000000001b82fcd0 +Ptr{Cvoid} @0x000000001b82fcd0 ``` """ -cfunction(f, r, a) = ccall(:jl_function_ptr, Ptr{Void}, (Any, Any, Any), f, r, a) +cfunction(f, r, a) = ccall(:jl_function_ptr, Ptr{Cvoid}, (Any, Any, Any), f, r, a) if ccall(:jl_is_char_signed, Ref{Bool}, ()) const Cchar = Int8 @@ -97,7 +97,7 @@ convert(::Type{Ptr{T}}, p::Cstring) where {T<:Union{Int8,UInt8}} = bitcast(Ptr{T convert(::Type{Ptr{Cwchar_t}}, p::Cwstring) = bitcast(Ptr{Cwchar_t}, p) # construction from untyped pointers -convert(::Type{T}, p::Ptr{Void}) where {T<:Union{Cstring,Cwstring}} = bitcast(T, p) +convert(::Type{T}, p::Ptr{Cvoid}) where {T<:Union{Cstring,Cwstring}} = bitcast(T, p) """ pointer(array [, index]) @@ -339,8 +339,8 @@ end # reennable_sigint is provided so that immediate ctrl-c handling is # re-enabled within a sigatomic region, e.g. inside a Julia callback function # within a long-running C routine. -sigatomic_begin() = ccall(:jl_sigatomic_begin, Void, ()) -sigatomic_end() = ccall(:jl_sigatomic_end, Void, ()) +sigatomic_begin() = ccall(:jl_sigatomic_begin, Cvoid, ()) +sigatomic_end() = ccall(:jl_sigatomic_end, Cvoid, ()) """ disable_sigint(f::Function) @@ -382,7 +382,7 @@ function reenable_sigint(f::Function) end function ccallable(f::Function, rt::Type, argt::Type, name::Union{AbstractString,Symbol}=string(f)) - ccall(:jl_extern_c, Void, (Any, Any, Any, Cstring), f, rt, argt, name) + ccall(:jl_extern_c, Cvoid, (Any, Any, Any, Cstring), f, rt, argt, name) end function expand_ccallable(rt, def) diff --git a/base/channels.jl b/base/channels.jl index 4e40177cf1c82..b9a019e7ceade 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -21,7 +21,7 @@ mutable struct Channel{T} <: AbstractChannel cond_take::Condition # waiting for data to become available cond_put::Condition # waiting for a writeable slot state::Symbol - excp::Union{Exception, Void} # exception to be thrown when state != :open + excp::Union{Exception, Nothing} # exception to be thrown when state != :open data::Vector{T} sz_max::Int # maximum size of channel diff --git a/base/checked.jl b/base/checked.jl index 2870461a43205..61284a8620e54 100644 --- a/base/checked.jl +++ b/base/checked.jl @@ -60,7 +60,7 @@ brokenSignedInt = Union{} brokenUnsignedInt = Union{} brokenSignedIntMul = Int128 brokenUnsignedIntMul = UInt128 -if Core.sizeof(Ptr{Void}) == 4 +if Core.sizeof(Ptr{Cvoid}) == 4 brokenSignedIntMul = Union{brokenSignedIntMul, Int64} brokenUnsignedIntMul = Union{brokenUnsignedIntMul, UInt64} end diff --git a/base/client.jl b/base/client.jl index 9142bf2575598..400047d72f446 100644 --- a/base/client.jl +++ b/base/client.jl @@ -317,7 +317,7 @@ function process_options(opts::JLOptions) if arg_is_program # program if !is_interactive - ccall(:jl_exit_on_sigint, Void, (Cint,), 1) + ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 1) end include(Main, PROGRAM_FILE) end diff --git a/base/codevalidation.jl b/base/codevalidation.jl index 8c0d87f972b15..94d39af460e09 100644 --- a/base/codevalidation.jl +++ b/base/codevalidation.jl @@ -157,7 +157,7 @@ end """ validate_code!(errors::Vector{>:InvalidCodeError}, mi::MethodInstance, - c::Union{Void,CodeInfo} = Core.Inference.retrieve_code_info(mi)) + c::Union{Nothing,CodeInfo} = Core.Inference.retrieve_code_info(mi)) Validate `mi`, logging any violation by pushing an `InvalidCodeError` into `errors`. @@ -165,7 +165,7 @@ If `isa(c, CodeInfo)`, also call `validate_code!(errors, c)`. It is assumed that the `CodeInfo` instance associated with `mi`. """ function validate_code!(errors::Vector{>:InvalidCodeError}, mi::Core.MethodInstance, - c::Union{Void,CodeInfo} = Core.Inference.retrieve_code_info(mi)) + c::Union{Nothing,CodeInfo} = Core.Inference.retrieve_code_info(mi)) is_top_level = mi.def isa Module if is_top_level mnargs = 0 diff --git a/base/coreimg.jl b/base/coreimg.jl index 750386a7c7368..de91ed1536975 100644 --- a/base/coreimg.jl +++ b/base/coreimg.jl @@ -7,7 +7,7 @@ import Core: print, println, show, write, unsafe_write, STDOUT, STDERR const getproperty = getfield const setproperty! = setfield! -ccall(:jl_set_istopmod, Void, (Any, Bool), Inference, false) +ccall(:jl_set_istopmod, Cvoid, (Any, Bool), Inference, false) eval(x) = Core.eval(Inference, x) eval(m, x) = Core.eval(m, x) @@ -68,7 +68,7 @@ include("docs/core.jl") # compiler include("codevalidation.jl") include("inference.jl") -ccall(:jl_set_typeinf_func, Void, (Any,), typeinf_ext) +ccall(:jl_set_typeinf_func, Cvoid, (Any,), typeinf_ext) end # baremodule Inference )) diff --git a/base/deepcopy.jl b/base/deepcopy.jl index 2f22a32679697..740a2ebfbf4fb 100644 --- a/base/deepcopy.jl +++ b/base/deepcopy.jl @@ -64,7 +64,7 @@ function deepcopy_internal(@nospecialize(x), stackdict::ObjectIdDict) end for i in 1:nf if isdefined(x,i) - ccall(:jl_set_nth_field, Void, (Any, Csize_t, Any), y, i-1, + ccall(:jl_set_nth_field, Cvoid, (Any, Csize_t, Any), y, i-1, deepcopy_internal(getfield(x,i), stackdict)) end end @@ -90,7 +90,7 @@ function _deepcopy_array_t(@nospecialize(x), T, stackdict::ObjectIdDict) if !isbits(typeof(xi)) xi = deepcopy_internal(xi, stackdict) end - ccall(:jl_arrayset, Void, (Any, Any, Csize_t), dest, xi, i-1) + ccall(:jl_arrayset, Cvoid, (Any, Any, Csize_t), dest, xi, i-1) end end return dest diff --git a/base/deprecated.jl b/base/deprecated.jl index 9b6c1a8e37e7e..9234a91cd3802 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -92,7 +92,7 @@ function firstcaller(bt::Vector, funcsyms) # Identify the calling line found = false lkup = StackTraces.UNKNOWN - found_frame = Ptr{Void}(0) + found_frame = Ptr{Cvoid}(0) for frame in bt lkups = StackTraces.lookup(frame) for outer lkup in lkups @@ -120,7 +120,7 @@ function firstcaller(bt::Vector, funcsyms) return found_frame, lkup end -deprecate(m::Module, s::Symbol, flag=1) = ccall(:jl_deprecate_binding, Void, (Any, Any, Cint), m, s, flag) +deprecate(m::Module, s::Symbol, flag=1) = ccall(:jl_deprecate_binding, Cvoid, (Any, Any, Cint), m, s, flag) macro deprecate_binding(old, new, export_old=true, dep_message=nothing) dep_message == nothing && (dep_message = ", use $new instead") @@ -1660,10 +1660,10 @@ import .Iterators.enumerate # PR #23640 # when this deprecation is deleted, remove all calls to it, and replace all keywords of: -# `payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Void}` +# `payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Nothing}` # with `payload::CredentialPayload` from base/libgit2/libgit2.jl @eval LibGit2 function deprecate_nullable_creds(f, sig, payload) - if isa(payload, Union{AbstractCredential, CachedCredentials, Void}) + if isa(payload, Union{AbstractCredential, CachedCredentials, Nothing}) # Note: Be careful not to show the contents of the credentials as it could reveal a # password. if payload === nothing @@ -2192,12 +2192,12 @@ end # issue #16307 @deprecate finalizer(o, f::Function) finalizer(f, o) # This misses other callables but they are very rare in the wild -@deprecate finalizer(o, f::Ptr{Void}) finalizer(f, o) +@deprecate finalizer(o, f::Ptr{Cvoid}) finalizer(f, o) # Avoid ambiguity, can remove when deprecations are removed: # This is almost certainly going to be a silent failure for code that is not updated. -finalizer(f::Ptr{Void}, o::Ptr{Void}) = invoke(finalizer, Tuple{Ptr{Void}, Any}, f, o) -finalizer(f::Ptr{Void}, o::Function) = invoke(finalizer, Tuple{Ptr{Void}, Any}, f, o) +finalizer(f::Ptr{Cvoid}, o::Ptr{Cvoid}) = invoke(finalizer, Tuple{Ptr{Cvoid}, Any}, f, o) +finalizer(f::Ptr{Cvoid}, o::Function) = invoke(finalizer, Tuple{Ptr{Cvoid}, Any}, f, o) # Broadcast extension API (#23939) @eval Broadcast begin @@ -3134,9 +3134,9 @@ end @deprecate merge!(repo::LibGit2.GitRepo, args...; kwargs...) LibGit2.merge!(repo, args...; kwargs...) # 24490 - warnings and messages -const log_info_to = Dict{Tuple{Union{Module,Void},Union{Symbol,Void}},IO}() -const log_warn_to = Dict{Tuple{Union{Module,Void},Union{Symbol,Void}},IO}() -const log_error_to = Dict{Tuple{Union{Module,Void},Union{Symbol,Void}},IO}() +const log_info_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}() +const log_warn_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}() +const log_error_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}() function _redirect(io::IO, log_to::Dict, sf::StackTraces.StackFrame) (sf.linfo isa Core.MethodInstance) || return io @@ -3202,7 +3202,7 @@ default), `:info`, `:warn`, or `:error`. See `Base.log_{info,warn,error}_to` for the current set of redirections. Call `logging` with no arguments (or just the `kind`) to reset everything. """ -function logging(io::IO, m::Union{Module,Void}=nothing, f::Union{Symbol,Void}=nothing; +function logging(io::IO, m::Union{Module,Nothing}=nothing, f::Union{Symbol,Nothing}=nothing; kind::Symbol=:all) depwarn("""`logging()` is deprecated, use `with_logger` instead to capture messages from `Base`""", :logging) diff --git a/base/dict.jl b/base/dict.jl index f766f091cfbe5..8815e926b4dea 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -269,7 +269,7 @@ function rehash!(h::Dict{K,V}, newsz = length(h.keys)) where V where K end max_values(::Type) = typemax(Int) -max_values(T::Type{<:Union{Void,BitIntegerSmall}}) = 1 << (8*sizeof(T)) +max_values(T::Type{<:Union{Nothing,BitIntegerSmall}}) = 1 << (8*sizeof(T)) max_values(T::Union) = max(max_values(T.a), max_values(T.b)) max_values(::Type{Bool}) = 2 @@ -662,8 +662,8 @@ end function _delete!(h::Dict, index) h.slots[index] = 0x2 - ccall(:jl_arrayunset, Void, (Any, UInt), h.keys, index-1) - ccall(:jl_arrayunset, Void, (Any, UInt), h.vals, index-1) + ccall(:jl_arrayunset, Cvoid, (Any, UInt), h.keys, index-1) + ccall(:jl_arrayunset, Cvoid, (Any, UInt), h.vals, index-1) h.ndel += 1 h.count -= 1 h.age += 1 diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index 4c370d7ab053d..053c6ec633155 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -804,16 +804,16 @@ DevNull # doc strings for code in boot.jl and built-ins """ - Void + Nothing A type with no fields that is the type [`nothing`](@ref). """ -Void +Nothing """ nothing -The singleton instance of type `Void`, used by convention when there is no value to return +The singleton instance of type `Nothing`, used by convention when there is no value to return (as in a C `void` function) or when a variable or field holds no value. """ nothing @@ -1321,17 +1321,17 @@ Vector{T}(::Uninitialized, n) Construct a [`Vector{T}`](@ref) of length `m`, initialized with [`nothing`](@ref) entries. Element type `T` must be able to hold -these values, i.e. `Void <: T`. +these values, i.e. `Nothing <: T`. # Examples ```jldoctest -julia> Vector{Union{Void, String}}(nothing, 2) -2-element Array{Union{Void, String},1}: +julia> Vector{Union{Nothing, String}}(nothing, 2) +2-element Array{Union{Nothing, String},1}: nothing nothing ``` """ -Vector{T}(::Void, n) +Vector{T}(::Nothing, n) """ Vector{T}(missing, m) @@ -1370,17 +1370,17 @@ Matrix{T}(::Uninitialized, m, n) Construct a [`Matrix{T}`](@ref) of size `m`×`n`, initialized with [`nothing`](@ref) entries. Element type `T` must be able to hold -these values, i.e. `Void <: T`. +these values, i.e. `Nothing <: T`. # Examples ```jldoctest -julia> Matrix{Union{Void, String}}(nothing, 2, 3) -2×3 Array{Union{Void, String},2}: +julia> Matrix{Union{Nothing, String}}(nothing, 2, 3) +2×3 Array{Union{Nothing, String},2}: nothing nothing nothing nothing nothing nothing ``` """ -Matrix{T}(::Void, m, n) +Matrix{T}(::Nothing, m, n) """ Matrix{T}(missing, m, n) @@ -1431,22 +1431,22 @@ Array{T,N}(::Uninitialized, dims) Construct an `N`-dimensional [`Array`](@ref) containing elements of type `T`, initialized with [`nothing`](@ref) entries. Element type `T` must be able -to hold these values, i.e. `Void <: T`. +to hold these values, i.e. `Nothing <: T`. # Examples ```jldoctest -julia> Array{Union{Void, String}}(nothing, 2) -2-element Array{Union{Void, String},1}: +julia> Array{Union{Nothing, String}}(nothing, 2) +2-element Array{Union{Nothing, String},1}: nothing nothing -julia> Array{Union{Void, Int}}(nothing, 2, 3) -2×3 Array{Union{Void, Int64},2}: +julia> Array{Union{Nothing, Int}}(nothing, 2, 3) +2×3 Array{Union{Nothing, Int64},2}: nothing nothing nothing nothing nothing nothing ``` """ -Array{T,N}(::Void, dims) +Array{T,N}(::Nothing, dims) """ diff --git a/base/docs/utils.jl b/base/docs/utils.jl index 0422dae45c404..00ce4c21a223f 100644 --- a/base/docs/utils.jl +++ b/base/docs/utils.jl @@ -377,7 +377,7 @@ completions(name::Symbol) = completions(string(name)) # Docsearch simply returns true or false if an object contains the given needle docsearch(haystack::AbstractString, needle) = !isempty(search(haystack, needle)) docsearch(haystack::Symbol, needle) = docsearch(string(haystack), needle) -docsearch(::Void, needle) = false +docsearch(::Nothing, needle) = false function docsearch(haystack::Array, needle) for elt in haystack docsearch(elt, needle) && return true @@ -420,7 +420,7 @@ element searchable. """ stripmd(@nospecialize x) = string(x) # for random objects interpolated into the docstring stripmd(x::AbstractString) = x # base case -stripmd(x::Void) = " " +stripmd(x::Nothing) = " " stripmd(x::Vector) = string(map(stripmd, x)...) stripmd(x::Markdown.BlockQuote) = "$(stripmd(x.content))" stripmd(x::Markdown.Admonition) = "$(stripmd(x.content))" diff --git a/base/error.jl b/base/error.jl index 9446b2c79b4d6..1edf3bf5ee4ef 100644 --- a/base/error.jl +++ b/base/error.jl @@ -52,17 +52,17 @@ rethrow() = ccall(:jl_rethrow, Bottom, ()) rethrow(e) = ccall(:jl_rethrow_other, Bottom, (Any,), e) struct InterpreterIP - code::Union{CodeInfo,Core.MethodInstance,Void} + code::Union{CodeInfo,Core.MethodInstance,Nothing} stmt::Csize_t end # convert dual arrays (ips, interpreter_frames) to a single array of locations function _reformat_bt(bt, bt2) - ret = Vector{Union{InterpreterIP,Ptr{Void}}}() + ret = Vector{Union{InterpreterIP,Ptr{Cvoid}}}() i, j = 1, 1 while i <= length(bt) - ip = bt[i]::Ptr{Void} - if ip == Ptr{Void}(-1%UInt) + ip = bt[i]::Ptr{Cvoid} + if ip == Ptr{Cvoid}(-1%UInt) # The next one is really a CodeInfo push!(ret, InterpreterIP( bt2[j], @@ -70,7 +70,7 @@ function _reformat_bt(bt, bt2) j += 1 i += 3 else - push!(ret, Ptr{Void}(ip)) + push!(ret, Ptr{Cvoid}(ip)) i += 1 end end @@ -87,7 +87,7 @@ Get the backtrace of the current exception, for use within `catch` blocks. function catch_backtrace() bt = Ref{Any}(nothing) bt2 = Ref{Any}(nothing) - ccall(:jl_get_backtrace, Void, (Ref{Any}, Ref{Any}), bt, bt2) + ccall(:jl_get_backtrace, Cvoid, (Ref{Any}, Ref{Any}), bt, bt2) return _reformat_bt(bt[], bt2[]) end diff --git a/base/essentials.jl b/base/essentials.jl index 297be0e286369..6261c9269a1f5 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -306,7 +306,7 @@ signed(x::UInt) = reinterpret(Int, x) # conversions used by ccall ptr_arg_cconvert(::Type{Ptr{T}}, x) where {T} = cconvert(T, x) ptr_arg_unsafe_convert(::Type{Ptr{T}}, x) where {T} = unsafe_convert(T, x) -ptr_arg_unsafe_convert(::Type{Ptr{Void}}, x) = x +ptr_arg_unsafe_convert(::Type{Ptr{Cvoid}}, x) = x """ cconvert(T,x) @@ -389,14 +389,14 @@ function append_any(xs...) for x in xs for y in x if i > l - ccall(:jl_array_grow_end, Void, (Any, UInt), out, 16) + ccall(:jl_array_grow_end, Cvoid, (Any, UInt), out, 16) l += 16 end Core.arrayset(true, out, y, i) i += 1 end end - ccall(:jl_array_del_end, Void, (Any, UInt), out, l-i+1) + ccall(:jl_array_del_end, Cvoid, (Any, UInt), out, l-i+1) out end @@ -533,7 +533,7 @@ function getindex(v::SimpleVector, i::Int) throw(BoundsError(v,i)) end t = @_gc_preserve_begin v - x = unsafe_load(convert(Ptr{Ptr{Void}},data_pointer_from_objref(v)) + i*sizeof(Ptr)) + x = unsafe_load(convert(Ptr{Ptr{Cvoid}},data_pointer_from_objref(v)) + i*sizeof(Ptr)) x == C_NULL && throw(UndefRefError()) o = unsafe_pointer_to_objref(x) @_gc_preserve_end t @@ -598,7 +598,7 @@ function isassigned end function isassigned(v::SimpleVector, i::Int) @boundscheck 1 <= i <= length(v) || return false t = @_gc_preserve_begin v - x = unsafe_load(convert(Ptr{Ptr{Void}},data_pointer_from_objref(v)) + i*sizeof(Ptr)) + x = unsafe_load(convert(Ptr{Ptr{Cvoid}},data_pointer_from_objref(v)) + i*sizeof(Ptr)) @_gc_preserve_end t return x != C_NULL end diff --git a/base/event.jl b/base/event.jl index 2e791ab2cc0b1..0bf730a358bc0 100644 --- a/base/event.jl +++ b/base/event.jl @@ -99,7 +99,7 @@ global const Workqueue = Task[] function enq_work(t::Task) t.state == :runnable || error("schedule: Task not runnable") - ccall(:uv_stop, Void, (Ptr{Void},), eventloop()) + ccall(:uv_stop, Cvoid, (Ptr{Cvoid},), eventloop()) push!(Workqueue, t) t.state = :queued return t @@ -196,7 +196,7 @@ end function try_yieldto(undo, reftask::Ref{Task}) try - ccall(:jl_switchto, Void, (Any,), reftask) + ccall(:jl_switchto, Cvoid, (Any,), reftask) catch e undo(reftask[]) rethrow(e) @@ -244,7 +244,7 @@ end # probably broken now, but try discarding this switch and keep going # can't throw here, because it's probably not the fault of the caller to wait # and don't want to use print() here, because that may try to incur a task switch - ccall(:jl_safe_printf, Void, (Ptr{UInt8}, Int32...), + ccall(:jl_safe_printf, Cvoid, (Ptr{UInt8}, Int32...), "\nWARNING: Workqueue inconsistency detected: shift!(Workqueue).state != :queued\n") return end @@ -275,9 +275,9 @@ function wait() end if Sys.iswindows() - pause() = ccall(:Sleep, stdcall, Void, (UInt32,), 0xffffffff) + pause() = ccall(:Sleep, stdcall, Cvoid, (UInt32,), 0xffffffff) else - pause() = ccall(:pause, Void, ()) + pause() = ccall(:pause, Cvoid, ()) end @@ -293,7 +293,7 @@ Waiting tasks are woken with an error when the object is closed (by [`close`](@r Use [`isopen`](@ref) to check whether it is still active. """ mutable struct AsyncCondition - handle::Ptr{Void} + handle::Ptr{Cvoid} cond::Condition isopen::Bool @@ -301,8 +301,8 @@ mutable struct AsyncCondition this = new(Libc.malloc(_sizeof_uv_async), Condition(), true) associate_julia_struct(this.handle, this) finalizer(uvfinalize, this) - err = ccall(:uv_async_init, Cint, (Ptr{Void}, Ptr{Void}, Ptr{Void}), - eventloop(), this, uv_jl_asynccb::Ptr{Void}) + err = ccall(:uv_async_init, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), + eventloop(), this, uv_jl_asynccb::Ptr{Cvoid}) if err != 0 #TODO: this codepath is currently not tested Libc.free(this.handle) @@ -351,7 +351,7 @@ the timer is closed (by [`close`](@ref) waiting tasks are woken with an error. U to check whether a timer is still active. """ mutable struct Timer - handle::Ptr{Void} + handle::Ptr{Cvoid} cond::Condition isopen::Bool @@ -360,7 +360,7 @@ mutable struct Timer repeat ≥ 0 || throw(ArgumentError("timer cannot have negative repeat interval of $repeat seconds")) this = new(Libc.malloc(_sizeof_uv_timer), Condition(), true) - err = ccall(:uv_timer_init, Cint, (Ptr{Void}, Ptr{Void}), eventloop(), this) + err = ccall(:uv_timer_init, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), eventloop(), this) if err != 0 #TODO: this codepath is currently not tested Libc.free(this.handle) @@ -371,16 +371,16 @@ mutable struct Timer associate_julia_struct(this.handle, this) finalizer(uvfinalize, this) - ccall(:uv_update_time, Void, (Ptr{Void},), eventloop()) - ccall(:uv_timer_start, Cint, (Ptr{Void}, Ptr{Void}, UInt64, UInt64), - this, uv_jl_timercb::Ptr{Void}, + ccall(:uv_update_time, Cvoid, (Ptr{Cvoid},), eventloop()) + ccall(:uv_timer_start, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, UInt64, UInt64), + this, uv_jl_timercb::Ptr{Cvoid}, UInt64(round(timeout * 1000)) + 1, UInt64(round(repeat * 1000))) return this end end -unsafe_convert(::Type{Ptr{Void}}, t::Timer) = t.handle -unsafe_convert(::Type{Ptr{Void}}, async::AsyncCondition) = async.handle +unsafe_convert(::Type{Ptr{Cvoid}}, t::Timer) = t.handle +unsafe_convert(::Type{Ptr{Cvoid}}, async::AsyncCondition) = async.handle function wait(t::Union{Timer, AsyncCondition}) isopen(t) || throw(EOFError()) @@ -392,8 +392,8 @@ isopen(t::Union{Timer, AsyncCondition}) = t.isopen function close(t::Union{Timer, AsyncCondition}) if t.handle != C_NULL && isopen(t) t.isopen = false - isa(t, Timer) && ccall(:uv_timer_stop, Cint, (Ptr{Void},), t) - ccall(:jl_close_uv, Void, (Ptr{Void},), t) + isa(t, Timer) && ccall(:uv_timer_stop, Cint, (Ptr{Cvoid},), t) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t) end nothing end @@ -414,15 +414,15 @@ function _uv_hook_close(t::Union{Timer, AsyncCondition}) nothing end -function uv_asynccb(handle::Ptr{Void}) +function uv_asynccb(handle::Ptr{Cvoid}) async = @handle_as handle AsyncCondition notify(async.cond) nothing end -function uv_timercb(handle::Ptr{Void}) +function uv_timercb(handle::Ptr{Cvoid}) t = @handle_as handle Timer - if ccall(:uv_timer_get_repeat, UInt64, (Ptr{Void},), t) == 0 + if ccall(:uv_timer_get_repeat, UInt64, (Ptr{Cvoid},), t) == 0 # timer is stopped now close(t) end diff --git a/base/fastmath.jl b/base/fastmath.jl index f152aaa1e342b..e8ffc6a5c7d47 100644 --- a/base/fastmath.jl +++ b/base/fastmath.jl @@ -305,14 +305,14 @@ acos_fast(x::FloatTypes) = acos(x) @inline function sincos_fast(v::Float64) s = Ref{Cdouble}() c = Ref{Cdouble}() - ccall((:sincos, libm), Void, (Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), v, s, c) + ccall((:sincos, libm), Cvoid, (Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), v, s, c) return (s[], c[]) end @inline function sincos_fast(v::Float32) s = Ref{Cfloat}() c = Ref{Cfloat}() - ccall((:sincosf, libm), Void, (Cfloat, Ptr{Cfloat}, Ptr{Cfloat}), v, s, c) + ccall((:sincosf, libm), Cvoid, (Cfloat, Ptr{Cfloat}, Ptr{Cfloat}), v, s, c) return (s[], c[]) end diff --git a/base/file.jl b/base/file.jl index 7678cabf0d4ef..846da9b8eddae 100644 --- a/base/file.jl +++ b/base/file.jl @@ -410,7 +410,7 @@ function readdir(path::AbstractString) uv_readdir_req = zeros(UInt8, ccall(:jl_sizeof_uv_fs_t, Int32, ())) # defined in sys.c, to call uv_fs_readdir, which sets errno on error. - err = ccall(:uv_fs_scandir, Int32, (Ptr{Void}, Ptr{UInt8}, Cstring, Cint, Ptr{Void}), + err = ccall(:uv_fs_scandir, Int32, (Ptr{Cvoid}, Ptr{UInt8}, Cstring, Cint, Ptr{Cvoid}), eventloop(), uv_readdir_req, path, 0, C_NULL) err < 0 && throw(SystemError("unable to read directory $path", -err)) #uv_error("unable to read directory $path", err) @@ -418,12 +418,12 @@ function readdir(path::AbstractString) # iterate the listing into entries entries = String[] ent = Ref{uv_dirent_t}() - while Base.UV_EOF != ccall(:uv_fs_scandir_next, Cint, (Ptr{Void}, Ptr{uv_dirent_t}), uv_readdir_req, ent) + while Base.UV_EOF != ccall(:uv_fs_scandir_next, Cint, (Ptr{Cvoid}, Ptr{uv_dirent_t}), uv_readdir_req, ent) push!(entries, unsafe_string(ent[].name)) end # Clean up the request string - ccall(:jl_uv_fs_req_cleanup, Void, (Ptr{UInt8},), uv_readdir_req) + ccall(:jl_uv_fs_req_cleanup, Cvoid, (Ptr{UInt8},), uv_readdir_req) return entries end @@ -580,15 +580,15 @@ function readlink(path::AbstractString) req = Libc.malloc(_sizeof_uv_fs) try ret = ccall(:uv_fs_readlink, Int32, - (Ptr{Void}, Ptr{Void}, Cstring, Ptr{Void}), + (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Ptr{Cvoid}), eventloop(), req, path, C_NULL) if ret < 0 - ccall(:uv_fs_req_cleanup, Void, (Ptr{Void},), req) + ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req) uv_error("readlink", ret) assert(false) end - tgt = unsafe_string(ccall(:jl_uv_fs_t_ptr, Ptr{Cchar}, (Ptr{Void},), req)) - ccall(:uv_fs_req_cleanup, Void, (Ptr{Void},), req) + tgt = unsafe_string(ccall(:jl_uv_fs_t_ptr, Ptr{Cchar}, (Ptr{Cvoid},), req)) + ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req) return tgt finally Libc.free(req) diff --git a/base/filesystem.jl b/base/filesystem.jl index 6268d1d420752..001a8fcb210bb 100644 --- a/base/filesystem.jl +++ b/base/filesystem.jl @@ -64,7 +64,7 @@ mutable struct File <: AbstractFile end # Not actually a pointer, but that's how we pass it through the C API so it's fine -uvhandle(file::File) = convert(Ptr{Void}, Base.cconvert(Cint, file.handle) % UInt) +uvhandle(file::File) = convert(Ptr{Cvoid}, Base.cconvert(Cint, file.handle) % UInt) uvtype(::File) = Base.UV_RAW_FD # Filesystem.open, not Base.open @@ -73,10 +73,10 @@ function open(path::AbstractString, flags::Integer, mode::Integer=0) local handle try ret = ccall(:uv_fs_open, Int32, - (Ptr{Void}, Ptr{Void}, Cstring, Int32, Int32, Ptr{Void}), + (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Int32, Int32, Ptr{Cvoid}), eventloop(), req, path, flags, mode, C_NULL) - handle = ccall(:jl_uv_fs_result, Int32, (Ptr{Void},), req) - ccall(:uv_fs_req_cleanup, Void, (Ptr{Void},), req) + handle = ccall(:jl_uv_fs_result, Int32, (Ptr{Cvoid},), req) + ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req) uv_error("open", ret) finally # conversion to Cstring could cause an exception Libc.free(req) @@ -124,7 +124,7 @@ function truncate(f::File, n::Integer) check_open(f) req = Libc.malloc(_sizeof_uv_fs) err = ccall(:uv_fs_ftruncate, Int32, - (Ptr{Void}, Ptr{Void}, Int32, Int64, Ptr{Void}), + (Ptr{Cvoid}, Ptr{Cvoid}, Int32, Int64, Ptr{Cvoid}), eventloop(), req, f.handle, n, C_NULL) Libc.free(req) uv_error("ftruncate", err) @@ -135,7 +135,7 @@ function futime(f::File, atime::Float64, mtime::Float64) check_open(f) req = Libc.malloc(_sizeof_uv_fs) err = ccall(:uv_fs_futime, Int32, - (Ptr{Void}, Ptr{Void}, Int32, Float64, Float64, Ptr{Void}), + (Ptr{Cvoid}, Ptr{Cvoid}, Int32, Float64, Float64, Ptr{Cvoid}), eventloop(), req, f.handle, atime, mtime, C_NULL) Libc.free(req) uv_error("futime", err) @@ -171,7 +171,7 @@ end function unsafe_read(f::File, p::Ptr{UInt8}, nel::UInt) check_open(f) - ret = ccall(:jl_fs_read, Int32, (Int32, Ptr{Void}, Csize_t), + ret = ccall(:jl_fs_read, Int32, (Int32, Ptr{Cvoid}, Csize_t), f.handle, p, nel) uv_error("read",ret) ret == nel || throw(EOFError()) @@ -187,7 +187,7 @@ function readbytes!(f::File, b::Array{UInt8}, nb=length(b)) if length(b) < nr resize!(b, nr) end - ret = ccall(:jl_fs_read, Int32, (Int32, Ptr{Void}, Csize_t), + ret = ccall(:jl_fs_read, Int32, (Int32, Ptr{Cvoid}, Csize_t), f.handle, b, nr) uv_error("read",ret) return ret diff --git a/base/gcutils.jl b/base/gcutils.jl index 0ff53bceb6894..cacce1119c1d9 100644 --- a/base/gcutils.jl +++ b/base/gcutils.jl @@ -15,17 +15,17 @@ function finalizer(@nospecialize(f), @nospecialize(o)) if isimmutable(o) error("objects of type ", typeof(o), " cannot be finalized") end - ccall(:jl_gc_add_finalizer_th, Void, (Ptr{Void}, Any, Any), + ccall(:jl_gc_add_finalizer_th, Cvoid, (Ptr{Cvoid}, Any, Any), Core.getptls(), o, f) return o end -function finalizer(f::Ptr{Void}, o::T) where T +function finalizer(f::Ptr{Cvoid}, o::T) where T @_inline_meta if isimmutable(T) error("objects of type ", T, " cannot be finalized") end - ccall(:jl_gc_add_ptr_finalizer, Void, (Ptr{Void}, Any, Ptr{Void}), + ccall(:jl_gc_add_ptr_finalizer, Cvoid, (Ptr{Cvoid}, Any, Ptr{Cvoid}), Core.getptls(), o, f) return o end @@ -35,7 +35,7 @@ end Immediately run finalizers registered for object `x`. """ -finalize(@nospecialize(o)) = ccall(:jl_finalize_th, Void, (Ptr{Void}, Any,), +finalize(@nospecialize(o)) = ccall(:jl_finalize_th, Cvoid, (Ptr{Cvoid}, Any,), Core.getptls(), o) """ @@ -43,7 +43,7 @@ finalize(@nospecialize(o)) = ccall(:jl_finalize_th, Void, (Ptr{Void}, Any,), Perform garbage collection. This should not generally be used. """ -gc(full::Bool=true) = ccall(:jl_gc_collect, Void, (Int32,), full) +gc(full::Bool=true) = ccall(:jl_gc_collect, Cvoid, (Int32,), full) """ gc_enable(on::Bool) diff --git a/base/gmp.jl b/base/gmp.jl index c64b0f1b2a73c..34895f01d6b2d 100644 --- a/base/gmp.jl +++ b/base/gmp.jl @@ -89,8 +89,8 @@ function __init__() "Please rebuild Julia.") end - ccall((:__gmp_set_memory_functions, :libgmp), Void, - (Ptr{Void},Ptr{Void},Ptr{Void}), + ccall((:__gmp_set_memory_functions, :libgmp), Cvoid, + (Ptr{Cvoid},Ptr{Cvoid},Ptr{Cvoid}), cglobal(:jl_gc_counted_malloc), cglobal(:jl_gc_counted_realloc_with_old_size), cglobal(:jl_gc_counted_free_with_size)) @@ -117,10 +117,10 @@ const bitcnt_t = Culong gmpz(op::Symbol) = (Symbol(:__gmpz_, op), :libgmp) -init!(x::BigInt) = (ccall((:__gmpz_init, :libgmp), Void, (mpz_t,), x); x) -init2!(x::BigInt, a) = (ccall((:__gmpz_init2, :libgmp), Void, (mpz_t, bitcnt_t), x, a); x) +init!(x::BigInt) = (ccall((:__gmpz_init, :libgmp), Cvoid, (mpz_t,), x); x) +init2!(x::BigInt, a) = (ccall((:__gmpz_init2, :libgmp), Cvoid, (mpz_t, bitcnt_t), x, a); x) -realloc2!(x, a) = (ccall((:__gmpz_realloc2, :libgmp), Void, (mpz_t, bitcnt_t), x, a); x) +realloc2!(x, a) = (ccall((:__gmpz_realloc2, :libgmp), Cvoid, (mpz_t, bitcnt_t), x, a); x) realloc2(a) = realloc2!(BigInt(), a) sizeinbase(a::BigInt, b) = Int(ccall((:__gmpz_sizeinbase, :libgmp), Csize_t, (mpz_t, Cint), a, b)) @@ -128,7 +128,7 @@ sizeinbase(a::BigInt, b) = Int(ccall((:__gmpz_sizeinbase, :libgmp), Csize_t, (mp for op in (:add, :sub, :mul, :fdiv_q, :tdiv_q, :fdiv_r, :tdiv_r, :gcd, :lcm, :and, :ior, :xor) op! = Symbol(op, :!) @eval begin - $op!(x::BigInt, a::BigInt, b::BigInt) = (ccall($(gmpz(op)), Void, (mpz_t, mpz_t, mpz_t), x, a, b); x) + $op!(x::BigInt, a::BigInt, b::BigInt) = (ccall($(gmpz(op)), Cvoid, (mpz_t, mpz_t, mpz_t), x, a, b); x) $op(a::BigInt, b::BigInt) = $op!(BigInt(), a, b) $op!(x::BigInt, b::BigInt) = $op!(x, x, b) end @@ -142,27 +142,27 @@ invert!(x::BigInt, b::BigInt) = invert!(x, x, b) for op in (:add_ui, :sub_ui, :mul_ui, :mul_2exp, :fdiv_q_2exp, :pow_ui, :bin_ui) op! = Symbol(op, :!) @eval begin - $op!(x::BigInt, a::BigInt, b) = (ccall($(gmpz(op)), Void, (mpz_t, mpz_t, Culong), x, a, b); x) + $op!(x::BigInt, a::BigInt, b) = (ccall($(gmpz(op)), Cvoid, (mpz_t, mpz_t, Culong), x, a, b); x) $op(a::BigInt, b) = $op!(BigInt(), a, b) $op!(x::BigInt, b) = $op!(x, x, b) end end -ui_sub!(x::BigInt, a, b::BigInt) = (ccall((:__gmpz_ui_sub, :libgmp), Void, (mpz_t, Culong, mpz_t), x, a, b); x) +ui_sub!(x::BigInt, a, b::BigInt) = (ccall((:__gmpz_ui_sub, :libgmp), Cvoid, (mpz_t, Culong, mpz_t), x, a, b); x) ui_sub(a, b::BigInt) = ui_sub!(BigInt(), a, b) for op in (:scan1, :scan0) @eval $op(a::BigInt, b) = Int(ccall($(gmpz(op)), Culong, (mpz_t, Culong), a, b)) end -mul_si!(x::BigInt, a::BigInt, b) = (ccall((:__gmpz_mul_si, :libgmp), Void, (mpz_t, mpz_t, Clong), x, a, b); x) +mul_si!(x::BigInt, a::BigInt, b) = (ccall((:__gmpz_mul_si, :libgmp), Cvoid, (mpz_t, mpz_t, Clong), x, a, b); x) mul_si(a::BigInt, b) = mul_si!(BigInt(), a, b) mul_si!(x::BigInt, b) = mul_si!(x, x, b) for op in (:neg, :com, :sqrt, :set) op! = Symbol(op, :!) @eval begin - $op!(x::BigInt, a::BigInt) = (ccall($(gmpz(op)), Void, (mpz_t, mpz_t), x, a); x) + $op!(x::BigInt, a::BigInt) = (ccall($(gmpz(op)), Cvoid, (mpz_t, mpz_t), x, a); x) $op(a::BigInt) = $op!(BigInt(), a) end op == :set && continue # MPZ.set!(x) would make no sense @@ -172,7 +172,7 @@ end for (op, T) in ((:fac_ui, Culong), (:set_ui, Culong), (:set_si, Clong), (:set_d, Cdouble)) op! = Symbol(op, :!) @eval begin - $op!(x::BigInt, a) = (ccall($(gmpz(op)), Void, (mpz_t, $T), x, a); x) + $op!(x::BigInt, a) = (ccall($(gmpz(op)), Cvoid, (mpz_t, $T), x, a); x) $op(a) = $op!(BigInt(), a) end end @@ -183,18 +183,18 @@ mpn_popcount(d::Ptr{Limb}, s::Integer) = Int(ccall((:__gmpn_popcount, :libgmp), mpn_popcount(a::BigInt) = mpn_popcount(a.d, abs(a.size)) function tdiv_qr!(x::BigInt, y::BigInt, a::BigInt, b::BigInt) - ccall((:__gmpz_tdiv_qr, :libgmp), Void, (mpz_t, mpz_t, mpz_t, mpz_t), x, y, a, b) + ccall((:__gmpz_tdiv_qr, :libgmp), Cvoid, (mpz_t, mpz_t, mpz_t, mpz_t), x, y, a, b) x, y end tdiv_qr(a::BigInt, b::BigInt) = tdiv_qr!(BigInt(), BigInt(), a, b) powm!(x::BigInt, a::BigInt, b::BigInt, c::BigInt) = - (ccall((:__gmpz_powm, :libgmp), Void, (mpz_t, mpz_t, mpz_t, mpz_t), x, a, b, c); x) + (ccall((:__gmpz_powm, :libgmp), Cvoid, (mpz_t, mpz_t, mpz_t, mpz_t), x, a, b, c); x) powm(a::BigInt, b::BigInt, c::BigInt) = powm!(BigInt(), a, b, c) powm!(x::BigInt, b::BigInt, c::BigInt) = powm!(x, x, b, c) function gcdext!(x::BigInt, y::BigInt, z::BigInt, a::BigInt, b::BigInt) - ccall((:__gmpz_gcdext, :libgmp), Void, (mpz_t, mpz_t, mpz_t, mpz_t, mpz_t), x, y, z, a, b) + ccall((:__gmpz_gcdext, :libgmp), Cvoid, (mpz_t, mpz_t, mpz_t, mpz_t, mpz_t), x, y, z, a, b) x, y, z end gcdext(a::BigInt, b::BigInt) = gcdext!(BigInt(), BigInt(), BigInt(), a, b) @@ -212,11 +212,11 @@ set_str!(x::BigInt, a, b) = Int(ccall((:__gmpz_set_str, :libgmp), Cint, (mpz_t, get_d(a::BigInt) = ccall((:__gmpz_get_d, :libgmp), Cdouble, (mpz_t,), a) limbs_write!(x::BigInt, a) = ccall((:__gmpz_limbs_write, :libgmp), Ptr{Limb}, (mpz_t, Clong), x, a) -limbs_finish!(x::BigInt, a) = ccall((:__gmpz_limbs_finish, :libgmp), Void, (mpz_t, Clong), x, a) -import!(x::BigInt, a, b, c, d, e, f) = ccall((:__gmpz_import, :libgmp), Void, - (mpz_t, Csize_t, Cint, Csize_t, Cint, Csize_t, Ptr{Void}), x, a, b, c, d, e, f) +limbs_finish!(x::BigInt, a) = ccall((:__gmpz_limbs_finish, :libgmp), Cvoid, (mpz_t, Clong), x, a) +import!(x::BigInt, a, b, c, d, e, f) = ccall((:__gmpz_import, :libgmp), Cvoid, + (mpz_t, Csize_t, Cint, Csize_t, Cint, Csize_t, Ptr{Cvoid}), x, a, b, c, d, e, f) -setbit!(x, a) = (ccall((:__gmpz_setbit, :libgmp), Void, (mpz_t, bitcnt_t), x, a); x) +setbit!(x, a) = (ccall((:__gmpz_setbit, :libgmp), Cvoid, (mpz_t, bitcnt_t), x, a); x) tstbit(a::BigInt, b) = ccall((:__gmpz_tstbit, :libgmp), Cint, (mpz_t, bitcnt_t), a, b) % Bool end # module MPZ diff --git a/base/hashing2.jl b/base/hashing2.jl index b4c548b2ccab1..55d67ca9caef9 100644 --- a/base/hashing2.jl +++ b/base/hashing2.jl @@ -136,8 +136,8 @@ function decompose(x::BigFloat)::Tuple{BigInt, Int, Int} s = BigInt() s.size = cld(x.prec, 8*sizeof(GMP.Limb)) # limbs b = s.size * sizeof(GMP.Limb) # bytes - ccall((:__gmpz_realloc2, :libgmp), Void, (Ref{BigInt}, Culong), s, 8b) # bits - ccall(:memcpy, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Csize_t), s.d, x.d, b) # bytes + ccall((:__gmpz_realloc2, :libgmp), Cvoid, (Ref{BigInt}, Culong), s, 8b) # bits + ccall(:memcpy, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), s.d, x.d, b) # bytes s, x.exp - 8b, x.sign end diff --git a/base/inference.jl b/base/inference.jl index 3c2907c10fdbb..f3925014d4808 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -15,7 +15,7 @@ mutable struct InferenceResult linfo::MethodInstance args::Vector{Any} result # ::Type, or InferenceState if WIP - src::Union{CodeInfo, Void} # if inferred copy is available + src::Union{CodeInfo, Nothing} # if inferred copy is available function InferenceResult(linfo::MethodInstance) if isdefined(linfo, :inferred_const) result = Const(linfo.inferred_const) @@ -235,7 +235,7 @@ mutable struct InferenceState backedges::Vector{Tuple{InferenceState, LineNum}} # call-graph backedges connecting from callee to caller callers_in_cycle::Vector{InferenceState} - parent::Union{Void, InferenceState} + parent::Union{Nothing, InferenceState} const_api::Bool const_ret::Bool @@ -734,7 +734,7 @@ add_tfunc(checked_umul_int, 2, 2, chk_tfunc, 10) ## other, misc intrinsics ## add_tfunc(Core.Intrinsics.llvmcall, 3, IInf, (@nospecialize(fptr), @nospecialize(rt), @nospecialize(at), a...) -> instanceof_tfunc(rt)[1], 10) -cglobal_tfunc(@nospecialize(fptr)) = Ptr{Void} +cglobal_tfunc(@nospecialize(fptr)) = Ptr{Cvoid} cglobal_tfunc(@nospecialize(fptr), @nospecialize(t)) = (isType(t) ? Ptr{t.parameters[1]} : Ptr) cglobal_tfunc(@nospecialize(fptr), t::Const) = (isa(t.val, Type) ? Ptr{t.val} : Ptr) add_tfunc(Core.Intrinsics.cglobal, 1, 2, cglobal_tfunc, 5) @@ -1716,7 +1716,7 @@ function tuple_tfunc(@nospecialize(argtype)) end function builtin_tfunction(@nospecialize(f), argtypes::Array{Any,1}, - sv::Union{InferenceState,Void}, params::InferenceParams = sv.params) + sv::Union{InferenceState,Nothing}, params::InferenceParams = sv.params) isva = !isempty(argtypes) && isvarargtype(argtypes[end]) if f === tuple for a in argtypes @@ -2707,7 +2707,7 @@ function abstract_eval(@nospecialize(e), vtypes::VarTable, sv::InferenceState) spsig = sv.linfo.def.sig if isa(spsig, UnionAll) if !isempty(sv.linfo.sparam_vals) - env = data_pointer_from_objref(sv.linfo.sparam_vals) + sizeof(Ptr{Void}) + env = data_pointer_from_objref(sv.linfo.sparam_vals) + sizeof(Ptr{Cvoid}) rt = ccall(:jl_instantiate_type_in_env, Any, (Any, Any, Ptr{Any}), e.args[2], spsig, env) else rt = rewrap_unionall(e.args[2], spsig) @@ -2756,7 +2756,7 @@ function abstract_eval(@nospecialize(e), vtypes::VarTable, sv::InferenceState) end end elseif e.head === :method - t = (length(e.args) == 1) ? Any : Void + t = (length(e.args) == 1) ? Any : Nothing elseif e.head === :copyast t = abstract_eval(e.args[1], vtypes, sv) if t isa Const && t.val isa Expr @@ -3203,12 +3203,12 @@ function finalize_backedges(frame::InferenceState) while i <= length(edges) to = edges[i] if isa(to, MethodInstance) - ccall(:jl_method_instance_add_backedge, Void, (Any, Any), to, caller) + ccall(:jl_method_instance_add_backedge, Cvoid, (Any, Any), to, caller) i += 1 else typeassert(to, MethodTable) typ = edges[i + 1] - ccall(:jl_method_table_add_backedge, Void, (Any, Any, Any), to, typ, caller) + ccall(:jl_method_table_add_backedge, Cvoid, (Any, Any, Any), to, typ, caller) i += 2 end end @@ -3377,7 +3377,7 @@ end function typeinf_code(linfo::MethodInstance, optimize::Bool, cached::Bool, params::InferenceParams) for i = 1:2 # test-and-lock-and-test - i == 2 && ccall(:jl_typeinf_begin, Void, ()) + i == 2 && ccall(:jl_typeinf_begin, Cvoid, ()) if cached && isdefined(linfo, :inferred) # see if this code already exists in the cache # staged functions make this hard since they have two "inferred" conditions, @@ -3395,11 +3395,11 @@ function typeinf_code(linfo::MethodInstance, optimize::Bool, cached::Bool, tree.inferred = true tree.pure = true tree.inlineable = true - i == 2 && ccall(:jl_typeinf_end, Void, ()) + i == 2 && ccall(:jl_typeinf_end, Cvoid, ()) return svec(linfo, tree, linfo.rettype) elseif isa(inf, CodeInfo) if inf.inferred - i == 2 && ccall(:jl_typeinf_end, Void, ()) + i == 2 && ccall(:jl_typeinf_end, Cvoid, ()) return svec(linfo, inf, linfo.rettype) end end @@ -3407,7 +3407,7 @@ function typeinf_code(linfo::MethodInstance, optimize::Bool, cached::Bool, end end frame = typeinf_frame(linfo, optimize, cached, params) - ccall(:jl_typeinf_end, Void, ()) + ccall(:jl_typeinf_end, Cvoid, ()) frame === nothing && return svec(nothing, nothing, Any) frame = frame::InferenceState frame.inferred || return svec(nothing, nothing, Any) @@ -3425,20 +3425,20 @@ function typeinf_type(method::Method, @nospecialize(atypes), sparams::SimpleVect code === nothing && return nothing code = code::MethodInstance for i = 1:2 # test-and-lock-and-test - i == 2 && ccall(:jl_typeinf_begin, Void, ()) + i == 2 && ccall(:jl_typeinf_begin, Cvoid, ()) if cached && isdefined(code, :inferred) # see if this rettype already exists in the cache # staged functions make this hard since they have two "inferred" conditions, # so need to check whether the code itself is also inferred inf = code.inferred if !isa(inf, CodeInfo) || (inf::CodeInfo).inferred - i == 2 && ccall(:jl_typeinf_end, Void, ()) + i == 2 && ccall(:jl_typeinf_end, Cvoid, ()) return code.rettype end end end frame = typeinf_frame(code, cached, cached, params) - ccall(:jl_typeinf_end, Void, ()) + ccall(:jl_typeinf_end, Cvoid, ()) frame === nothing && return nothing frame = frame::InferenceState frame.inferred || return nothing @@ -3451,12 +3451,12 @@ function typeinf_ext(linfo::MethodInstance, world::UInt) return typeinf_code(linfo, true, true, InferenceParams(world)) else # toplevel lambda - infer directly - ccall(:jl_typeinf_begin, Void, ()) + ccall(:jl_typeinf_begin, Cvoid, ()) result = InferenceResult(linfo) frame = InferenceState(result, linfo.inferred::CodeInfo, true, true, InferenceParams(world)) typeinf(frame) - ccall(:jl_typeinf_end, Void, ()) + ccall(:jl_typeinf_end, Cvoid, ()) @assert frame.inferred # TODO: deal with this better @assert frame.linfo === linfo linfo.rettype = widenconst(frame.bestguess) @@ -4782,7 +4782,7 @@ function inlineable(@nospecialize(f), @nospecialize(ft), e::Expr, atypes::Vector end # see if the method has been previously inferred (and cached) - linfo = code_for_method(method, metharg, methsp, sv.params.world, true) # Union{Void, MethodInstance} + linfo = code_for_method(method, metharg, methsp, sv.params.world, true) # Union{Nothing, MethodInstance} isa(linfo, MethodInstance) || return invoke_NF(argexprs0, e.typ, atypes0, sv, atype_unlimited, invoke_data) linfo = linfo::MethodInstance @@ -4806,7 +4806,7 @@ function inlineable(@nospecialize(f), @nospecialize(ft), e::Expr, atypes::Vector end end if haveconst - inf_result = cache_lookup(linfo, atypes, sv.params.cache) # Union{Void, InferenceResult} + inf_result = cache_lookup(linfo, atypes, sv.params.cache) # Union{Nothing, InferenceResult} else inf_result = nothing end @@ -5755,7 +5755,7 @@ end function get_undef_flag_slot(src::CodeInfo, flagslots, id) flag_id = flagslots[id] flag_id != 0 && return SlotNumber(flag_id) - slot = add_slot!(src, Void, src.slotflags[id] & Slot_AssignedOnce != 0, src.slotnames[id]) + slot = add_slot!(src, Nothing, src.slotflags[id] & Slot_AssignedOnce != 0, src.slotnames[id]) flag_id = slot_id(slot) src.slotflags[flag_id] |= Slot_StaticUndef | Slot_UsedUndef flagslots[id] = flag_id @@ -5960,7 +5960,7 @@ end isassigned(infomap::ValueInfoMap, var) = isassigned(get_info_entry(infomap, var)...) function delete!(infomap::ValueInfoMap, var) infos, idx = get_info_entry(infomap, var) - ccall(:jl_arrayunset, Void, (Any, Csize_t), infos, (idx - 1) % UInt) + ccall(:jl_arrayunset, Cvoid, (Any, Csize_t), infos, (idx - 1) % UInt) end function getindex(infomap::ValueInfoMap, var) infos, idx = get_info_entry(infomap, var) diff --git a/base/initdefs.jl b/base/initdefs.jl index 5939ca8bdb36d..388b6fc919540 100644 --- a/base/initdefs.jl +++ b/base/initdefs.jl @@ -26,7 +26,7 @@ program completed successfully (see also [`quit`](@ref)). In an interactive sess `exit()` can be called with the keyboard shorcut `^D`. """ -exit(n) = ccall(:jl_exit, Void, (Int32,), n) +exit(n) = ccall(:jl_exit, Cvoid, (Int32,), n) exit() = exit(0) """ diff --git a/base/interactiveutil.jl b/base/interactiveutil.jl index 07d26039f0085..6e2100e5df34e 100644 --- a/base/interactiveutil.jl +++ b/base/interactiveutil.jl @@ -67,7 +67,7 @@ function edit(path::AbstractString, line::Integer=0) if Sys.iswindows() && name == "open" @static Sys.iswindows() && # don't emit this ccall on other platforms systemerror(:edit, ccall((:ShellExecuteW, "shell32"), stdcall, Int, - (Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint), + (Ptr{Cvoid}, Cwstring, Cwstring, Ptr{Cvoid}, Ptr{Cvoid}, Cint), C_NULL, "open", path, C_NULL, C_NULL, 10) ≤ 32) elseif background spawn(pipeline(cmd, stderr=STDERR)) @@ -185,7 +185,7 @@ elseif Sys.iswindows() if containsnul(x) throw(ArgumentError("Windows clipboard strings cannot contain NUL character")) end - systemerror(:OpenClipboard, 0==ccall((:OpenClipboard, "user32"), stdcall, Cint, (Ptr{Void},), C_NULL)) + systemerror(:OpenClipboard, 0==ccall((:OpenClipboard, "user32"), stdcall, Cint, (Ptr{Cvoid},), C_NULL)) systemerror(:EmptyClipboard, 0==ccall((:EmptyClipboard, "user32"), stdcall, Cint, ())) x_u16 = cwstring(x) # copy data to locked, allocated space @@ -194,14 +194,14 @@ elseif Sys.iswindows() plock = ccall((:GlobalLock, "kernel32"), stdcall, Ptr{UInt16}, (Ptr{UInt16},), p) systemerror(:GlobalLock, plock==C_NULL) ccall(:memcpy, Ptr{UInt16}, (Ptr{UInt16},Ptr{UInt16},Int), plock, x_u16, sizeof(x_u16)) - systemerror(:GlobalUnlock, 0==ccall((:GlobalUnlock, "kernel32"), stdcall, Cint, (Ptr{Void},), plock)) + systemerror(:GlobalUnlock, 0==ccall((:GlobalUnlock, "kernel32"), stdcall, Cint, (Ptr{Cvoid},), plock)) pdata = ccall((:SetClipboardData, "user32"), stdcall, Ptr{UInt16}, (UInt32, Ptr{UInt16}), 13, p) systemerror(:SetClipboardData, pdata!=p) - ccall((:CloseClipboard, "user32"), stdcall, Void, ()) + ccall((:CloseClipboard, "user32"), stdcall, Cvoid, ()) end clipboard(x) = clipboard(sprint(print, x)::String) function clipboard() - systemerror(:OpenClipboard, 0==ccall((:OpenClipboard, "user32"), stdcall, Cint, (Ptr{Void},), C_NULL)) + systemerror(:OpenClipboard, 0==ccall((:OpenClipboard, "user32"), stdcall, Cint, (Ptr{Cvoid},), C_NULL)) pdata = ccall((:GetClipboardData, "user32"), stdcall, Ptr{UInt16}, (UInt32,), 13) systemerror(:SetClipboardData, pdata==C_NULL) systemerror(:CloseClipboard, 0==ccall((:CloseClipboard, "user32"), stdcall, Cint, ())) @@ -635,7 +635,7 @@ downloadcmd = nothing if Sys.iswindows() function download(url::AbstractString, filename::AbstractString) res = ccall((:URLDownloadToFileW,:urlmon),stdcall,Cuint, - (Ptr{Void},Cwstring,Cwstring,Cuint,Ptr{Void}),C_NULL,url,filename,0,C_NULL) + (Ptr{Cvoid},Cwstring,Cwstring,Cuint,Ptr{Cvoid}),C_NULL,url,filename,0,C_NULL) if res != 0 error("automatic download failed (error: $res): $url") end @@ -700,7 +700,7 @@ global RNG in the context where the tests are run; otherwise the seed is chosen """ function runtests(tests = ["all"], numcores = ceil(Int, Sys.CPU_CORES / 2); exit_on_error=false, - seed::Union{BitInteger,Void}=nothing) + seed::Union{BitInteger,Nothing}=nothing) if isa(tests,AbstractString) tests = split(tests) end diff --git a/base/io.jl b/base/io.jl index 6f3424c7f0bf2..ae71210cb1336 100644 --- a/base/io.jl +++ b/base/io.jl @@ -834,12 +834,12 @@ function eachline(filename::AbstractString; chomp::Bool=true) end start(itr::EachLine) = nothing -function done(itr::EachLine, ::Void) +function done(itr::EachLine, ::Nothing) eof(itr.stream) || return false itr.ondone() true end -next(itr::EachLine, ::Void) = (readline(itr.stream, chomp=itr.chomp), nothing) +next(itr::EachLine, ::Nothing) = (readline(itr.stream, chomp=itr.chomp), nothing) eltype(::Type{EachLine}) = String diff --git a/base/iostream.jl b/base/iostream.jl index 347b86ca10f34..902e55a6277b8 100644 --- a/base/iostream.jl +++ b/base/iostream.jl @@ -5,7 +5,7 @@ const sizeof_ios_t = Int(ccall(:jl_sizeof_ios_t, Cint, ())) mutable struct IOStream <: IO - handle::Ptr{Void} + handle::Ptr{Cvoid} ios::Array{UInt8,1} name::AbstractString mark::Int64 @@ -24,7 +24,7 @@ function IOStream(name::AbstractString, finalize::Bool) end IOStream(name::AbstractString) = IOStream(name, true) -unsafe_convert(T::Type{Ptr{Void}}, s::IOStream) = convert(T, pointer(s.ios)) +unsafe_convert(T::Type{Ptr{Cvoid}}, s::IOStream) = convert(T, pointer(s.ios)) show(io::IO, s::IOStream) = print(io, "IOStream(", s.name, ")") """ @@ -33,19 +33,19 @@ show(io::IO, s::IOStream) = print(io, "IOStream(", s.name, ")") Return the file descriptor backing the stream or file. Note that this function only applies to synchronous `File`'s and `IOStream`'s not to any of the asynchronous streams. """ -fd(s::IOStream) = Int(ccall(:jl_ios_fd, Clong, (Ptr{Void},), s.ios)) +fd(s::IOStream) = Int(ccall(:jl_ios_fd, Clong, (Ptr{Cvoid},), s.ios)) stat(s::IOStream) = stat(fd(s)) -close(s::IOStream) = ccall(:ios_close, Void, (Ptr{Void},), s.ios) -isopen(s::IOStream) = ccall(:ios_isopen, Cint, (Ptr{Void},), s.ios)!=0 +close(s::IOStream) = ccall(:ios_close, Cvoid, (Ptr{Cvoid},), s.ios) +isopen(s::IOStream) = ccall(:ios_isopen, Cint, (Ptr{Cvoid},), s.ios)!=0 function flush(s::IOStream) sigatomic_begin() - bad = ccall(:ios_flush, Cint, (Ptr{Void},), s.ios) != 0 + bad = ccall(:ios_flush, Cint, (Ptr{Cvoid},), s.ios) != 0 sigatomic_end() systemerror("flush", bad) end -iswritable(s::IOStream) = ccall(:ios_get_writable, Cint, (Ptr{Void},), s.ios)!=0 -isreadable(s::IOStream) = ccall(:ios_get_readable, Cint, (Ptr{Void},), s.ios)!=0 +iswritable(s::IOStream) = ccall(:ios_get_writable, Cint, (Ptr{Cvoid},), s.ios)!=0 +isreadable(s::IOStream) = ccall(:ios_get_readable, Cint, (Ptr{Cvoid},), s.ios)!=0 """ truncate(file,n) @@ -77,7 +77,7 @@ julia> String(take!(io)) ``` """ function truncate(s::IOStream, n::Integer) - systemerror("truncate", ccall(:ios_trunc, Cint, (Ptr{Void}, Csize_t), s.ios, n) != 0) + systemerror("truncate", ccall(:ios_trunc, Cint, (Ptr{Cvoid}, Csize_t), s.ios, n) != 0) return s end @@ -97,7 +97,7 @@ julia> read(io, Char) ``` """ function seek(s::IOStream, n::Integer) - ret = ccall(:ios_seek, Int64, (Ptr{Void}, Int64), s.ios, n) + ret = ccall(:ios_seek, Int64, (Ptr{Cvoid}, Int64), s.ios, n) systemerror("seek", ret == -1) ret < -1 && error("seek failed") return s @@ -131,7 +131,7 @@ seekstart(s::IO) = seek(s,0) Seek a stream to its end. """ function seekend(s::IOStream) - systemerror("seekend", ccall(:ios_seek_end, Int64, (Ptr{Void},), s.ios) != 0) + systemerror("seekend", ccall(:ios_seek_end, Int64, (Ptr{Cvoid},), s.ios) != 0) return s end @@ -153,7 +153,7 @@ julia> read(io, Char) ``` """ function skip(s::IOStream, delta::Integer) - ret = ccall(:ios_skip, Int64, (Ptr{Void}, Int64), s.ios, delta) + ret = ccall(:ios_skip, Int64, (Ptr{Cvoid}, Int64), s.ios, delta) systemerror("skip", ret == -1) ret < -1 && error("skip failed") return s @@ -185,12 +185,12 @@ julia> position(io) ``` """ function position(s::IOStream) - pos = ccall(:ios_pos, Int64, (Ptr{Void},), s.ios) + pos = ccall(:ios_pos, Int64, (Ptr{Cvoid},), s.ios) systemerror("position", pos == -1) return pos end -eof(s::IOStream) = ccall(:ios_eof_blocking, Cint, (Ptr{Void},), s.ios)!=0 +eof(s::IOStream) = ccall(:ios_eof_blocking, Cint, (Ptr{Cvoid},), s.ios)!=0 ## constructing and opening streams ## @@ -205,7 +205,7 @@ it is garbage collected. `name` allows you to associate the descriptor with a na """ function fdio(name::AbstractString, fd::Integer, own::Bool=false) s = IOStream(name) - ccall(:ios_fd, Ptr{Void}, (Ptr{Void}, Clong, Cint, Cint), + ccall(:ios_fd, Ptr{Cvoid}, (Ptr{Cvoid}, Clong, Cint, Cint), s.ios, fd, 0, own) return s end @@ -221,11 +221,11 @@ reading only. Return a stream for accessing the file. function open(fname::AbstractString, rd::Bool, wr::Bool, cr::Bool, tr::Bool, ff::Bool) s = IOStream(string("")) systemerror("opening file $fname", - ccall(:ios_file, Ptr{Void}, + ccall(:ios_file, Ptr{Cvoid}, (Ptr{UInt8}, Cstring, Cint, Cint, Cint, Cint), s.ios, fname, rd, wr, cr, tr) == C_NULL) if ff - systemerror("seeking to end of file $fname", ccall(:ios_seek_end, Int64, (Ptr{Void},), s.ios) != 0) + systemerror("seeking to end of file $fname", ccall(:ios_seek_end, Int64, (Ptr{Cvoid},), s.ios) != 0) end return s end @@ -317,21 +317,21 @@ end function write(s::IOStream, b::UInt8) iswritable(s) || throw(ArgumentError("write failed, IOStream is not writeable")) - Int(ccall(:ios_putc, Cint, (Cint, Ptr{Void}), b, s.ios)) + Int(ccall(:ios_putc, Cint, (Cint, Ptr{Cvoid}), b, s.ios)) end function unsafe_write(s::IOStream, p::Ptr{UInt8}, nb::UInt) iswritable(s) || throw(ArgumentError("write failed, IOStream is not writeable")) - return Int(ccall(:ios_write, Csize_t, (Ptr{Void}, Ptr{Void}, Csize_t), s.ios, p, nb)) + return Int(ccall(:ios_write, Csize_t, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), s.ios, p, nb)) end # num bytes available without blocking -nb_available(s::IOStream) = ccall(:jl_nb_available, Int32, (Ptr{Void},), s.ios) +nb_available(s::IOStream) = ccall(:jl_nb_available, Int32, (Ptr{Cvoid},), s.ios) readavailable(s::IOStream) = read!(s, Vector{UInt8}(uninitialized, nb_available(s))) function read(s::IOStream, ::Type{UInt8}) - b = ccall(:ios_getc, Cint, (Ptr{Void},), s.ios) + b = ccall(:ios_getc, Cint, (Ptr{Cvoid},), s.ios) if b == -1 throw(EOFError()) end @@ -340,13 +340,13 @@ end if ENDIAN_BOM == 0x04030201 function read(s::IOStream, T::Union{Type{Int16},Type{UInt16},Type{Int32},Type{UInt32},Type{Int64},Type{UInt64}}) - return ccall(:jl_ios_get_nbyte_int, UInt64, (Ptr{Void}, Csize_t), s.ios, sizeof(T)) % T + return ccall(:jl_ios_get_nbyte_int, UInt64, (Ptr{Cvoid}, Csize_t), s.ios, sizeof(T)) % T end end function unsafe_read(s::IOStream, p::Ptr{UInt8}, nb::UInt) if ccall(:ios_readall, Csize_t, - (Ptr{Void}, Ptr{Void}, Csize_t), s, p, nb) != nb + (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), s, p, nb) != nb throw(EOFError()) end nothing @@ -355,19 +355,19 @@ end ## text I/O ## take!(s::IOStream) = - ccall(:jl_take_buffer, Vector{UInt8}, (Ptr{Void},), s.ios) + ccall(:jl_take_buffer, Vector{UInt8}, (Ptr{Cvoid},), s.ios) function readuntil(s::IOStream, delim::UInt8) - ccall(:jl_readuntil, Array{UInt8,1}, (Ptr{Void}, UInt8, UInt8, UInt8), s.ios, delim, 0, 0) + ccall(:jl_readuntil, Array{UInt8,1}, (Ptr{Cvoid}, UInt8, UInt8, UInt8), s.ios, delim, 0, 0) end # like readuntil, above, but returns a String without requiring a copy function readuntil_string(s::IOStream, delim::UInt8) - ccall(:jl_readuntil, Ref{String}, (Ptr{Void}, UInt8, UInt8, UInt8), s.ios, delim, 1, false) + ccall(:jl_readuntil, Ref{String}, (Ptr{Cvoid}, UInt8, UInt8, UInt8), s.ios, delim, 1, false) end function readline(s::IOStream; chomp::Bool=true) - ccall(:jl_readuntil, Ref{String}, (Ptr{Void}, UInt8, UInt8, UInt8), s.ios, '\n', 1, chomp) + ccall(:jl_readuntil, Ref{String}, (Ptr{Cvoid}, UInt8, UInt8, UInt8), s.ios, '\n', 1, chomp) end function readbytes_all!(s::IOStream, b::Array{UInt8}, nb) @@ -378,7 +378,7 @@ function readbytes_all!(s::IOStream, b::Array{UInt8}, nb) lb = max(65536, (nr+1) * 2) resize!(b, lb) end - nr += Int(ccall(:ios_readall, Csize_t, (Ptr{Void}, Ptr{Void}, Csize_t), + nr += Int(ccall(:ios_readall, Csize_t, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), s.ios, pointer(b, nr+1), min(lb-nr, nb-nr))) eof(s) && break end @@ -393,7 +393,7 @@ function readbytes_some!(s::IOStream, b::Array{UInt8}, nb) if nb > lb resize!(b, nb) end - nr = @gc_preserve b Int(ccall(:ios_read, Csize_t, (Ptr{Void}, Ptr{Void}, Csize_t), + nr = @gc_preserve b Int(ccall(:ios_read, Csize_t, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), s.ios, pointer(b), nb)) if lb > olb && lb > nr resize!(b, nr) @@ -418,7 +418,7 @@ function read(s::IOStream) sz = 0 try # filesize is just a hint, so ignore if it fails sz = filesize(s) - pos = ccall(:ios_pos, Int64, (Ptr{Void},), s.ios) + pos = ccall(:ios_pos, Int64, (Ptr{Cvoid},), s.ios) if pos > 0 sz -= pos end @@ -448,14 +448,14 @@ end function peekchar(s::IOStream) chref = Ref{UInt32}() - if ccall(:ios_peekutf8, Cint, (Ptr{Void}, Ptr{UInt32}), s, chref) < 0 + if ccall(:ios_peekutf8, Cint, (Ptr{Cvoid}, Ptr{UInt32}), s, chref) < 0 return typemax(Char) end return Char(chref[]) end function peek(s::IOStream) - ccall(:ios_peekc, Cint, (Ptr{Void},), s) + ccall(:ios_peekc, Cint, (Ptr{Cvoid},), s) end function peek(s::IO) diff --git a/base/libc.jl b/base/libc.jl index 9bebbdc687aae..fd7e5858a3fc9 100644 --- a/base/libc.jl +++ b/base/libc.jl @@ -34,23 +34,23 @@ dup(src::RawFD, target::RawFD) = systemerror("dup", -1 == # Wrapper for an OS file descriptor (for Windows) if Sys.iswindows() struct WindowsRawSocket - handle::Ptr{Void} # On Windows file descriptors are HANDLE's and 64-bit on 64-bit Windows + handle::Ptr{Cvoid} # On Windows file descriptors are HANDLE's and 64-bit on 64-bit Windows end - Base.cconvert(::Type{Ptr{Void}}, fd::WindowsRawSocket) = fd.handle - _get_osfhandle(fd::RawFD) = WindowsRawSocket(ccall(:_get_osfhandle, Ptr{Void}, (Cint,), fd.fd)) + Base.cconvert(::Type{Ptr{Cvoid}}, fd::WindowsRawSocket) = fd.handle + _get_osfhandle(fd::RawFD) = WindowsRawSocket(ccall(:_get_osfhandle, Ptr{Cvoid}, (Cint,), fd.fd)) _get_osfhandle(fd::WindowsRawSocket) = fd function dup(src::WindowsRawSocket) - new_handle = Ref{Ptr{Void}}(-1) - my_process = ccall(:GetCurrentProcess, stdcall, Ptr{Void}, ()) + new_handle = Ref{Ptr{Cvoid}}(-1) + my_process = ccall(:GetCurrentProcess, stdcall, Ptr{Cvoid}, ()) DUPLICATE_SAME_ACCESS = 0x2 status = ccall(:DuplicateHandle, stdcall, Int32, - (Ptr{Void}, Ptr{Void}, Ptr{Void}, Ptr{Ptr{Void}}, UInt32, Int32, UInt32), + (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Ptr{Cvoid}}, UInt32, Int32, UInt32), my_process, src.handle, my_process, new_handle, 0, false, DUPLICATE_SAME_ACCESS) status == 0 && error("dup failed: $(FormatMessage())") return new_handle[] end function dup(src::WindowsRawSocket, target::RawFD) - fd = ccall(:_open_osfhandle, Int32, (Ptr{Void}, Int32), dup(src), 0) + fd = ccall(:_open_osfhandle, Int32, (Ptr{Cvoid}, Int32), dup(src), 0) dup(RawFD(fd), target) ccall(:_close, Int32, (Int32,), fd) nothing @@ -63,14 +63,14 @@ end ## FILE (not auto-finalized) ## struct FILE - ptr::Ptr{Void} + ptr::Ptr{Cvoid} end modestr(s::IO) = modestr(isreadable(s), iswritable(s)) modestr(r::Bool, w::Bool) = r ? (w ? "r+" : "r") : (w ? "w" : throw(ArgumentError("neither readable nor writable"))) function FILE(fd::RawFD, mode) - FILEp = ccall((@static Sys.iswindows() ? :_fdopen : :fdopen), Ptr{Void}, (Cint, Cstring), fd, mode) + FILEp = ccall((@static Sys.iswindows() ? :_fdopen : :fdopen), Ptr{Cvoid}, (Cint, Cstring), fd, mode) systemerror("fdopen", FILEp == C_NULL) FILE(FILEp) end @@ -81,17 +81,17 @@ function FILE(s::IO) f end -Base.unsafe_convert(T::Union{Type{Ptr{Void}},Type{Ptr{FILE}}}, f::FILE) = convert(T, f.ptr) -Base.close(f::FILE) = systemerror("fclose", ccall(:fclose, Cint, (Ptr{Void},), f.ptr) != 0) +Base.unsafe_convert(T::Union{Type{Ptr{Cvoid}},Type{Ptr{FILE}}}, f::FILE) = convert(T, f.ptr) +Base.close(f::FILE) = systemerror("fclose", ccall(:fclose, Cint, (Ptr{Cvoid},), f.ptr) != 0) Base.convert(::Type{FILE}, s::IO) = FILE(s) function Base.seek(h::FILE, offset::Integer) - systemerror("fseek", ccall(:fseek, Cint, (Ptr{Void}, Clong, Cint), + systemerror("fseek", ccall(:fseek, Cint, (Ptr{Cvoid}, Clong, Cint), h.ptr, offset, 0) != 0) h end -Base.position(h::FILE) = ccall(:ftell, Clong, (Ptr{Void},), h.ptr) +Base.position(h::FILE) = ccall(:ftell, Clong, (Ptr{Cvoid},), h.ptr) # flush C stdio output from external libraries @@ -100,7 +100,7 @@ Base.position(h::FILE) = ccall(:ftell, Clong, (Ptr{Void},), h.ptr) Flushes the C `stdout` and `stderr` streams (which may have been written to by external C code). """ -flush_cstdio() = ccall(:jl_flush_cstdio, Void, ()) +flush_cstdio() = ccall(:jl_flush_cstdio, Cvoid, ()) ## time-related functions ## @@ -109,7 +109,7 @@ if Sys.isunix() systemsleep(s::Real) = ccall(:usleep, Int32, (UInt32,), round(UInt32, s*1e6)) elseif Sys.iswindows() function systemsleep(s::Real) - ccall(:Sleep, stdcall, Void, (UInt32,), round(UInt32, s * 1e3)) + ccall(:Sleep, stdcall, Cvoid, (UInt32,), round(UInt32, s * 1e3)) return Int32(0) end else @@ -268,7 +268,7 @@ sets it. Specifically, you cannot call `errno` at the next prompt in a REPL, bec code is executed between prompts. """ errno() = ccall(:jl_errno, Cint, ()) -errno(e::Integer) = ccall(:jl_set_errno, Void, (Cint,), e) +errno(e::Integer) = ccall(:jl_set_errno, Cvoid, (Cint,), e) """ strerror(n=errno()) @@ -302,14 +302,14 @@ if Sys.iswindows() FORMAT_MESSAGE_MAX_WIDTH_MASK = UInt32(0xFF) lpMsgBuf = Ref{Ptr{UInt16}}() lpMsgBuf[] = 0 - len = ccall(:FormatMessageW, stdcall, UInt32, (Cint, Ptr{Void}, Cint, Cint, Ptr{Ptr{UInt16}}, Cint, Ptr{Void}), + len = ccall(:FormatMessageW, stdcall, UInt32, (Cint, Ptr{Cvoid}, Cint, Cint, Ptr{Ptr{UInt16}}, Cint, Ptr{Cvoid}), FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, C_NULL, e, 0, lpMsgBuf, 0, C_NULL) p = lpMsgBuf[] len == 0 && return "" buf = Vector{UInt16}(uninitialized, len) Base.@gc_preserve buf unsafe_copyto!(pointer(buf), p, len) - ccall(:LocalFree, stdcall, Ptr{Void}, (Ptr{Void},), p) + ccall(:LocalFree, stdcall, Ptr{Cvoid}, (Ptr{Cvoid},), p) return transcode(String, buf) end end @@ -324,31 +324,31 @@ on pointers retrieved from other C libraries. `Ptr` objects obtained from C libr be freed by the free functions defined in that library, to avoid assertion failures if multiple `libc` libraries exist on the system. """ -free(p::Ptr) = ccall(:free, Void, (Ptr{Void},), p) +free(p::Ptr) = ccall(:free, Cvoid, (Ptr{Cvoid},), p) """ - malloc(size::Integer) -> Ptr{Void} + malloc(size::Integer) -> Ptr{Cvoid} Call `malloc` from the C standard library. """ -malloc(size::Integer) = ccall(:malloc, Ptr{Void}, (Csize_t,), size) +malloc(size::Integer) = ccall(:malloc, Ptr{Cvoid}, (Csize_t,), size) """ - realloc(addr::Ptr, size::Integer) -> Ptr{Void} + realloc(addr::Ptr, size::Integer) -> Ptr{Cvoid} Call `realloc` from the C standard library. See warning in the documentation for `free` regarding only using this on memory originally obtained from `malloc`. """ -realloc(p::Ptr, size::Integer) = ccall(:realloc, Ptr{Void}, (Ptr{Void}, Csize_t), p, size) +realloc(p::Ptr, size::Integer) = ccall(:realloc, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), p, size) """ - calloc(num::Integer, size::Integer) -> Ptr{Void} + calloc(num::Integer, size::Integer) -> Ptr{Cvoid} Call `calloc` from the C standard library. """ -calloc(num::Integer, size::Integer) = ccall(:calloc, Ptr{Void}, (Csize_t, Csize_t), num, size) +calloc(num::Integer, size::Integer) = ccall(:calloc, Ptr{Cvoid}, (Csize_t, Csize_t), num, size) free(p::Cstring) = free(convert(Ptr{UInt8}, p)) free(p::Cwstring) = free(convert(Ptr{Cwchar_t}, p)) diff --git a/base/libdl.jl b/base/libdl.jl index a63feecc4915e..5d188974c43c5 100644 --- a/base/libdl.jl +++ b/base/libdl.jl @@ -55,7 +55,7 @@ Look up a symbol from a shared library handle, return callable function pointer """ function dlsym(hnd::Ptr, s::Union{Symbol,AbstractString}) hnd == C_NULL && throw(ArgumentError("NULL library handle")) - ccall(:jl_dlsym, Ptr{Void}, (Ptr{Void}, Cstring), hnd, s) + ccall(:jl_dlsym, Ptr{Cvoid}, (Ptr{Cvoid}, Cstring), hnd, s) end """ @@ -65,7 +65,7 @@ Look up a symbol from a shared library handle, silently return `NULL` pointer on """ function dlsym_e(hnd::Ptr, s::Union{Symbol,AbstractString}) hnd == C_NULL && throw(ArgumentError("NULL library handle")) - ccall(:jl_dlsym_e, Ptr{Void}, (Ptr{Void}, Cstring), hnd, s) + ccall(:jl_dlsym_e, Ptr{Cvoid}, (Ptr{Cvoid}, Cstring), hnd, s) end """ @@ -98,7 +98,7 @@ dlopen(s::Symbol, flags::Integer = RTLD_LAZY | RTLD_DEEPBIND) = dlopen(string(s), flags) dlopen(s::AbstractString, flags::Integer = RTLD_LAZY | RTLD_DEEPBIND) = - ccall(:jl_load_dynamic_library, Ptr{Void}, (Cstring,UInt32), s, flags) + ccall(:jl_load_dynamic_library, Ptr{Cvoid}, (Cstring,UInt32), s, flags) """ dlopen_e(libfile::AbstractString [, flags::Integer]) @@ -111,7 +111,7 @@ dlopen_e(s::Symbol, flags::Integer = RTLD_LAZY | RTLD_DEEPBIND) = dlopen_e(string(s), flags) dlopen_e(s::AbstractString, flags::Integer = RTLD_LAZY | RTLD_DEEPBIND) = - ccall(:jl_load_dynamic_library_e, Ptr{Void}, (Cstring,UInt32), s, flags) + ccall(:jl_load_dynamic_library_e, Ptr{Cvoid}, (Cstring,UInt32), s, flags) """ dlclose(handle) @@ -119,7 +119,7 @@ dlopen_e(s::AbstractString, flags::Integer = RTLD_LAZY | RTLD_DEEPBIND) = Close shared library referenced by handle. """ function dlclose(p::Ptr) - 0 == ccall(:jl_dlclose, Cint, (Ptr{Void},), p) + 0 == ccall(:jl_dlclose, Cint, (Ptr{Cvoid},), p) end """ @@ -152,8 +152,8 @@ end find_library(libname::Union{Symbol,AbstractString}, extrapaths=String[]) = find_library([string(libname)], extrapaths) -function dlpath(handle::Ptr{Void}) - p = ccall(:jl_pathname_for_handle, Cstring, (Ptr{Void},), handle) +function dlpath(handle::Ptr{Cvoid}) + p = ccall(:jl_pathname_for_handle, Cstring, (Ptr{Cvoid},), handle) s = unsafe_string(p) Sys.iswindows() && Libc.free(p) return s @@ -191,7 +191,7 @@ if Sys.islinux() name::Ptr{UInt8} # Pointer to array of ELF program headers for this object - phdr::Ptr{Void} + phdr::Ptr{Cvoid} # Number of program headers for this object phnum::Cshort @@ -218,7 +218,7 @@ if Sys.isbsd() && !Sys.isapple() name::Ptr{UInt8} # Pointer to array of ELF program headers for this object - phdr::Ptr{Void} + phdr::Ptr{Cvoid} # Number of program headers for this object phnum::Cshort @@ -239,7 +239,7 @@ function dllist() @static if Sys.islinux() callback = cfunction(dl_phdr_info_callback, Cint, Tuple{Ref{dl_phdr_info}, Csize_t, Ref{Vector{AbstractString}}}) - ccall(:dl_iterate_phdr, Cint, (Ptr{Void}, Ref{Vector{AbstractString}}), callback, dynamic_libraries) + ccall(:dl_iterate_phdr, Cint, (Ptr{Cvoid}, Ref{Vector{AbstractString}}), callback, dynamic_libraries) end @static if Sys.isapple() @@ -259,7 +259,7 @@ function dllist() @static if Sys.isbsd() && !Sys.isapple() callback = cfunction(dl_phdr_info_callback, Cint, Tuple{Ref{dl_phdr_info}, Csize_t, Ref{Vector{AbstractString}}}) - ccall(:dl_iterate_phdr, Cint, (Ptr{Void}, Ref{Vector{AbstractString}}), callback, dynamic_libraries) + ccall(:dl_iterate_phdr, Cint, (Ptr{Cvoid}, Ref{Vector{AbstractString}}), callback, dynamic_libraries) shift!(dynamic_libraries) end diff --git a/base/libgit2/blame.jl b/base/libgit2/blame.jl index a63ee4e81a45a..b7106b92c583c 100644 --- a/base/libgit2/blame.jl +++ b/base/libgit2/blame.jl @@ -9,9 +9,9 @@ the file when, and how. `options` controls how to separate the contents of the f which commits to probe - see [`BlameOptions`](@ref) for more information. """ function GitBlame(repo::GitRepo, path::AbstractString; options::BlameOptions=BlameOptions()) - blame_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + blame_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_blame_file, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Ptr{BlameOptions}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Ptr{BlameOptions}), blame_ptr_ptr, repo.ptr, path, Ref(options)) return GitBlame(repo, blame_ptr_ptr[]) end @@ -25,7 +25,7 @@ a function added to a source file or an inner loop that was optimized out of that function later. """ function counthunks(blame::GitBlame) - return ccall((:git_blame_get_hunk_count, :libgit2), Int32, (Ptr{Void},), blame.ptr) + return ccall((:git_blame_get_hunk_count, :libgit2), Int32, (Ptr{Cvoid},), blame.ptr) end function Base.getindex(blame::GitBlame, i::Integer) @@ -35,7 +35,7 @@ function Base.getindex(blame::GitBlame, i::Integer) Base.@gc_preserve blame begin hunk_ptr = ccall((:git_blame_get_hunk_byindex, :libgit2), Ptr{BlameHunk}, - (Ptr{Void}, Csize_t), blame.ptr, i-1) + (Ptr{Cvoid}, Csize_t), blame.ptr, i-1) elem = unsafe_load(hunk_ptr) end return elem diff --git a/base/libgit2/blob.jl b/base/libgit2/blob.jl index e0697153531f5..c2186765c2ce1 100644 --- a/base/libgit2/blob.jl +++ b/base/libgit2/blob.jl @@ -1,7 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license function Base.length(blob::GitBlob) - return ccall((:git_blob_rawsize, :libgit2), Int64, (Ptr{Void},), blob.ptr) + return ccall((:git_blob_rawsize, :libgit2), Int64, (Ptr{Cvoid},), blob.ptr) end """ @@ -18,7 +18,7 @@ See also [`content`](@ref), which *will* throw an error if the content of the `b is binary and not valid Unicode. """ function rawcontent(blob::GitBlob) - ptr = ccall((:git_blob_rawcontent, :libgit2), Ptr{UInt8}, (Ptr{Void},), blob.ptr) + ptr = ccall((:git_blob_rawcontent, :libgit2), Ptr{UInt8}, (Ptr{Cvoid},), blob.ptr) copy(unsafe_wrap(Array, ptr, (length(blob),), false)) end @@ -44,7 +44,7 @@ looking for a reasonable ratio of printable to non-printable characters among the first 8000 bytes. """ function isbinary(blob::GitBlob) - bin_flag = ccall((:git_blob_is_binary, :libgit2), Cint, (Ptr{Void},), blob.ptr) + bin_flag = ccall((:git_blob_is_binary, :libgit2), Cint, (Ptr{Cvoid},), blob.ptr) return bin_flag == 1 end @@ -64,7 +64,7 @@ id = LibGit2.addblob!(repo, blob_file) function addblob!(repo::GitRepo, path::AbstractString) id_ref = Ref{GitHash}() @check ccall((:git_blob_create_fromdisk, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}, Cstring), + (Ptr{GitHash}, Ptr{Cvoid}, Cstring), id_ref, repo.ptr, path) return id_ref[] end diff --git a/base/libgit2/callbacks.jl b/base/libgit2/callbacks.jl index 2be0e07d9aab2..3bda735af0ad1 100644 --- a/base/libgit2/callbacks.jl +++ b/base/libgit2/callbacks.jl @@ -4,12 +4,12 @@ Function sets `+refs/*:refs/*` refspecs and `mirror` flag for remote reference. """ -function mirror_callback(remote::Ptr{Ptr{Void}}, repo_ptr::Ptr{Void}, - name::Cstring, url::Cstring, payload::Ptr{Void}) +function mirror_callback(remote::Ptr{Ptr{Cvoid}}, repo_ptr::Ptr{Cvoid}, + name::Cstring, url::Cstring, payload::Ptr{Cvoid}) # Create the remote with a mirroring url fetch_spec = "+refs/*:refs/*" err = ccall((:git_remote_create_with_fetchspec, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring, Cstring), remote, repo_ptr, name, url, fetch_spec) err != 0 && return Cint(err) @@ -41,27 +41,27 @@ end function user_abort() # Note: Potentially it could be better to just throw a Julia error. - ccall((:giterr_set_str, :libgit2), Void, + ccall((:giterr_set_str, :libgit2), Cvoid, (Cint, Cstring), Cint(Error.Callback), "Aborting, user cancelled credential request.") return Cint(Error.EUSER) end function prompt_limit() - ccall((:giterr_set_str, :libgit2), Void, + ccall((:giterr_set_str, :libgit2), Cvoid, (Cint, Cstring), Cint(Error.Callback), "Aborting, maximum number of prompts reached.") return Cint(Error.EAUTH) end function exhausted_abort() - ccall((:giterr_set_str, :libgit2), Void, + ccall((:giterr_set_str, :libgit2), Cvoid, (Cint, Cstring), Cint(Error.Callback), "All authentication methods have failed.") return Cint(Error.EAUTH) end -function authenticate_ssh(libgit2credptr::Ptr{Ptr{Void}}, p::CredentialPayload, username_ptr) +function authenticate_ssh(libgit2credptr::Ptr{Ptr{Cvoid}}, p::CredentialPayload, username_ptr) cred = p.credential::SSHCredential revised = false @@ -75,7 +75,7 @@ function authenticate_ssh(libgit2credptr::Ptr{Ptr{Void}}, p::CredentialPayload, # first try ssh-agent if credentials support its usage if p.use_ssh_agent && username_ptr != Cstring(C_NULL) && (!revised || !isfilled(cred)) err = ccall((:git_cred_ssh_key_from_agent, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring), libgit2credptr, username_ptr) + (Ptr{Ptr{Cvoid}}, Cstring), libgit2credptr, username_ptr) p.use_ssh_agent = false # use ssh-agent only one time err == 0 && return Cint(0) @@ -169,11 +169,11 @@ function authenticate_ssh(libgit2credptr::Ptr{Ptr{Void}}, p::CredentialPayload, end return ccall((:git_cred_ssh_key_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring, Cstring, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Cstring, Cstring, Cstring, Cstring), libgit2credptr, cred.user, cred.pubkey, cred.prvkey, cred.pass) end -function authenticate_userpass(libgit2credptr::Ptr{Ptr{Void}}, p::CredentialPayload) +function authenticate_userpass(libgit2credptr::Ptr{Ptr{Cvoid}}, p::CredentialPayload) cred = p.credential::UserPasswordCredential revised = false @@ -228,7 +228,7 @@ function authenticate_userpass(libgit2credptr::Ptr{Ptr{Void}}, p::CredentialPayl end return ccall((:git_cred_userpass_plaintext_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Cstring, Cstring), libgit2credptr, cred.user, cred.pass) end @@ -259,9 +259,9 @@ using the same faulty credentials, we will keep track of state using the payload For addition details see the LibGit2 guide on [authenticating against a server](https://libgit2.github.com/docs/guides/authentication/). """ -function credentials_callback(libgit2credptr::Ptr{Ptr{Void}}, url_ptr::Cstring, +function credentials_callback(libgit2credptr::Ptr{Ptr{Cvoid}}, url_ptr::Cstring, username_ptr::Cstring, - allowed_types::Cuint, payload_ptr::Ptr{Void}) + allowed_types::Cuint, payload_ptr::Ptr{Cvoid}) err = Cint(0) # get `CredentialPayload` object from payload pointer @@ -331,7 +331,7 @@ function credentials_callback(libgit2credptr::Ptr{Ptr{Void}}, url_ptr::Cstring, # with the requested authentication method. if err == 0 if p.explicit !== nothing - ccall((:giterr_set_str, :libgit2), Void, (Cint, Cstring), Cint(Error.Callback), + ccall((:giterr_set_str, :libgit2), Cvoid, (Cint, Cstring), Cint(Error.Callback), "The explicitly provided credential is incompatible with the requested " * "authentication methods.") end @@ -341,7 +341,7 @@ function credentials_callback(libgit2credptr::Ptr{Ptr{Void}}, url_ptr::Cstring, end function fetchhead_foreach_callback(ref_name::Cstring, remote_url::Cstring, - oid_ptr::Ptr{GitHash}, is_merge::Cuint, payload::Ptr{Void}) + oid_ptr::Ptr{GitHash}, is_merge::Cuint, payload::Ptr{Cvoid}) fhead_vec = unsafe_pointer_to_objref(payload)::Vector{FetchHead} push!(fhead_vec, FetchHead(unsafe_string(ref_name), unsafe_string(remote_url), unsafe_load(oid_ptr), is_merge == 1)) @@ -349,8 +349,8 @@ function fetchhead_foreach_callback(ref_name::Cstring, remote_url::Cstring, end "C function pointer for `mirror_callback`" -mirror_cb() = cfunction(mirror_callback, Cint, Tuple{Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring, Ptr{Void}}) +mirror_cb() = cfunction(mirror_callback, Cint, Tuple{Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring, Ptr{Cvoid}}) "C function pointer for `credentials_callback`" -credentials_cb() = cfunction(credentials_callback, Cint, Tuple{Ptr{Ptr{Void}}, Cstring, Cstring, Cuint, Ptr{Void}}) +credentials_cb() = cfunction(credentials_callback, Cint, Tuple{Ptr{Ptr{Cvoid}}, Cstring, Cstring, Cuint, Ptr{Cvoid}}) "C function pointer for `fetchhead_foreach_callback`" -fetchhead_foreach_cb() = cfunction(fetchhead_foreach_callback, Cint, Tuple{Cstring, Cstring, Ptr{GitHash}, Cuint, Ptr{Void}}) +fetchhead_foreach_cb() = cfunction(fetchhead_foreach_callback, Cint, Tuple{Cstring, Cstring, Ptr{GitHash}, Cuint, Ptr{Cvoid}}) diff --git a/base/libgit2/commit.jl b/base/libgit2/commit.jl index c3a1e6194d991..2df3dfdb2237e 100644 --- a/base/libgit2/commit.jl +++ b/base/libgit2/commit.jl @@ -11,8 +11,8 @@ of any such newlines. function message(c::GitCommit, raw::Bool=false) Base.@gc_preserve c begin local msg_ptr::Cstring - msg_ptr = raw ? ccall((:git_commit_message_raw, :libgit2), Cstring, (Ptr{Void},), c.ptr) : - ccall((:git_commit_message, :libgit2), Cstring, (Ptr{Void},), c.ptr) + msg_ptr = raw ? ccall((:git_commit_message_raw, :libgit2), Cstring, (Ptr{Cvoid},), c.ptr) : + ccall((:git_commit_message, :libgit2), Cstring, (Ptr{Cvoid},), c.ptr) if msg_ptr == C_NULL return nothing end @@ -29,7 +29,7 @@ the person who made changes to the relevant file(s). See also [`committer`](@ref """ function author(c::GitCommit) Base.@gc_preserve c begin - ptr = ccall((:git_commit_author, :libgit2), Ptr{SignatureStruct}, (Ptr{Void},), c.ptr) + ptr = ccall((:git_commit_author, :libgit2), Ptr{SignatureStruct}, (Ptr{Cvoid},), c.ptr) @assert ptr != C_NULL sig = Signature(ptr) end @@ -46,7 +46,7 @@ a `committer` who committed it. """ function committer(c::GitCommit) Base.@gc_preserve c begin - ptr = ccall((:git_commit_committer, :libgit2), Ptr{SignatureStruct}, (Ptr{Void},), c.ptr) + ptr = ccall((:git_commit_committer, :libgit2), Ptr{SignatureStruct}, (Ptr{Cvoid},), c.ptr) sig = Signature(ptr) end return sig @@ -67,12 +67,12 @@ function commit(repo::GitRepo, parents::GitCommit...) commit_id_ptr = Ref(GitHash()) nparents = length(parents) - parentptrs = Ptr{Void}[c.ptr for c in parents] + parentptrs = Ptr{Cvoid}[c.ptr for c in parents] @check ccall((:git_commit_create, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}, Ptr{UInt8}, + (Ptr{GitHash}, Ptr{Cvoid}, Ptr{UInt8}, Ptr{SignatureStruct}, Ptr{SignatureStruct}, - Ptr{UInt8}, Ptr{UInt8}, Ptr{Void}, - Csize_t, Ptr{Ptr{Void}}), + Ptr{UInt8}, Ptr{UInt8}, Ptr{Cvoid}, + Csize_t, Ptr{Ptr{Cvoid}}), commit_id_ptr, repo.ptr, isempty(refname) ? C_NULL : refname, author.ptr, committer.ptr, C_NULL, msg, tree.ptr, diff --git a/base/libgit2/config.jl b/base/libgit2/config.jl index 02c86fcdb8bcf..25a686568feb3 100644 --- a/base/libgit2/config.jl +++ b/base/libgit2/config.jl @@ -11,8 +11,8 @@ function GitConfig(path::AbstractString, level::Consts.GIT_CONFIG = Consts.CONFIG_LEVEL_APP, force::Bool=false) # create new config object - cfg_ptr_ptr = Ref{Ptr{Void}}(C_NULL) - @check ccall((:git_config_new, :libgit2), Cint, (Ptr{Ptr{Void}},), cfg_ptr_ptr) + cfg_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) + @check ccall((:git_config_new, :libgit2), Cint, (Ptr{Ptr{Cvoid}},), cfg_ptr_ptr) cfg = GitConfig(cfg_ptr_ptr[]) try addfile(cfg, path, level, force) @@ -31,9 +31,9 @@ have a specific configuration file set, the default git configuration will be used. """ function GitConfig(repo::GitRepo) - cfg_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + cfg_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_repository_config, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}), cfg_ptr_ptr, repo.ptr) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}), cfg_ptr_ptr, repo.ptr) return GitConfig(repo, cfg_ptr_ptr[]) end @@ -45,16 +45,16 @@ files into a prioritized configuration. This can be used to access default confi options outside a specific git repository. """ function GitConfig(level::Consts.GIT_CONFIG = Consts.CONFIG_LEVEL_DEFAULT) - cfg_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + cfg_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_config_open_default, :libgit2), Cint, - (Ptr{Ptr{Void}},), cfg_ptr_ptr) + (Ptr{Ptr{Cvoid}},), cfg_ptr_ptr) cfg = GitConfig(cfg_ptr_ptr[]) if level != Consts.CONFIG_LEVEL_DEFAULT - glb_cfg_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + glb_cfg_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) tmpcfg = cfg try @check ccall((:git_config_open_level, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cint), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint), glb_cfg_ptr_ptr, cfg.ptr, Cint(level)) cfg = GitConfig(glb_cfg_ptr_ptr[]) finally @@ -79,14 +79,14 @@ function addfile(cfg::GitConfig, path::AbstractString, level::Consts.GIT_CONFIG = Consts.CONFIG_LEVEL_APP, force::Bool=false) @check ccall((:git_config_add_file_ondisk, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring, Cint, Cint), + (Ptr{Ptr{Cvoid}}, Cstring, Cint, Cint), cfg.ptr, path, Cint(level), Cint(force)) end function get(::Type{<:AbstractString}, c::GitConfig, name::AbstractString) buf_ref = Ref(Buffer()) @check ccall((:git_config_get_string_buf, :libgit2), Cint, - (Ptr{Buffer}, Ptr{Void}, Cstring), buf_ref, c.ptr, name) + (Ptr{Buffer}, Ptr{Cvoid}, Cstring), buf_ref, c.ptr, name) buf = buf_ref[] str = unsafe_string(buf.ptr, buf.size) free(buf_ref) @@ -96,21 +96,21 @@ end function get(::Type{Bool}, c::GitConfig, name::AbstractString) val_ptr = Ref(Cint(0)) @check ccall((:git_config_get_bool, :libgit2), Cint, - (Ptr{Cint}, Ptr{Void}, Cstring), val_ptr, c.ptr, name) + (Ptr{Cint}, Ptr{Cvoid}, Cstring), val_ptr, c.ptr, name) return Bool(val_ptr[]) end function get(::Type{Int32}, c::GitConfig, name::AbstractString) val_ptr = Ref(Cint(0)) @check ccall((:git_config_get_int32, :libgit2), Cint, - (Ptr{Cint}, Ptr{Void}, Cstring), val_ptr, c.ptr, name) + (Ptr{Cint}, Ptr{Cvoid}, Cstring), val_ptr, c.ptr, name) return val_ptr[] end function get(::Type{Int64}, c::GitConfig, name::AbstractString) val_ptr = Ref(Cintmax_t(0)) @check ccall((:git_config_get_int64, :libgit2), Cint, - (Ptr{Cintmax_t}, Ptr{Void}, Cstring), val_ptr, c.ptr, name) + (Ptr{Cintmax_t}, Ptr{Cvoid}, Cstring), val_ptr, c.ptr, name) return val_ptr[] end @@ -142,52 +142,52 @@ end function set!(c::GitConfig, name::AbstractString, value::AbstractString) @check ccall((:git_config_set_string, :libgit2), Cint, - (Ptr{Void}, Cstring, Cstring), c.ptr, name, value) + (Ptr{Cvoid}, Cstring, Cstring), c.ptr, name, value) end function set!(c::GitConfig, name::AbstractString, value::Bool) bval = Int32(value) @check ccall((:git_config_set_bool, :libgit2), Cint, - (Ptr{Void}, Cstring, Cint), c.ptr, name, bval) + (Ptr{Cvoid}, Cstring, Cint), c.ptr, name, bval) end function set!(c::GitConfig, name::AbstractString, value::Int32) @check ccall((:git_config_set_int32, :libgit2), Cint, - (Ptr{Void}, Cstring, Cint), c.ptr, name, value) + (Ptr{Cvoid}, Cstring, Cint), c.ptr, name, value) end function set!(c::GitConfig, name::AbstractString, value::Int64) @check ccall((:git_config_set_int64, :libgit2), Cint, - (Ptr{Void}, Cstring, Cintmax_t), c.ptr, name, value) + (Ptr{Cvoid}, Cstring, Cintmax_t), c.ptr, name, value) end function GitConfigIter(cfg::GitConfig) - ci_ptr = Ref{Ptr{Void}}(C_NULL) + ci_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_config_iterator_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}), ci_ptr, cfg.ptr) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}), ci_ptr, cfg.ptr) return GitConfigIter(ci_ptr[]) end function GitConfigIter(cfg::GitConfig, name::AbstractString) - ci_ptr = Ref{Ptr{Void}}(C_NULL) + ci_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_config_multivar_iterator_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring), ci_ptr, cfg.ptr, name, C_NULL) return GitConfigIter(ci_ptr[]) end function GitConfigIter(cfg::GitConfig, name::AbstractString, value::Regex) - ci_ptr = Ref{Ptr{Void}}(C_NULL) + ci_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_config_multivar_iterator_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring), ci_ptr, cfg.ptr, name, value.pattern) return GitConfigIter(ci_ptr[]) end function GitConfigIter(cfg::GitConfig, name::Regex) - ci_ptr = Ref{Ptr{Void}}(C_NULL) + ci_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_config_iterator_glob_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring), ci_ptr, cfg.ptr, name.pattern) return GitConfigIter(ci_ptr[]) end @@ -195,7 +195,7 @@ end function Base.start(ci::GitConfigIter) entry_ptr_ptr = Ref{Ptr{ConfigEntry}}(C_NULL) err = ccall((:git_config_next, :libgit2), Cint, - (Ptr{Ptr{ConfigEntry}}, Ptr{Void}), entry_ptr_ptr, ci.ptr) + (Ptr{Ptr{ConfigEntry}}, Ptr{Cvoid}), entry_ptr_ptr, ci.ptr) if err == Cint(Error.GIT_OK) state = unsafe_load(entry_ptr_ptr[]) elseif err == Cint(Error.ITEROVER) @@ -212,7 +212,7 @@ function Base.next(ci::GitConfigIter, state) entry = notnothing(state) entry_ptr_ptr = Ref{Ptr{ConfigEntry}}(C_NULL) err = ccall((:git_config_next, :libgit2), Cint, - (Ptr{Ptr{ConfigEntry}}, Ptr{Void}), entry_ptr_ptr, ci.ptr) + (Ptr{Ptr{ConfigEntry}}, Ptr{Cvoid}), entry_ptr_ptr, ci.ptr) if err == Cint(Error.GIT_OK) state = unsafe_load(entry_ptr_ptr[]) elseif err == Cint(Error.ITEROVER) diff --git a/base/libgit2/diff.jl b/base/libgit2/diff.jl index a4a172be9d302..977cb8b7efd52 100644 --- a/base/libgit2/diff.jl +++ b/base/libgit2/diff.jl @@ -24,14 +24,14 @@ This compares the current working directory against the [`GitIndex`](@ref) and c for example, be used to examine the changes in staged files before a commit. """ function diff_tree(repo::GitRepo, tree::GitTree, pathspecs::AbstractString=""; cached::Bool=false) - diff_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + diff_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) if cached @check ccall((:git_diff_tree_to_index, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Void}, Ptr{Void}, Ptr{DiffOptionsStruct}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{DiffOptionsStruct}), diff_ptr_ptr, repo.ptr, tree.ptr, C_NULL, isempty(pathspecs) ? C_NULL : pathspecs) else @check ccall((:git_diff_tree_to_workdir_with_index, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Void}, Ptr{DiffOptionsStruct}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{DiffOptionsStruct}), diff_ptr_ptr, repo.ptr, tree.ptr, isempty(pathspecs) ? C_NULL : pathspecs) end return GitDiff(repo, diff_ptr_ptr[]) @@ -48,9 +48,9 @@ be used to compare a commit made 2 months ago with the current latest commit, or to compare a commit on another branch with the current latest commit on `master`. """ function diff_tree(repo::GitRepo, oldtree::GitTree, newtree::GitTree) - diff_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + diff_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_diff_tree_to_tree, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Void}, Ptr{Void}, Ptr{DiffOptionsStruct}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{DiffOptionsStruct}), diff_ptr_ptr, repo.ptr, oldtree.ptr, newtree.ptr, C_NULL) return GitDiff(repo, diff_ptr_ptr[]) end @@ -63,9 +63,9 @@ summary of changes made across the `diff`. In particular, it records how many files were changed, how many insertions were made, and how many deletions were made. """ function GitDiffStats(diff::GitDiff) - diff_stat_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + diff_stat_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_diff_get_stats, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}), diff_stat_ptr_ptr, diff.ptr) return GitDiffStats(diff.owner, diff_stat_ptr_ptr[]) end @@ -79,7 +79,7 @@ used to generate the parent `GitDiff` of `diff_stat` (for instance, whether igno are to be included or not). """ function files_changed(diff_stat::GitDiffStats) - return ccall((:git_diff_stats_files_changed, :libgit2), Csize_t, (Ptr{Void},), diff_stat.ptr) + return ccall((:git_diff_stats_files_changed, :libgit2), Csize_t, (Ptr{Cvoid},), diff_stat.ptr) end """ @@ -91,7 +91,7 @@ used to generate the parent `GitDiff` of `diff_stat` (for instance, whether igno are to be included or not). """ function insertions(diff_stat::GitDiffStats) - return ccall((:git_diff_stats_insertions, :libgit2), Csize_t, (Ptr{Void},), diff_stat.ptr) + return ccall((:git_diff_stats_insertions, :libgit2), Csize_t, (Ptr{Cvoid},), diff_stat.ptr) end """ @@ -103,11 +103,11 @@ used to generate the parent `GitDiff` of `diff_stat` (for instance, whether igno are to be included or not). """ function deletions(diff_stat::GitDiffStats) - return ccall((:git_diff_stats_deletions, :libgit2), Csize_t, (Ptr{Void},), diff_stat.ptr) + return ccall((:git_diff_stats_deletions, :libgit2), Csize_t, (Ptr{Cvoid},), diff_stat.ptr) end function Base.count(diff::GitDiff) - return ccall((:git_diff_num_deltas, :libgit2), Cint, (Ptr{Void},), diff.ptr) + return ccall((:git_diff_num_deltas, :libgit2), Cint, (Ptr{Cvoid},), diff.ptr) end function Base.getindex(diff::GitDiff, i::Integer) @@ -116,7 +116,7 @@ function Base.getindex(diff::GitDiff, i::Integer) end delta_ptr = ccall((:git_diff_get_delta, :libgit2), Ptr{DiffDelta}, - (Ptr{Void}, Csize_t), diff.ptr, i-1) + (Ptr{Cvoid}, Csize_t), diff.ptr, i-1) return unsafe_load(delta_ptr) end diff --git a/base/libgit2/gitcredential.jl b/base/libgit2/gitcredential.jl index dc5ca4908323c..0c47a05dddd3b 100644 --- a/base/libgit2/gitcredential.jl +++ b/base/libgit2/gitcredential.jl @@ -5,19 +5,19 @@ Git credential information used in communication with git credential helpers. Th named using the [input/output key specification](https://git-scm.com/docs/git-credential#IOFMT). """ mutable struct GitCredential - protocol::Union{String, Void} - host::Union{String, Void} - path::Union{String, Void} - username::Union{String, Void} - password::Union{String, Void} + protocol::Union{String, Nothing} + host::Union{String, Nothing} + path::Union{String, Nothing} + username::Union{String, Nothing} + password::Union{String, Nothing} use_http_path::Bool function GitCredential( - protocol::Union{AbstractString, Void}=nothing, - host::Union{AbstractString, Void}=nothing, - path::Union{AbstractString, Void}=nothing, - username::Union{AbstractString, Void}=nothing, - password::Union{AbstractString, Void}=nothing) + protocol::Union{AbstractString, Nothing}=nothing, + host::Union{AbstractString, Nothing}=nothing, + path::Union{AbstractString, Nothing}=nothing, + username::Union{AbstractString, Nothing}=nothing, + password::Union{AbstractString, Nothing}=nothing) c = new(protocol, host, path, username, password, true) finalizer(securezero!, c) return c @@ -235,7 +235,7 @@ function credential_helpers(cfg::GitConfig, cred::GitCredential) end """ - default_username(config, git_cred) -> Union{String, Void} + default_username(config, git_cred) -> Union{String, Nothing} Return the default username, if any, provided by the `config` which is valid for the specified `git_cred`. diff --git a/base/libgit2/index.jl b/base/libgit2/index.jl index 378e8ceae3897..e96a4dbedf295 100644 --- a/base/libgit2/index.jl +++ b/base/libgit2/index.jl @@ -6,9 +6,9 @@ Load the index file for the repository `repo`. """ function GitIndex(repo::GitRepo) - idx_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + idx_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_repository_index, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}), idx_ptr_ptr, repo.ptr) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}), idx_ptr_ptr, repo.ptr) return GitIndex(repo, idx_ptr_ptr[]) end @@ -23,7 +23,7 @@ If `force` is `false`, the index data is only updated from disk if the data on d has changed since the last time it was loaded into `idx`. """ function read!(idx::GitIndex, force::Bool = false) - @check ccall((:git_index_read, :libgit2), Cint, (Ptr{Void}, Cint), idx.ptr, Cint(force)) + @check ccall((:git_index_read, :libgit2), Cint, (Ptr{Cvoid}, Cint), idx.ptr, Cint(force)) return idx end @@ -33,7 +33,7 @@ end Write the state of index `idx` to disk using a file lock. """ function write!(idx::GitIndex) - @check ccall((:git_index_write, :libgit2), Cint, (Ptr{Void},), idx.ptr) + @check ccall((:git_index_write, :libgit2), Cint, (Ptr{Cvoid},), idx.ptr) return idx end @@ -48,7 +48,7 @@ repository cannot be bare. `idx` must not contain any files with conflicts. function write_tree!(idx::GitIndex) oid_ptr = Ref(GitHash()) @check ccall((:git_index_write_tree, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}), oid_ptr, idx.ptr) + (Ptr{GitHash}, Ptr{Cvoid}), oid_ptr, idx.ptr) return oid_ptr[] end @@ -69,7 +69,7 @@ Read the tree `tree` (or the tree pointed to by `treehash` in the repository own """ function read_tree!(idx::GitIndex, tree::GitTree) @check ccall((:git_index_read_tree, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}), idx.ptr, tree.ptr) + (Ptr{Cvoid}, Ptr{Cvoid}), idx.ptr, tree.ptr) end read_tree!(idx::GitIndex, hash::AbstractGitHash) = read_tree!(idx, GitTree(repository(idx), hash)) @@ -99,7 +99,7 @@ with respect to ignored files: function add!(idx::GitIndex, files::AbstractString...; flags::Cuint = Consts.INDEX_ADD_DEFAULT) @check ccall((:git_index_add_all, :libgit2), Cint, - (Ptr{Void}, Ptr{StrArrayStruct}, Cuint, Ptr{Void}, Ptr{Void}), + (Ptr{Cvoid}, Ptr{StrArrayStruct}, Cuint, Ptr{Cvoid}, Ptr{Cvoid}), idx.ptr, collect(files), flags, C_NULL, C_NULL) end @@ -114,7 +114,7 @@ database. """ function update!(idx::GitIndex, files::AbstractString...) @check ccall((:git_index_update_all, :libgit2), Cint, - (Ptr{Void}, Ptr{StrArrayStruct}, Ptr{Void}, Ptr{Void}), + (Ptr{Cvoid}, Ptr{StrArrayStruct}, Ptr{Cvoid}, Ptr{Cvoid}), idx.ptr, collect(files), C_NULL, C_NULL) end @@ -127,7 +127,7 @@ of the `repo`). """ function remove!(idx::GitIndex, files::AbstractString...) @check ccall((:git_index_remove_all, :libgit2), Cint, - (Ptr{Void}, Ptr{StrArrayStruct}, Ptr{Void}, Ptr{Void}), + (Ptr{Cvoid}, Ptr{StrArrayStruct}, Ptr{Cvoid}, Ptr{Cvoid}), idx.ptr, collect(files), C_NULL, C_NULL) end @@ -164,14 +164,14 @@ function read!(repo::GitRepo, force::Bool = false) end function Base.count(idx::GitIndex) - return ccall((:git_index_entrycount, :libgit2), Csize_t, (Ptr{Void},), idx.ptr) + return ccall((:git_index_entrycount, :libgit2), Csize_t, (Ptr{Cvoid},), idx.ptr) end function Base.getindex(idx::GitIndex, i::Integer) Base.@gc_preserve idx begin ie_ptr = ccall((:git_index_get_byindex, :libgit2), Ptr{IndexEntry}, - (Ptr{Void}, Csize_t), idx.ptr, i-1) + (Ptr{Cvoid}, Csize_t), idx.ptr, i-1) ie_ptr == C_NULL && return nothing elem = unsafe_load(ie_ptr) end @@ -181,7 +181,7 @@ end function Base.find(path::String, idx::GitIndex) pos_ref = Ref{Csize_t}(0) ret = ccall((:git_index_find, :libgit2), Cint, - (Ref{Csize_t}, Ptr{Void}, Cstring), pos_ref, idx.ptr, path) + (Ref{Csize_t}, Ptr{Cvoid}, Cstring), pos_ref, idx.ptr, path) ret == Cint(Error.ENOTFOUND) && return nothing return pos_ref[]+1 end diff --git a/base/libgit2/libgit2.jl b/base/libgit2/libgit2.jl index 10065d03a20f2..16cf428218a7a 100644 --- a/base/libgit2/libgit2.jl +++ b/base/libgit2/libgit2.jl @@ -264,7 +264,7 @@ Equivalent to `git fetch [|] []`. function fetch(repo::GitRepo; remote::AbstractString="origin", remoteurl::AbstractString="", refspecs::Vector{<:AbstractString}=AbstractString[], - payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Void}=CredentialPayload()) + payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Nothing}=CredentialPayload()) p = reset!(deprecate_nullable_creds(:fetch, "repo", payload), GitConfig(repo)) rmt = if isempty(remoteurl) get(GitRemote, repo, remote) @@ -306,7 +306,7 @@ function push(repo::GitRepo; remote::AbstractString="origin", remoteurl::AbstractString="", refspecs::Vector{<:AbstractString}=AbstractString[], force::Bool=false, - payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Void}=CredentialPayload()) + payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Nothing}=CredentialPayload()) p = reset!(deprecate_nullable_creds(:push, "repo", payload), GitConfig(repo)) rmt = if isempty(remoteurl) get(GitRemote, repo, remote) @@ -501,7 +501,7 @@ The keyword arguments are: which will make `repo_path` itself the git directory instead of `repo_path/.git`. This means that a working tree cannot be checked out. Plays the role of the git CLI argument `--bare`. - * `remote_cb::Ptr{Void}=C_NULL`: a callback which will be used to create the remote + * `remote_cb::Ptr{Cvoid}=C_NULL`: a callback which will be used to create the remote before it is cloned. If `C_NULL` (the default), no attempt will be made to create the remote - it will be assumed to already exist. * `payload::CredentialPayload=CredentialPayload()`: provides credentials and/or settings @@ -521,8 +521,8 @@ julia_repo = LibGit2.clone(julia_url, "julia_path", branch="release-0.6") function clone(repo_url::AbstractString, repo_path::AbstractString; branch::AbstractString="", isbare::Bool = false, - remote_cb::Ptr{Void} = C_NULL, - payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Void}=CredentialPayload()) + remote_cb::Ptr{Cvoid} = C_NULL, + payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Nothing}=CredentialPayload()) # setup clone options lbranch = Base.cconvert(Cstring, branch) @Base.gc_preserve lbranch begin diff --git a/base/libgit2/merge.jl b/base/libgit2/merge.jl index 49da78409fdb1..a3f44a1890a27 100644 --- a/base/libgit2/merge.jl +++ b/base/libgit2/merge.jl @@ -14,25 +14,25 @@ tip of a remote branch, for instance when a [`FetchHead`](@ref) is passed, or to branch head described using `GitReference`. """ function GitAnnotated(repo::GitRepo, commit_id::GitHash) - ann_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ann_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_annotated_commit_lookup, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{GitHash}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{GitHash}), ann_ptr_ptr, repo.ptr, Ref(commit_id)) return GitAnnotated(repo, ann_ptr_ptr[]) end function GitAnnotated(repo::GitRepo, ref::GitReference) - ann_ref_ref = Ref{Ptr{Void}}(C_NULL) + ann_ref_ref = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_annotated_commit_from_ref, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Void}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cvoid}), ann_ref_ref, repo.ptr, ref.ptr) return GitAnnotated(repo, ann_ref_ref[]) end function GitAnnotated(repo::GitRepo, fh::FetchHead) - ann_ref_ref = Ref{Ptr{Void}}(C_NULL) + ann_ref_ref = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_annotated_commit_from_fetchhead, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring, Ptr{GitHash}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring, Ptr{GitHash}), ann_ref_ref, repo.ptr, fh.name, fh.url, Ref(fh.oid)) return GitAnnotated(repo, ann_ref_ref[]) end @@ -45,7 +45,7 @@ end function GitHash(ann::GitAnnotated) Base.@gc_preserve ann begin - oid = unsafe_load(ccall((:git_annotated_commit_id, :libgit2), Ptr{GitHash}, (Ptr{Void},), ann.ptr)) + oid = unsafe_load(ccall((:git_annotated_commit_id, :libgit2), Ptr{GitHash}, (Ptr{Cvoid},), ann.ptr)) end return oid end @@ -84,7 +84,7 @@ function merge_analysis(repo::GitRepo, anns::Vector{GitAnnotated}) anns_ref = Ref(map(a->a.ptr, anns)) anns_size = Csize_t(length(anns)) @check ccall((:git_merge_analysis, :libgit2), Cint, - (Ptr{Cint}, Ptr{Cint}, Ptr{Void}, Ptr{Ptr{Void}}, Csize_t), + (Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Ptr{Cvoid}}, Csize_t), analysis, preference, repo.ptr, anns_ref, anns_size) return analysis[], preference[] end @@ -142,7 +142,7 @@ function merge!(repo::GitRepo, anns::Vector{GitAnnotated}; checkout_opts::CheckoutOptions = CheckoutOptions()) anns_size = Csize_t(length(anns)) @check ccall((:git_merge, :libgit2), Cint, - (Ptr{Void}, Ptr{Ptr{Void}}, Csize_t, + (Ptr{Cvoid}, Ptr{Ptr{Cvoid}}, Csize_t, Ptr{MergeOptions}, Ptr{CheckoutOptions}), repo.ptr, map(x->x.ptr, anns), anns_size, Ref(merge_opts), Ref(checkout_opts)) @@ -255,7 +255,7 @@ function merge_base(repo::GitRepo, one::AbstractString, two::AbstractString) moid_ptr = Ref(GitHash()) moid = try @check ccall((:git_merge_base, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}, Ptr{GitHash}, Ptr{GitHash}), + (Ptr{GitHash}, Ptr{Cvoid}, Ptr{GitHash}, Ptr{GitHash}), moid_ptr, repo.ptr, oid1_ptr, oid2_ptr) moid_ptr[] catch e diff --git a/base/libgit2/oid.jl b/base/libgit2/oid.jl index 3a401c1b3bcb1..2500fe600b419 100644 --- a/base/libgit2/oid.jl +++ b/base/libgit2/oid.jl @@ -12,7 +12,7 @@ function GitHash(ptr::Ptr{UInt8}) throw(ArgumentError("NULL pointer passed to GitHash() constructor")) end oid_ptr = Ref(GitHash()) - ccall((:git_oid_fromraw, :libgit2), Void, (Ptr{GitHash}, Ptr{UInt8}), oid_ptr, ptr) + ccall((:git_oid_fromraw, :libgit2), Cvoid, (Ptr{GitHash}, Ptr{UInt8}), oid_ptr, ptr) return oid_ptr[] end @@ -107,7 +107,7 @@ function GitHash(ref::GitReference) isempty(ref) && return GitHash() reftype(ref) != Consts.REF_OID && return GitHash() Base.@gc_preserve ref begin - oid_ptr = ccall((:git_reference_target, :libgit2), Ptr{UInt8}, (Ptr{Void},), ref.ptr) + oid_ptr = ccall((:git_reference_target, :libgit2), Ptr{UInt8}, (Ptr{Cvoid},), ref.ptr) oid_ptr == C_NULL && return GitHash() oid = GitHash(oid_ptr) end @@ -125,7 +125,7 @@ function GitHash(repo::GitRepo, ref_name::AbstractString) isempty(repo) && return GitHash() oid_ptr = Ref(GitHash()) @check ccall((:git_reference_name_to_id, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}, Cstring), + (Ptr{GitHash}, Ptr{Cvoid}, Cstring), oid_ptr, repo.ptr, ref_name) return oid_ptr[] end @@ -136,7 +136,7 @@ end Get the identifier (`GitHash`) of `obj`. """ function GitHash(obj::GitObject) - GitHash(ccall((:git_object_id, :libgit2), Ptr{UInt8}, (Ptr{Void},), obj.ptr)) + GitHash(ccall((:git_object_id, :libgit2), Ptr{UInt8}, (Ptr{Cvoid},), obj.ptr)) end """ @@ -149,7 +149,7 @@ unambiuously identify the object in the repository. function GitShortHash(obj::GitObject) buf_ref = Ref(Buffer()) @check ccall((:git_object_short_id, :libgit2), Cint, - (Ptr{Buffer},Ptr{Void}), buf_ref, obj.ptr) + (Ptr{Buffer},Ptr{Cvoid}), buf_ref, obj.ptr) sid = GitShortHash(buf_ref[]) free(buf_ref) return sid diff --git a/base/libgit2/rebase.jl b/base/libgit2/rebase.jl index 030db04fef6d0..b59c827af75e7 100644 --- a/base/libgit2/rebase.jl +++ b/base/libgit2/rebase.jl @@ -1,19 +1,19 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license function GitRebase(repo::GitRepo, branch::GitAnnotated, upstream::GitAnnotated; - onto::Union{GitAnnotated, Void}=nothing, + onto::Union{GitAnnotated, Nothing}=nothing, opts::RebaseOptions = RebaseOptions()) - rebase_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + rebase_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_rebase_init, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Void}, Ptr{Void}, - Ptr{Void}, Ptr{RebaseOptions}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, + Ptr{Cvoid}, Ptr{RebaseOptions}), rebase_ptr_ptr, repo.ptr, branch.ptr, upstream.ptr, onto === nothing ? C_NULL : onto.ptr, Ref(opts)) return GitRebase(repo, rebase_ptr_ptr[]) end function Base.count(rb::GitRebase) - return ccall((:git_rebase_operation_entrycount, :libgit2), Csize_t, (Ptr{Void},), rb.ptr) + return ccall((:git_rebase_operation_entrycount, :libgit2), Csize_t, (Ptr{Cvoid},), rb.ptr) end """ @@ -25,7 +25,7 @@ has not yet been called or iteration over `rb` has not yet begun), return `GIT_REBASE_NO_OPERATION`, which is equal to `typemax(Csize_t)`. """ function current(rb::GitRebase) - return ccall((:git_rebase_operation_current, :libgit2), Csize_t, (Ptr{Void},), rb.ptr) + return ccall((:git_rebase_operation_current, :libgit2), Csize_t, (Ptr{Cvoid},), rb.ptr) end function Base.getindex(rb::GitRebase, i::Integer) @@ -35,7 +35,7 @@ function Base.getindex(rb::GitRebase, i::Integer) Base.@gc_preserve rb begin rb_op_ptr = ccall((:git_rebase_operation_byindex, :libgit2), Ptr{RebaseOperation}, - (Ptr{Void}, Csize_t), rb.ptr, i-1) + (Ptr{Cvoid}, Csize_t), rb.ptr, i-1) rb_op = unsafe_load(rb_op_ptr) end return rb_op @@ -46,7 +46,7 @@ function Base.next(rb::GitRebase) Base.@gc_preserve rb begin try @check ccall((:git_rebase_next, :libgit2), Cint, - (Ptr{Ptr{RebaseOperation}}, Ptr{Void}), + (Ptr{Ptr{RebaseOperation}}, Ptr{Cvoid}), rb_op_ptr_ptr, rb.ptr) catch err err.code == Error.ITEROVER && return nothing @@ -73,7 +73,7 @@ function commit(rb::GitRebase, sig::GitSignature) oid_ptr = Ref(GitHash()) try @check ccall((:git_rebase_commit, :libgit2), Error.Code, - (Ptr{GitHash}, Ptr{Void}, Ptr{SignatureStruct}, Ptr{SignatureStruct}, Ptr{UInt8}, Ptr{UInt8}), + (Ptr{GitHash}, Ptr{Cvoid}, Ptr{SignatureStruct}, Ptr{SignatureStruct}, Ptr{UInt8}, Ptr{UInt8}), oid_ptr, rb.ptr, C_NULL, sig.ptr, C_NULL, C_NULL) catch err # TODO: return current HEAD instead @@ -94,7 +94,7 @@ rebase had completed), and `-1` for other errors. """ function abort(rb::GitRebase) return ccall((:git_rebase_abort, :libgit2), Csize_t, - (Ptr{Void},), rb.ptr) + (Ptr{Cvoid},), rb.ptr) end """ @@ -106,6 +106,6 @@ rebase finishes successfully, `-1` if there is an error. """ function finish(rb::GitRebase, sig::GitSignature) return ccall((:git_rebase_finish, :libgit2), Csize_t, - (Ptr{Void}, Ptr{SignatureStruct}), + (Ptr{Cvoid}, Ptr{SignatureStruct}), rb.ptr, sig.ptr) end diff --git a/base/libgit2/reference.jl b/base/libgit2/reference.jl index af59f722fdaee..df37339806cc1 100644 --- a/base/libgit2/reference.jl +++ b/base/libgit2/reference.jl @@ -1,18 +1,18 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license function GitReference(repo::GitRepo, refname::AbstractString) - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_reference_lookup, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring), ref_ptr_ptr, repo.ptr, refname) return GitReference(repo, ref_ptr_ptr[]) end function GitReference(repo::GitRepo, obj_oid::GitHash, refname::AbstractString = Consts.HEAD_FILE; force::Bool=false, msg::AbstractString="") - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_reference_create, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{UInt8}, Ptr{GitHash}, Cint, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{UInt8}, Ptr{GitHash}, Cint, Cstring), ref_ptr_ptr, repo.ptr, refname, Ref(obj_oid), Cint(force), isempty(msg) ? C_NULL : msg) return GitReference(repo, ref_ptr_ptr[]) @@ -26,7 +26,7 @@ to this branch will have no parents. """ function isorphan(repo::GitRepo) r = @check ccall((:git_repository_head_unborn, :libgit2), Cint, - (Ptr{Void},), repo.ptr) + (Ptr{Cvoid},), repo.ptr) r != 0 end @@ -36,9 +36,9 @@ end Return a `GitReference` to the current HEAD of `repo`. """ function head(repo::GitRepo) - head_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + head_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_repository_head, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}), head_ptr_ptr, repo.ptr) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}), head_ptr_ptr, repo.ptr) return GitReference(repo, head_ptr_ptr[]) end @@ -63,7 +63,7 @@ julia> LibGit2.shortname(branch_ref) function shortname(ref::GitReference) isempty(ref) && return "" Base.@gc_preserve ref begin - name_ptr = ccall((:git_reference_shorthand, :libgit2), Cstring, (Ptr{Void},), ref.ptr) + name_ptr = ccall((:git_reference_shorthand, :libgit2), Cstring, (Ptr{Cvoid},), ref.ptr) name_ptr == C_NULL && return "" name = unsafe_string(name_ptr) end @@ -79,7 +79,7 @@ Return a `Cint` corresponding to the type of `ref`: * `2` if the reference is symbolic """ function reftype(ref::GitReference) - return ccall((:git_reference_type, :libgit2), Cint, (Ptr{Void},), ref.ptr) + return ccall((:git_reference_type, :libgit2), Cint, (Ptr{Cvoid},), ref.ptr) end """ @@ -93,7 +93,7 @@ function fullname(ref::GitReference) isempty(ref) && return "" reftype(ref) == Consts.REF_OID && return "" Base.@gc_preserve ref begin - rname = ccall((:git_reference_symbolic_target, :libgit2), Cstring, (Ptr{Void},), ref.ptr) + rname = ccall((:git_reference_symbolic_target, :libgit2), Cstring, (Ptr{Cvoid},), ref.ptr) rname == C_NULL && return "" name = unsafe_string(rname) end @@ -108,7 +108,7 @@ Return the full name of `ref`. function name(ref::GitReference) isempty(ref) && return "" Base.@gc_preserve ref begin - name_ptr = ccall((:git_reference_name, :libgit2), Cstring, (Ptr{Void},), ref.ptr) + name_ptr = ccall((:git_reference_name, :libgit2), Cstring, (Ptr{Cvoid},), ref.ptr) name_ptr == C_NULL && return "" name = unsafe_string(name_ptr) end @@ -120,7 +120,7 @@ function branch(ref::GitReference) str_ptr_ptr = Ref{Cstring}() Base.@gc_preserve ref begin @check ccall((:git_branch_name, :libgit2), Cint, - (Ptr{Cstring}, Ptr{Void},), str_ptr_ptr, ref.ptr) + (Ptr{Cstring}, Ptr{Cvoid},), str_ptr_ptr, ref.ptr) str = unsafe_string(str_ptr_ptr[]) end return str @@ -129,28 +129,28 @@ end function ishead(ref::GitReference) isempty(ref) && return false err = ccall((:git_branch_is_head, :libgit2), Cint, - (Ptr{Void},), ref.ptr) + (Ptr{Cvoid},), ref.ptr) return err == 1 end function isbranch(ref::GitReference) isempty(ref) && return false err = ccall((:git_reference_is_branch, :libgit2), Cint, - (Ptr{Void},), ref.ptr) + (Ptr{Cvoid},), ref.ptr) return err == 1 end function istag(ref::GitReference) isempty(ref) && return false err = ccall((:git_reference_is_tag, :libgit2), Cint, - (Ptr{Void},), ref.ptr) + (Ptr{Cvoid},), ref.ptr) return err == 1 end function isremote(ref::GitReference) isempty(ref) && return false err = ccall((:git_reference_is_remote, :libgit2), Cint, - (Ptr{Void},), ref.ptr) + (Ptr{Cvoid},), ref.ptr) return err == 1 end @@ -184,9 +184,9 @@ then `ref` will be peeled until an object other than a [`GitTag`](@ref) is obtai are references under `refs/tags/` which point directly to `GitCommit` objects. """ function peel(::Type{T}, ref::GitReference) where T<:GitObject - obj_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + obj_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_reference_peel, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cint), obj_ptr_ptr, ref.ptr, Consts.OBJECT(T)) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint), obj_ptr_ptr, ref.ptr, Consts.OBJECT(T)) return T(ref.owner, obj_ptr_ptr[]) end peel(ref::GitReference) = peel(GitObject, ref) @@ -199,7 +199,7 @@ Get a list of all reference names in the `repo` repository. function ref_list(repo::GitRepo) sa_ref = Ref(StrArrayStruct()) @check ccall((:git_reference_list, :libgit2), Cint, - (Ptr{StrArrayStruct}, Ptr{Void}), sa_ref, repo.ptr) + (Ptr{StrArrayStruct}, Ptr{Cvoid}), sa_ref, repo.ptr) res = convert(Vector{String}, sa_ref[]) free(sa_ref) res @@ -218,9 +218,9 @@ function create_branch(repo::GitRepo, bname::AbstractString, commit_obj::GitCommit; force::Bool=false) - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_branch_create, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Ptr{Void}, Cint), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Ptr{Cvoid}, Cint), ref_ptr_ptr, repo.ptr, bname, commit_obj.ptr, Cint(force)) return GitReference(repo, ref_ptr_ptr[]) end @@ -231,7 +231,7 @@ end Delete the branch pointed to by `branch`. """ function delete_branch(branch::GitReference) - @check ccall((:git_branch_delete, :libgit2), Cint, (Ptr{Void},), branch.ptr) + @check ccall((:git_branch_delete, :libgit2), Cint, (Ptr{Cvoid},), branch.ptr) end """ @@ -242,12 +242,12 @@ Set the HEAD of `repo` to the object pointed to by `ref`. function head!(repo::GitRepo, ref::GitReference) ref_name = name(ref) @check ccall((:git_repository_set_head, :libgit2), Cint, - (Ptr{Void}, Cstring), repo.ptr, ref_name) + (Ptr{Cvoid}, Cstring), repo.ptr, ref_name) return ref end """ - lookup_branch(repo::GitRepo, branch_name::AbstractString, remote::Bool=false) -> Union{GitReference, Void} + lookup_branch(repo::GitRepo, branch_name::AbstractString, remote::Bool=false) -> Union{GitReference, Nothing} Determine if the branch specified by `branch_name` exists in the repository `repo`. If `remote` is `true`, `repo` is assumed to be a remote git repository. Otherwise, it @@ -259,10 +259,10 @@ if it exists, or [`nothing`](@ref) if not. function lookup_branch(repo::GitRepo, branch_name::AbstractString, remote::Bool=false) - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) branch_type = remote ? Consts.BRANCH_REMOTE : Consts.BRANCH_LOCAL err = ccall((:git_branch_lookup, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{UInt8}, Cint), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{UInt8}, Cint), ref_ptr_ptr, repo.ptr, branch_name, branch_type) if err != Int(Error.GIT_OK) if err == Int(Error.ENOTFOUND) @@ -277,7 +277,7 @@ function lookup_branch(repo::GitRepo, end """ - upstream(ref::GitReference) -> Union{GitReference, Void} + upstream(ref::GitReference) -> Union{GitReference, Nothing} Determine if the branch containing `ref` has a specified upstream branch. @@ -286,9 +286,9 @@ or [`nothing`](@ref) if the requested branch does not have an upstream counterpa """ function upstream(ref::GitReference) isempty(ref) && return nothing - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) err = ccall((:git_branch_upstream, :libgit2), Cint, - (Ref{Ptr{Void}}, Ptr{Void},), ref_ptr_ptr, ref.ptr) + (Ref{Ptr{Cvoid}}, Ptr{Cvoid},), ref_ptr_ptr, ref.ptr) if err != Int(Error.GIT_OK) if err == Int(Error.ENOTFOUND) return nothing @@ -304,25 +304,25 @@ end repository(ref::GitReference) = ref.owner function target!(ref::GitReference, new_oid::GitHash; msg::AbstractString="") - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_reference_set_target, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{GitHash}, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{GitHash}, Cstring), ref_ptr_ptr, ref.ptr, Ref(new_oid), isempty(msg) ? C_NULL : msg) return GitReference(ref.owner, ref_ptr_ptr[]) end function GitBranchIter(repo::GitRepo, flags::Cint=Cint(Consts.BRANCH_LOCAL)) - bi_ptr = Ref{Ptr{Void}}(C_NULL) + bi_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_branch_iterator_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cint), bi_ptr, repo.ptr, flags) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint), bi_ptr, repo.ptr, flags) return GitBranchIter(repo, bi_ptr[]) end function Base.start(bi::GitBranchIter) - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) btype = Ref{Cint}() err = ccall((:git_branch_next, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Cint}, Ptr{Void}), + (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}), ref_ptr_ptr, btype, bi.ptr) err != Int(Error.GIT_OK) && return (nothing, -1, true) return (GitReference(bi.owner, ref_ptr_ptr[]), btype[], false) @@ -331,10 +331,10 @@ end Base.done(bi::GitBranchIter, state) = Bool(state[3]) function Base.next(bi::GitBranchIter, state) - ref_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + ref_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) btype = Ref{Cint}() err = ccall((:git_branch_next, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Cint}, Ptr{Void}), + (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}), ref_ptr_ptr, btype, bi.ptr) err != Int(Error.GIT_OK) && return (state[1:2], (nothing, -1, true)) return (state[1:2], (GitReference(bi.owner, ref_ptr_ptr[]), btype[], false)) diff --git a/base/libgit2/remote.jl b/base/libgit2/remote.jl index a03a5a0eb1799..09a6b9a6ab6ec 100644 --- a/base/libgit2/remote.jl +++ b/base/libgit2/remote.jl @@ -12,9 +12,9 @@ remote = LibGit2.GitRemote(repo, "upstream", repo_url) ``` """ function GitRemote(repo::GitRepo, rmt_name::AbstractString, rmt_url::AbstractString) - rmt_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + rmt_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_remote_create, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring), rmt_ptr_ptr, repo.ptr, rmt_name, rmt_url) return GitRemote(repo, rmt_ptr_ptr[]) end @@ -34,9 +34,9 @@ remote = LibGit2.GitRemote(repo, "upstream", repo_url, refspec) ``` """ function GitRemote(repo::GitRepo, rmt_name::AbstractString, rmt_url::AbstractString, fetch_spec::AbstractString) - rmt_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + rmt_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_remote_create_with_fetchspec, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring, Cstring, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring, Cstring, Cstring), rmt_ptr_ptr, repo.ptr, rmt_name, rmt_url, fetch_spec) return GitRemote(repo, rmt_ptr_ptr[]) end @@ -53,15 +53,15 @@ remote = LibGit2.GitRemoteAnon(repo, repo_url) ``` """ function GitRemoteAnon(repo::GitRepo, url::AbstractString) - rmt_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + rmt_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_remote_create_anonymous, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring), rmt_ptr_ptr, repo.ptr, url) return GitRemote(repo, rmt_ptr_ptr[]) end """ - lookup_remote(repo::GitRepo, remote_name::AbstractString) -> Union{GitRemote, Void} + lookup_remote(repo::GitRepo, remote_name::AbstractString) -> Union{GitRemote, Nothing} Determine if the `remote_name` specified exists within the `repo`. Return either a [`GitRemote`](@ref) to the remote name if it exists, or [`nothing`](@ref) @@ -75,9 +75,9 @@ LibGit2.lookup_remote(repo, remote_name) # will return nothing ``` """ function lookup_remote(repo::GitRepo, remote_name::AbstractString) - rmt_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + rmt_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) err = ccall((:git_remote_lookup, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring), rmt_ptr_ptr, repo.ptr, remote_name) if err == Int(Error.GIT_OK) return GitRemote(repo, rmt_ptr_ptr[]) @@ -89,9 +89,9 @@ function lookup_remote(repo::GitRepo, remote_name::AbstractString) end function get(::Type{GitRemote}, repo::GitRepo, rmt_name::AbstractString) - rmt_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + rmt_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_remote_lookup, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring), rmt_ptr_ptr, repo.ptr, rmt_name) return GitRemote(repo, rmt_ptr_ptr[]) end @@ -114,7 +114,7 @@ julia> LibGit2.url(remote) ``` """ function url(rmt::GitRemote) - url_ptr = ccall((:git_remote_url, :libgit2), Cstring, (Ptr{Void},), rmt.ptr) + url_ptr = ccall((:git_remote_url, :libgit2), Cstring, (Ptr{Cvoid},), rmt.ptr) url_ptr == C_NULL && return "" return unsafe_string(url_ptr) end @@ -137,7 +137,7 @@ julia> LibGit2.push_url(LibGit2.get(LibGit2.GitRemote, repo, "origin")) ``` """ function push_url(rmt::GitRemote) - url_ptr = ccall((:git_remote_pushurl, :libgit2), Cstring, (Ptr{Void},), rmt.ptr) + url_ptr = ccall((:git_remote_pushurl, :libgit2), Cstring, (Ptr{Cvoid},), rmt.ptr) url_ptr == C_NULL && return "" return unsafe_string(url_ptr) end @@ -162,7 +162,7 @@ julia> name(remote) ``` """ function name(rmt::GitRemote) - name_ptr = ccall((:git_remote_name, :libgit2), Cstring, (Ptr{Void},), rmt.ptr) + name_ptr = ccall((:git_remote_name, :libgit2), Cstring, (Ptr{Cvoid},), rmt.ptr) name_ptr == C_NULL && return "" return unsafe_string(name_ptr) end @@ -186,7 +186,7 @@ String["+refs/heads/*:refs/remotes/upstream/*"] function fetch_refspecs(rmt::GitRemote) sa_ref = Ref(StrArrayStruct()) @check ccall((:git_remote_get_fetch_refspecs, :libgit2), Cint, - (Ptr{StrArrayStruct}, Ptr{Void}), sa_ref, rmt.ptr) + (Ptr{StrArrayStruct}, Ptr{Cvoid}), sa_ref, rmt.ptr) res = convert(Vector{String}, sa_ref[]) free(sa_ref) res @@ -215,7 +215,7 @@ String["refs/heads/master"] function push_refspecs(rmt::GitRemote) sa_ref = Ref(StrArrayStruct()) @check ccall((:git_remote_get_push_refspecs, :libgit2), Cint, - (Ptr{StrArrayStruct}, Ptr{Void}), sa_ref, rmt.ptr) + (Ptr{StrArrayStruct}, Ptr{Cvoid}), sa_ref, rmt.ptr) res = convert(Vector{String}, sa_ref[]) free(sa_ref) res @@ -237,7 +237,7 @@ String["+refs/heads/*:refs/remotes/upstream/*"] """ function add_fetch!(repo::GitRepo, rmt::GitRemote, fetch_spec::String) @check ccall((:git_remote_add_fetch, :libgit2), Cint, - (Ptr{Void}, Cstring, Cstring), repo.ptr, + (Ptr{Cvoid}, Cstring, Cstring), repo.ptr, name(rmt), fetch_spec) end @@ -265,7 +265,7 @@ String["refs/heads/master"] """ function add_push!(repo::GitRepo, rmt::GitRemote, push_spec::String) @check ccall((:git_remote_add_push, :libgit2), Cint, - (Ptr{Void}, Cstring, Cstring), repo.ptr, + (Ptr{Cvoid}, Cstring, Cstring), repo.ptr, name(rmt), push_spec) end @@ -284,7 +284,7 @@ function fetch(rmt::GitRemote, refspecs::Vector{<:AbstractString}; msg::AbstractString="") msg = "libgit2.fetch: $msg" @check ccall((:git_remote_fetch, :libgit2), Cint, - (Ptr{Void}, Ptr{StrArrayStruct}, Ptr{FetchOptions}, Cstring), + (Ptr{Cvoid}, Ptr{StrArrayStruct}, Ptr{FetchOptions}, Cstring), rmt.ptr, isempty(refspecs) ? C_NULL : refspecs, Ref(options), msg) end @@ -308,18 +308,18 @@ The keyword arguments are: function push(rmt::GitRemote, refspecs::Vector{<:AbstractString}; force::Bool = false, options::PushOptions = PushOptions()) @check ccall((:git_remote_push, :libgit2), Cint, - (Ptr{Void}, Ptr{StrArrayStruct}, Ptr{PushOptions}), + (Ptr{Cvoid}, Ptr{StrArrayStruct}, Ptr{PushOptions}), rmt.ptr, isempty(refspecs) ? C_NULL : refspecs, Ref(options)) end """ - remote_delete(repo::GitRepo, remote_name::AbstractString) -> Void + remote_delete(repo::GitRepo, remote_name::AbstractString) -> Nothing Delete the `remote_name` from the git `repo`. """ function remote_delete(repo::GitRepo, remote_name::AbstractString) @check ccall((:git_remote_delete, :libgit2), Cint, - (Ptr{Void}, Cstring), + (Ptr{Cvoid}, Cstring), repo.ptr, remote_name) end @@ -337,7 +337,7 @@ function set_remote_fetch_url end function set_remote_fetch_url(repo::GitRepo, remote_name::AbstractString, url::AbstractString) @check ccall((:git_remote_set_url, :libgit2), Cint, - (Ptr{Void}, Cstring, Cstring), + (Ptr{Cvoid}, Cstring, Cstring), repo.ptr, remote_name, url) end @@ -359,7 +359,7 @@ function set_remote_push_url end function set_remote_push_url(repo::GitRepo, remote_name::AbstractString, url::AbstractString) @check ccall((:git_remote_set_pushurl, :libgit2), Cint, - (Ptr{Void}, Cstring, Cstring), + (Ptr{Cvoid}, Cstring, Cstring), repo.ptr, remote_name, url) end diff --git a/base/libgit2/repository.jl b/base/libgit2/repository.jl index 6a00beb80ec43..8cf9cac3439f3 100644 --- a/base/libgit2/repository.jl +++ b/base/libgit2/repository.jl @@ -6,9 +6,9 @@ Open a git repository at `path`. """ function GitRepo(path::AbstractString) - repo_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + repo_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_repository_open, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring), repo_ptr_ptr, path) + (Ptr{Ptr{Cvoid}}, Cstring), repo_ptr_ptr, path) return GitRepo(repo_ptr_ptr[]) end @@ -20,16 +20,16 @@ user must be a member of a special access group to read `path`). """ function GitRepoExt(path::AbstractString, flags::Cuint = Cuint(Consts.REPOSITORY_OPEN_DEFAULT)) separator = @static Sys.iswindows() ? ";" : ":" - repo_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + repo_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_repository_open_ext, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring, Cuint, Cstring), + (Ptr{Ptr{Cvoid}}, Cstring, Cuint, Cstring), repo_ptr_ptr, path, flags, separator) return GitRepo(repo_ptr_ptr[]) end function cleanup(r::GitRepo) if r.ptr != C_NULL - ccall((:git_repository__cleanup, :libgit2), Void, (Ptr{Void},), r.ptr) + ccall((:git_repository__cleanup, :libgit2), Cvoid, (Ptr{Cvoid},), r.ptr) end end @@ -41,9 +41,9 @@ the working tree will be created in `path/.git`. If `bare` is `true`, no working directory will be created. """ function init(path::AbstractString, bare::Bool=false) - repo_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + repo_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_repository_init, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring, Cuint), repo_ptr_ptr, path, bare) + (Ptr{Ptr{Cvoid}}, Cstring, Cuint), repo_ptr_ptr, path, bare) return GitRepo(repo_ptr_ptr[]) end @@ -91,7 +91,7 @@ in the `.git` subdirectory. This means that there is nowhere to check out the wo tree, and no tracking information for remote branches or configurations is present. """ function isbare(repo::GitRepo) - return ccall((:git_repository_is_bare, :libgit2), Cint, (Ptr{Void},), repo.ptr) == 1 + return ccall((:git_repository_is_bare, :libgit2), Cint, (Ptr{Cvoid},), repo.ptr) == 1 end """ @@ -101,7 +101,7 @@ Determine if `repo` is detached - that is, whether its HEAD points to a commit (detached) or whether HEAD points to a branch tip (attached). """ function isattached(repo::GitRepo) - ccall((:git_repository_head_detached, :libgit2), Cint, (Ptr{Void},), repo.ptr) != 1 + ccall((:git_repository_head_detached, :libgit2), Cint, (Ptr{Cvoid},), repo.ptr) != 1 end @doc """ @@ -128,9 +128,9 @@ Return a `$T` object from `repo` specified by `hash`/`spec`. end function (::Type{T})(repo::GitRepo, spec::AbstractString) where T<:GitObject - obj_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + obj_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_revparse_single, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), obj_ptr_ptr, repo.ptr, spec) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cstring), obj_ptr_ptr, repo.ptr, spec) # check object is of correct type if T != GitObject && T != GitUnknownObject t = Consts.OBJECT(obj_ptr_ptr[]) @@ -141,20 +141,20 @@ end function (::Type{T})(repo::GitRepo, oid::GitHash) where T<:GitObject oid_ptr = Ref(oid) - obj_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + obj_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_object_lookup, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{GitHash}, Consts.OBJECT), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{GitHash}, Consts.OBJECT), obj_ptr_ptr, repo.ptr, oid_ptr, Consts.OBJECT(T)) return T(repo, obj_ptr_ptr[]) end function (::Type{T})(repo::GitRepo, oid::GitShortHash) where T<:GitObject oid_ptr = Ref(oid.hash) - obj_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + obj_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_object_lookup_prefix, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{GitHash}, Csize_t, Consts.OBJECT), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{GitHash}, Csize_t, Consts.OBJECT), obj_ptr_ptr, repo.ptr, oid_ptr, oid.len, Consts.OBJECT(T)) return T(repo, obj_ptr_ptr[]) @@ -175,7 +175,7 @@ See also [`workdir`](@ref), [`path`](@ref). """ function gitdir(repo::GitRepo) return unsafe_string(ccall((:git_repository_path, :libgit2), Cstring, - (Ptr{Void},), repo.ptr)) + (Ptr{Cvoid},), repo.ptr)) end """ @@ -194,7 +194,7 @@ See also [`gitdir`](@ref), [`path`](@ref). """ function workdir(repo::GitRepo) sptr = ccall((:git_repository_workdir, :libgit2), Cstring, - (Ptr{Void},), repo.ptr) + (Ptr{Cvoid},), repo.ptr) sptr == C_NULL && throw(GitError(Error.Object, Error.ERROR, "No working directory found.")) return unsafe_string(sptr) end @@ -234,10 +234,10 @@ then `obj` will be peeled until the type changes. - A `GitCommit` will be peeled to a `GitTree`. """ function peel(::Type{T}, obj::GitObject) where T<:GitObject - new_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + new_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_object_peel, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Cint), new_ptr_ptr, obj.ptr, Consts.OBJECT(T)) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint), new_ptr_ptr, obj.ptr, Consts.OBJECT(T)) return T(obj.owner, new_ptr_ptr[]) end @@ -264,9 +264,9 @@ information. """ function GitDescribeResult(commitish::GitObject; options::DescribeOptions=DescribeOptions()) - result_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + result_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_describe_commit, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{DescribeOptions}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{DescribeOptions}), result_ptr_ptr, commitish.ptr, Ref(options)) return GitDescribeResult(commitish.owner, result_ptr_ptr[]) end @@ -289,9 +289,9 @@ Equivalent to `git describe`. See [`DescribeOptions`](@ref) for more information. """ function GitDescribeResult(repo::GitRepo; options::DescribeOptions=DescribeOptions()) - result_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + result_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_describe_workdir, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{DescribeOptions}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{DescribeOptions}), result_ptr_ptr, repo.ptr, Ref(options)) return GitDescribeResult(repo, result_ptr_ptr[]) end @@ -307,7 +307,7 @@ Formatting options are controlled by the keyword argument: function format(result::GitDescribeResult; options::DescribeFormatOptions=DescribeFormatOptions()) buf_ref = Ref(Buffer()) @check ccall((:git_describe_format, :libgit2), Cint, - (Ptr{Buffer}, Ptr{Void}, Ptr{DescribeFormatOptions}), + (Ptr{Buffer}, Ptr{Cvoid}, Ptr{DescribeFormatOptions}), buf_ref, result.ptr, Ref(options)) buf = buf_ref[] str = unsafe_string(buf.ptr, buf.size) @@ -331,21 +331,21 @@ be performed. See [`CheckoutOptions`](@ref) for more information. function checkout_tree(repo::GitRepo, obj::GitObject; options::CheckoutOptions = CheckoutOptions()) @check ccall((:git_checkout_tree, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}, Ptr{CheckoutOptions}), + (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{CheckoutOptions}), repo.ptr, obj.ptr, Ref(options)) end """ - checkout_index(repo::GitRepo, idx::Union{GitIndex, Void} = nothing; options::CheckoutOptions = CheckoutOptions()) + checkout_index(repo::GitRepo, idx::Union{GitIndex, Nothing} = nothing; options::CheckoutOptions = CheckoutOptions()) Update the working tree of `repo` to match the index `idx`. If `idx` is `nothing`, the index of `repo` will be used. `options` controls how the checkout will be performed. See [`CheckoutOptions`](@ref) for more information. """ -function checkout_index(repo::GitRepo, idx::Union{GitIndex, Void} = nothing; +function checkout_index(repo::GitRepo, idx::Union{GitIndex, Nothing} = nothing; options::CheckoutOptions = CheckoutOptions()) @check ccall((:git_checkout_index, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}, Ptr{CheckoutOptions}), + (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{CheckoutOptions}), repo.ptr, idx === nothing ? C_NULL : idx.ptr, Ref(options)) @@ -363,7 +363,7 @@ Update the index and working tree of `repo` to match the commit pointed to by HE """ function checkout_head(repo::GitRepo; options::CheckoutOptions = CheckoutOptions()) @check ccall((:git_checkout_head, :libgit2), Cint, - (Ptr{Void}, Ptr{CheckoutOptions}), + (Ptr{Cvoid}, Ptr{CheckoutOptions}), repo.ptr, Ref(options)) end @@ -380,14 +380,14 @@ The keyword argument `options` sets checkout and merge options for the cherrypic """ function cherrypick(repo::GitRepo, commit::GitCommit; options::CherrypickOptions = CherrypickOptions()) @check ccall((:git_cherrypick, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}, Ptr{CherrypickOptions}), + (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{CherrypickOptions}), repo.ptr, commit.ptr, Ref(options)) end """Updates some entries, determined by the `pathspecs`, in the index from the target commit tree.""" -function reset!(repo::GitRepo, obj::Union{GitObject, Void}, pathspecs::AbstractString...) +function reset!(repo::GitRepo, obj::Union{GitObject, Nothing}, pathspecs::AbstractString...) @check ccall((:git_reset_default, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}, Ptr{StrArrayStruct}), + (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{StrArrayStruct}), repo.ptr, obj === nothing ? C_NULL : obj.ptr, collect(pathspecs)) @@ -398,7 +398,7 @@ end function reset!(repo::GitRepo, obj::GitObject, mode::Cint; checkout_opts::CheckoutOptions = CheckoutOptions()) @check ccall((:git_reset, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}, Cint, Ptr{CheckoutOptions}), + (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Ptr{CheckoutOptions}), repo.ptr, obj.ptr, mode, Ref(checkout_opts)) return head_oid(repo) end @@ -419,9 +419,9 @@ repo = LibGit2.clone(repo_url, "/home/me/projects/Example") function clone(repo_url::AbstractString, repo_path::AbstractString, clone_opts::CloneOptions) clone_opts_ref = Ref(clone_opts) - repo_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + repo_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_clone, :libgit2), Cint, - (Ptr{Ptr{Void}}, Cstring, Cstring, Ref{CloneOptions}), + (Ptr{Ptr{Cvoid}}, Cstring, Cstring, Ref{CloneOptions}), repo_ptr_ptr, repo_url, repo_path, clone_opts_ref) return GitRepo(repo_ptr_ptr[]) end @@ -453,7 +453,7 @@ function fetchheads(repo::GitRepo) fh = FetchHead[] ffcb = fetchhead_foreach_cb() @check ccall((:git_repository_fetchhead_foreach, :libgit2), Cint, - (Ptr{Void}, Ptr{Void}, Any), + (Ptr{Cvoid}, Ptr{Cvoid}, Any), repo.ptr, ffcb, fh) return fh end @@ -466,7 +466,7 @@ Return a vector of the names of the remotes of `repo`. function remotes(repo::GitRepo) sa_ref = Ref(StrArrayStruct()) @check ccall((:git_remote_list, :libgit2), Cint, - (Ptr{StrArrayStruct}, Ptr{Void}), sa_ref, repo.ptr) + (Ptr{StrArrayStruct}, Ptr{Cvoid}), sa_ref, repo.ptr) res = convert(Vector{String}, sa_ref[]) free(sa_ref) return res diff --git a/base/libgit2/signature.jl b/base/libgit2/signature.jl index 3804d81a23bd3..bcb6a41164e87 100644 --- a/base/libgit2/signature.jl +++ b/base/libgit2/signature.jl @@ -64,6 +64,6 @@ end function default_signature(repo::GitRepo) sig_ptr_ptr = Ref{Ptr{SignatureStruct}}(C_NULL) @check ccall((:git_signature_default, :libgit2), Cint, - (Ptr{Ptr{SignatureStruct}}, Ptr{Void}), sig_ptr_ptr, repo.ptr) + (Ptr{Ptr{SignatureStruct}}, Ptr{Cvoid}), sig_ptr_ptr, repo.ptr) return GitSignature(sig_ptr_ptr[]) end diff --git a/base/libgit2/status.jl b/base/libgit2/status.jl index f31b643139ca6..52fb8128bf8a0 100644 --- a/base/libgit2/status.jl +++ b/base/libgit2/status.jl @@ -10,16 +10,16 @@ whether or not to look at untracked files or whether to include submodules or not. See [`StatusOptions`](@ref) for more information. """ function GitStatus(repo::GitRepo; status_opts=StatusOptions()) - stat_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + stat_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_status_list_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ptr{StatusOptions}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{StatusOptions}), stat_ptr_ptr, repo.ptr, Ref(status_opts)) return GitStatus(repo, stat_ptr_ptr[]) end function Base.length(status::GitStatus) return Int(ccall((:git_status_list_entrycount, :libgit2), Csize_t, - (Ptr{Ptr{Void}},), status.ptr)) + (Ptr{Ptr{Cvoid}},), status.ptr)) end function Base.getindex(status::GitStatus, i::Integer) @@ -27,7 +27,7 @@ function Base.getindex(status::GitStatus, i::Integer) Base.@gc_preserve status begin entry_ptr = ccall((:git_status_byindex, :libgit2), Ptr{StatusEntry}, - (Ptr{Void}, Csize_t), + (Ptr{Cvoid}, Csize_t), status.ptr, i-1) entry_ptr == C_NULL && throw(Error.GitError(Error.ERROR)) entry = unsafe_load(entry_ptr) @@ -36,7 +36,7 @@ function Base.getindex(status::GitStatus, i::Integer) end """ - LibGit2.status(repo::GitRepo, path::String) -> Union{Cuint, Void} + LibGit2.status(repo::GitRepo, path::String) -> Union{Cuint, Cvoid} Lookup the status of the file at `path` in the git repository `repo`. For instance, this can be used @@ -46,7 +46,7 @@ and needs to be staged and committed. function status(repo::GitRepo, path::String) status_ptr = Ref{Cuint}(0) ret = ccall((:git_status_file, :libgit2), Cint, - (Ref{Cuint}, Ptr{Void}, Cstring), + (Ref{Cuint}, Ptr{Cvoid}, Cstring), status_ptr, repo.ptr, path) (ret == Cint(Error.ENOTFOUND) || ret == Cint(Error.EAMBIGUOUS)) && return nothing return status_ptr[] diff --git a/base/libgit2/tag.jl b/base/libgit2/tag.jl index ed162cbeb0c06..53bcf713f0ebc 100644 --- a/base/libgit2/tag.jl +++ b/base/libgit2/tag.jl @@ -8,7 +8,7 @@ Get a list of all tags in the git repository `repo`. function tag_list(repo::GitRepo) sa_ref = Ref(StrArrayStruct()) @check ccall((:git_tag_list, :libgit2), Cint, - (Ptr{StrArrayStruct}, Ptr{Void}), sa_ref, repo.ptr) + (Ptr{StrArrayStruct}, Ptr{Cvoid}), sa_ref, repo.ptr) res = convert(Vector{String}, sa_ref[]) free(sa_ref) res @@ -21,7 +21,7 @@ Remove the git tag `tag` from the repository `repo`. """ function tag_delete(repo::GitRepo, tag::AbstractString) @check ccall((:git_tag_delete, :libgit2), Cint, - (Ptr{Void}, Cstring), repo.ptr, tag) + (Ptr{Cvoid}, Cstring), repo.ptr, tag) end """ @@ -44,7 +44,7 @@ function tag_create(repo::GitRepo, tag::AbstractString, commit::Union{AbstractSt commit_obj === nothing && return oid_ptr[] # return empty oid with(convert(GitSignature, sig)) do git_sig @check ccall((:git_tag_create, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}, Cstring, Ptr{Void}, Ptr{SignatureStruct}, Cstring, Cint), + (Ptr{GitHash}, Ptr{Cvoid}, Cstring, Ptr{Cvoid}, Ptr{SignatureStruct}, Cstring, Cint), oid_ptr, repo.ptr, tag, commit_obj.ptr, git_sig.ptr, msg, Cint(force)) end end @@ -58,7 +58,7 @@ The name of `tag` (e.g. `"v0.5"`). """ function name(tag::GitTag) Base.@gc_preserve tag begin - str_ptr = ccall((:git_tag_name, :libgit2), Cstring, (Ptr{Void},), tag.ptr) + str_ptr = ccall((:git_tag_name, :libgit2), Cstring, (Ptr{Cvoid},), tag.ptr) str_ptr == C_NULL && throw(Error.GitError(Error.ERROR)) str = unsafe_string(str_ptr) end @@ -73,7 +73,7 @@ The `GitHash` of the target object of `tag`. """ function target(tag::GitTag) Base.@gc_preserve tag begin - oid_ptr = ccall((:git_tag_target_id, :libgit2), Ptr{GitHash}, (Ptr{Void},), tag.ptr) + oid_ptr = ccall((:git_tag_target_id, :libgit2), Ptr{GitHash}, (Ptr{Cvoid},), tag.ptr) oid_ptr == C_NULL && throw(Error.GitError(Error.ERROR)) str = unsafe_load(oid_ptr) end diff --git a/base/libgit2/tree.jl b/base/libgit2/tree.jl index 8dc6ec146cbc7..faf22e6b35eba 100644 --- a/base/libgit2/tree.jl +++ b/base/libgit2/tree.jl @@ -12,16 +12,16 @@ subtree, traversing upwards through it, then traversing the next right subtree The function parameter `f` should have following signature: - (Cstring, Ptr{Void}, Ptr{Void}) -> Cint + (Cstring, Ptr{Cvoid}, Ptr{Cvoid}) -> Cint A negative value returned from `f` stops the tree walk. A positive value means that the entry will be skipped if `post` is `false`. """ function treewalk(f::Function, tree::GitTree, payload=Any[], post::Bool = false) - cbf = cfunction(f, Cint, Tuple{Cstring, Ptr{Void}, Ptr{Void}}) + cbf = cfunction(f, Cint, Tuple{Cstring, Ptr{Cvoid}, Ptr{Cvoid}}) cbf_payload = Ref{typeof(payload)}(payload) @check ccall((:git_tree_walk, :libgit2), Cint, - (Ptr{Void}, Cint, Ptr{Void}, Ptr{Void}), + (Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}), tree.ptr, post, cbf, cbf_payload) return cbf_payload end @@ -35,7 +35,7 @@ repository(te::GitTreeEntry) = repository(te.owner) Return the filename of the object on disk to which `te` refers. """ function filename(te::GitTreeEntry) - str = ccall((:git_tree_entry_name, :libgit2), Cstring, (Ptr{Void},), te.ptr) + str = ccall((:git_tree_entry_name, :libgit2), Cstring, (Ptr{Cvoid},), te.ptr) str != C_NULL && return unsafe_string(str) return nothing end @@ -46,7 +46,7 @@ end Return the UNIX filemode of the object on disk to which `te` refers as an integer. """ function filemode(te::GitTreeEntry) - return ccall((:git_tree_entry_filemode, :libgit2), Cint, (Ptr{Void},), te.ptr) + return ccall((:git_tree_entry_filemode, :libgit2), Cint, (Ptr{Cvoid},), te.ptr) end """ @@ -56,7 +56,7 @@ Return the type of the object to which `te` refers. The result will be one of the types which [`objtype`](@ref) returns, e.g. a `GitTree` or `GitBlob`. """ function entrytype(te::GitTreeEntry) - otype = ccall((:git_tree_entry_type, :libgit2), Cint, (Ptr{Void},), te.ptr) + otype = ccall((:git_tree_entry_type, :libgit2), Cint, (Ptr{Cvoid},), te.ptr) return objtype(Consts.OBJECT(otype)) end @@ -67,14 +67,14 @@ Return the [`GitHash`](@ref) of the object to which `te` refers. """ function entryid(te::GitTreeEntry) Base.@gc_preserve te begin - oid_ptr = ccall((:git_tree_entry_id, :libgit2), Ptr{UInt8}, (Ptr{Void},), te.ptr) + oid_ptr = ccall((:git_tree_entry_id, :libgit2), Ptr{UInt8}, (Ptr{Cvoid},), te.ptr) oid = GitHash(oid_ptr) end return oid end function Base.count(tree::GitTree) - return ccall((:git_tree_entrycount, :libgit2), Csize_t, (Ptr{Void},), tree.ptr) + return ccall((:git_tree_entrycount, :libgit2), Csize_t, (Ptr{Cvoid},), tree.ptr) end function Base.getindex(tree::GitTree, i::Integer) @@ -82,8 +82,8 @@ function Base.getindex(tree::GitTree, i::Integer) throw(BoundsError(tree, i)) end te_ptr = ccall((:git_tree_entry_byindex, :libgit2), - Ptr{Void}, - (Ptr{Void}, Csize_t), tree.ptr, i-1) + Ptr{Cvoid}, + (Ptr{Cvoid}, Csize_t), tree.ptr, i-1) return GitTreeEntry(tree, te_ptr, false) end @@ -103,9 +103,9 @@ blob = LibGit2.GitBlob(tree_entry) function GitObject(e::GitTreeEntry) end function (::Type{T})(te::GitTreeEntry) where T<:GitObject repo = repository(te) - obj_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + obj_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_tree_entry_to_object, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}, Ref{Void}), + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ref{Nothing}), obj_ptr_ptr, repo.ptr, te.ptr) return T(repo, obj_ptr_ptr[]) end diff --git a/base/libgit2/types.jl b/base/libgit2/types.jl index f8b552af32f5e..3bc83ade4a47d 100644 --- a/base/libgit2/types.jl +++ b/base/libgit2/types.jl @@ -93,7 +93,7 @@ end StrArrayStruct() = StrArrayStruct(C_NULL, 0) function free(sa_ref::Base.Ref{StrArrayStruct}) - ccall((:git_strarray_free, :libgit2), Void, (Ptr{StrArrayStruct},), sa_ref) + ccall((:git_strarray_free, :libgit2), Cvoid, (Ptr{StrArrayStruct},), sa_ref) end """ @@ -119,7 +119,7 @@ end Buffer() = Buffer(C_NULL, 0, 0) function free(buf_ref::Base.Ref{Buffer}) - ccall((:git_buf_free, :libgit2), Void, (Ptr{Buffer},), buf_ref) + ccall((:git_buf_free, :libgit2), Cvoid, (Ptr{Buffer},), buf_ref) end """ @@ -166,42 +166,42 @@ The fields represent: file_open_flags::Cint notify_flags::Cuint = Consts.CHECKOUT_NOTIFY_NONE - notify_cb::Ptr{Void} - notify_payload::Ptr{Void} + notify_cb::Ptr{Cvoid} + notify_payload::Ptr{Cvoid} - progress_cb::Ptr{Void} - progress_payload::Ptr{Void} + progress_cb::Ptr{Cvoid} + progress_payload::Ptr{Cvoid} paths::StrArrayStruct - baseline::Ptr{Void} - baseline_index::Ptr{Void} + baseline::Ptr{Cvoid} + baseline_index::Ptr{Cvoid} target_directory::Cstring ancestor_label::Cstring our_label::Cstring their_label::Cstring - perfdata_cb::Ptr{Void} - perfdata_payload::Ptr{Void} + perfdata_cb::Ptr{Cvoid} + perfdata_payload::Ptr{Cvoid} end abstract type Payload end @kwdef struct RemoteCallbacksStruct version::Cuint = 1 - sideband_progress::Ptr{Void} - completion::Ptr{Void} - credentials::Ptr{Void} - certificate_check::Ptr{Void} - transfer_progress::Ptr{Void} - update_tips::Ptr{Void} - pack_progress::Ptr{Void} - push_transfer_progress::Ptr{Void} - push_update_reference::Ptr{Void} - push_negotiation::Ptr{Void} - transport::Ptr{Void} - payload::Ptr{Void} + sideband_progress::Ptr{Cvoid} + completion::Ptr{Cvoid} + credentials::Ptr{Cvoid} + certificate_check::Ptr{Cvoid} + transfer_progress::Ptr{Cvoid} + update_tips::Ptr{Cvoid} + pack_progress::Ptr{Cvoid} + push_transfer_progress::Ptr{Cvoid} + push_update_reference::Ptr{Cvoid} + push_negotiation::Ptr{Cvoid} + transport::Ptr{Cvoid} + payload::Ptr{Cvoid} end """ @@ -213,12 +213,12 @@ Matches the [`git_remote_callbacks`](https://libgit2.github.com/libgit2/#HEAD/ty struct RemoteCallbacks cb::RemoteCallbacksStruct gcroot::Ref{Any} - function RemoteCallbacks(; payload::Union{Payload, Void}=nothing, kwargs...) + function RemoteCallbacks(; payload::Union{Payload, Nothing}=nothing, kwargs...) p = Ref{Any}(payload) if payload === nothing pp = C_NULL else - pp = unsafe_load(Ptr{Ptr{Void}}(Base.unsafe_convert(Ptr{Any}, p))) + pp = unsafe_load(Ptr{Ptr{Cvoid}}(Base.unsafe_convert(Ptr{Any}, p))) end return new(RemoteCallbacksStruct(; kwargs..., payload=pp), p) end @@ -261,9 +261,9 @@ julia> fetch(remote, "master", options=fo) version::Cuint = 1 proxytype::Consts.GIT_PROXY = Consts.PROXY_AUTO url::Cstring - credential_cb::Ptr{Void} - certificate_cb::Ptr{Void} - payload::Ptr{Void} + credential_cb::Ptr{Cvoid} + certificate_cb::Ptr{Cvoid} + payload::Ptr{Cvoid} end @kwdef struct FetchOptionsStruct @@ -315,10 +315,10 @@ end bare::Cint localclone::Cint = Consts.CLONE_LOCAL_AUTO checkout_branch::Cstring - repository_cb::Ptr{Void} - repository_cb_payload::Ptr{Void} - remote_cb::Ptr{Void} - remote_cb_payload::Ptr{Void} + repository_cb::Ptr{Cvoid} + repository_cb_payload::Ptr{Cvoid} + remote_cb::Ptr{Cvoid} + remote_cb_payload::Ptr{Cvoid} end """ @@ -389,11 +389,11 @@ The fields represent: # options controlling which files are in the diff ignore_submodules::GIT_SUBMODULE_IGNORE = Consts.SUBMODULE_IGNORE_UNSPECIFIED pathspec::StrArrayStruct - notify_cb::Ptr{Void} + notify_cb::Ptr{Cvoid} @static if LibGit2.VERSION >= v"0.24.0" - progress_cb::Ptr{Void} + progress_cb::Ptr{Cvoid} end - payload::Ptr{Void} + payload::Ptr{Cvoid} # options controlling how the diff text is generated context_lines::UInt32 = UInt32(3) @@ -569,7 +569,7 @@ The fields represent: flags::Cint rename_threshold::Cuint = 50 target_limit::Cuint = 200 - metric::Ptr{Void} + metric::Ptr{Cvoid} @static if LibGit2.VERSION >= v"0.24.0" recursion_limit::Cuint end @@ -856,8 +856,8 @@ Matches the [`git_config_entry`](https://libgit2.github.com/libgit2/#HEAD/type/g name::Cstring value::Cstring level::GIT_CONFIG = Consts.CONFIG_LEVEL_DEFAULT - free::Ptr{Void} - payload::Ptr{Void} + free::Ptr{Cvoid} + payload::Ptr{Cvoid} end function Base.show(io::IO, ce::ConfigEntry) @@ -912,8 +912,8 @@ abstract type GitObject <: AbstractGitObject end for (typ, owntyp, sup, cname) in [ (:GitRepo, nothing, :AbstractGitObject, :git_repository), - (:GitConfig, :(Union{GitRepo, Void}), :AbstractGitObject, :git_config), - (:GitIndex, :(Union{GitRepo, Void}), :AbstractGitObject, :git_index), + (:GitConfig, :(Union{GitRepo, Nothing}), :AbstractGitObject, :git_config), + (:GitIndex, :(Union{GitRepo, Nothing}), :AbstractGitObject, :git_index), (:GitRemote, :GitRepo, :AbstractGitObject, :git_remote), (:GitRevWalker, :GitRepo, :AbstractGitObject, :git_revwalk), (:GitReference, :GitRepo, :AbstractGitObject, :git_reference), @@ -936,8 +936,8 @@ for (typ, owntyp, sup, cname) in [ if owntyp === nothing @eval mutable struct $typ <: $sup - ptr::Ptr{Void} - function $typ(ptr::Ptr{Void}, fin::Bool=true) + ptr::Ptr{Cvoid} + function $typ(ptr::Ptr{Cvoid}, fin::Bool=true) # fin=false should only be used when the pointer should not be free'd # e.g. from within callback functions which are passed a pointer @assert ptr != C_NULL @@ -952,8 +952,8 @@ for (typ, owntyp, sup, cname) in [ else @eval mutable struct $typ <: $sup owner::$owntyp - ptr::Ptr{Void} - function $typ(owner::$owntyp, ptr::Ptr{Void}, fin::Bool=true) + ptr::Ptr{Cvoid} + function $typ(owner::$owntyp, ptr::Ptr{Cvoid}, fin::Bool=true) @assert ptr != C_NULL obj = new(owner, ptr) if fin @@ -963,15 +963,15 @@ for (typ, owntyp, sup, cname) in [ return obj end end - if isa(owntyp, Expr) && owntyp.args[1] == :Union && owntyp.args[3] == :Void + if isa(owntyp, Expr) && owntyp.args[1] == :Union && owntyp.args[3] == :Nothing @eval begin - $typ(ptr::Ptr{Void}, fin::Bool=true) = $typ(nothing, ptr, fin) + $typ(ptr::Ptr{Cvoid}, fin::Bool=true) = $typ(nothing, ptr, fin) end end end @eval function Base.close(obj::$typ) if obj.ptr != C_NULL - ccall(($(string(cname, :_free)), :libgit2), Void, (Ptr{Void},), obj.ptr) + ccall(($(string(cname, :_free)), :libgit2), Cvoid, (Ptr{Cvoid},), obj.ptr) obj.ptr = C_NULL if Threads.atomic_sub!(REFCOUNT, UInt(1)) == 1 # will the last finalizer please turn out the lights? @@ -982,7 +982,7 @@ for (typ, owntyp, sup, cname) in [ end ## Calling `GitObject(repo, ...)` will automatically resolve to the appropriate type. -function GitObject(repo::GitRepo, ptr::Ptr{Void}) +function GitObject(repo::GitRepo, ptr::Ptr{Cvoid}) T = objtype(Consts.OBJECT(ptr)) T(repo, ptr) end @@ -1004,7 +1004,7 @@ mutable struct GitSignature <: AbstractGitObject end function Base.close(obj::GitSignature) if obj.ptr != C_NULL - ccall((:git_signature_free, :libgit2), Void, (Ptr{SignatureStruct},), obj.ptr) + ccall((:git_signature_free, :libgit2), Cvoid, (Ptr{SignatureStruct},), obj.ptr) obj.ptr = C_NULL end end @@ -1100,8 +1100,8 @@ Consts.OBJECT(::Type{GitTag}) = Consts.OBJ_TAG Consts.OBJECT(::Type{GitUnknownObject}) = Consts.OBJ_ANY Consts.OBJECT(::Type{GitObject}) = Consts.OBJ_ANY -Consts.OBJECT(ptr::Ptr{Void}) = - ccall((:git_object_type, :libgit2), Consts.OBJECT, (Ptr{Void},), ptr) +Consts.OBJECT(ptr::Ptr{Cvoid}) = + ccall((:git_object_type, :libgit2), Consts.OBJECT, (Ptr{Cvoid},), ptr) """ objtype(obj_type::Consts.OBJECT) @@ -1249,8 +1249,8 @@ A `CredentialPayload` instance is expected to be `reset!` whenever it will be us different URL. """ mutable struct CredentialPayload <: Payload - explicit::Union{AbstractCredential, Void} - cache::Union{CachedCredentials, Void} + explicit::Union{AbstractCredential, Nothing} + cache::Union{CachedCredentials, Nothing} allow_ssh_agent::Bool # Allow the use of the SSH agent to get credentials allow_git_helpers::Bool # Allow the use of git credential helpers allow_prompt::Bool # Allow prompting the user for credentials @@ -1258,7 +1258,7 @@ mutable struct CredentialPayload <: Payload config::GitConfig # Ephemeral state fields - credential::Union{AbstractCredential, Void} + credential::Union{AbstractCredential, Nothing} first_pass::Bool use_ssh_agent::Bool use_env::Bool @@ -1271,8 +1271,8 @@ mutable struct CredentialPayload <: Payload host::String function CredentialPayload( - credential::Union{AbstractCredential, Void}=nothing, - cache::Union{CachedCredentials, Void}=nothing, + credential::Union{AbstractCredential, Nothing}=nothing, + cache::Union{CachedCredentials, Nothing}=nothing, config::GitConfig=GitConfig(); allow_ssh_agent::Bool=true, allow_git_helpers::Bool=true, @@ -1314,7 +1314,7 @@ function reset!(p::CredentialPayload, config::GitConfig=p.config) end """ - approve(payload::CredentialPayload; shred::Bool=true) -> Void + approve(payload::CredentialPayload; shred::Bool=true) -> Nothing Store the `payload` credential for re-use in a future authentication. Should only be called when authentication was successful. @@ -1339,7 +1339,7 @@ function approve(p::CredentialPayload; shred::Bool=true) end """ - reject(payload::CredentialPayload; shred::Bool=true) -> Void + reject(payload::CredentialPayload; shred::Bool=true) -> Nothing Discard the `payload` credential from begin re-used in future authentication. Should only be called when authentication was unsuccessful. diff --git a/base/libgit2/utils.jl b/base/libgit2/utils.jl index 1eacbd5e7d180..121b4ecddf5d0 100644 --- a/base/libgit2/utils.jl +++ b/base/libgit2/utils.jl @@ -33,7 +33,7 @@ function version() major = Ref{Cint}(0) minor = Ref{Cint}(0) patch = Ref{Cint}(0) - ccall((:git_libgit2_version, :libgit2), Void, + ccall((:git_libgit2_version, :libgit2), Cvoid, (Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch) return VersionNumber(major[], minor[], patch[]) end diff --git a/base/libgit2/walker.jl b/base/libgit2/walker.jl index e1b15f68fd241..ac145ff68fd22 100644 --- a/base/libgit2/walker.jl +++ b/base/libgit2/walker.jl @@ -19,16 +19,16 @@ Here, `count` finds the number of commits along the walk with a certain `GitHash Since the `GitHash` is unique to a commit, `cnt` will be `1`. """ function GitRevWalker(repo::GitRepo) - w_ptr = Ref{Ptr{Void}}(C_NULL) + w_ptr = Ref{Ptr{Cvoid}}(C_NULL) @check ccall((:git_revwalk_new, :libgit2), Cint, - (Ptr{Ptr{Void}}, Ptr{Void}), w_ptr, repo.ptr) + (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}), w_ptr, repo.ptr) return GitRevWalker(repo, w_ptr[]) end function Base.start(w::GitRevWalker) id_ptr = Ref(GitHash()) err = ccall((:git_revwalk_next, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}), id_ptr, w.ptr) + (Ptr{GitHash}, Ptr{Cvoid}), id_ptr, w.ptr) err != Int(Error.GIT_OK) && return (nothing, true) return (id_ptr[], false) end @@ -38,7 +38,7 @@ Base.done(w::GitRevWalker, state) = Bool(state[2]) function Base.next(w::GitRevWalker, state) id_ptr = Ref(GitHash()) err = ccall((:git_revwalk_next, :libgit2), Cint, - (Ptr{GitHash}, Ptr{Void}), id_ptr, w.ptr) + (Ptr{GitHash}, Ptr{Cvoid}), id_ptr, w.ptr) err != Int(Error.GIT_OK) && return (state[1], (nothing, true)) return (state[1], (id_ptr[], false)) end @@ -53,7 +53,7 @@ Push the HEAD commit and its ancestors onto the [`GitRevWalker`](@ref) during the walk. """ function push_head!(w::GitRevWalker) - @check ccall((:git_revwalk_push_head, :libgit2), Cint, (Ptr{Void},), w.ptr) + @check ccall((:git_revwalk_push_head, :libgit2), Cint, (Ptr{Cvoid},), w.ptr) return w end @@ -65,18 +65,18 @@ to apply a function to all commits since a certain year, by passing the first co of that year as `cid` and then passing the resulting `w` to [`map`](@ref LibGit2.map). """ function Base.push!(w::GitRevWalker, cid::GitHash) - @check ccall((:git_revwalk_push, :libgit2), Cint, (Ptr{Void}, Ptr{GitHash}), w.ptr, Ref(cid)) + @check ccall((:git_revwalk_push, :libgit2), Cint, (Ptr{Cvoid}, Ptr{GitHash}), w.ptr, Ref(cid)) return w end function Base.push!(w::GitRevWalker, range::AbstractString) - @check ccall((:git_revwalk_push_range, :libgit2), Cint, (Ptr{Void}, Ptr{UInt8}), w.ptr, range) + @check ccall((:git_revwalk_push_range, :libgit2), Cint, (Ptr{Cvoid}, Ptr{UInt8}), w.ptr, range) return w end function Base.sort!(w::GitRevWalker; by::Cint = Consts.SORT_NONE, rev::Bool=false) rev && (by |= Consts.SORT_REVERSE) - ccall((:git_revwalk_sorting, :libgit2), Void, (Ptr{Void}, Cint), w.ptr, by) + ccall((:git_revwalk_sorting, :libgit2), Cvoid, (Ptr{Cvoid}, Cint), w.ptr, by) return w end diff --git a/base/libuv.jl b/base/libuv.jl index 4119ce4068c68..5ec3f16649b65 100644 --- a/base/libuv.jl +++ b/base/libuv.jl @@ -26,10 +26,10 @@ for r in uv_req_types @eval const $(Symbol("_sizeof_",Unicode.lowercase(string(r)))) = uv_sizeof_req($r) end -uv_handle_data(handle) = ccall(:jl_uv_handle_data,Ptr{Void},(Ptr{Void},),handle) -uv_req_data(handle) = ccall(:jl_uv_req_data,Ptr{Void},(Ptr{Void},),handle) -uv_req_set_data(req,data) = ccall(:jl_uv_req_set_data,Void,(Ptr{Void},Any),req,data) -uv_req_set_data(req,data::Ptr{Void}) = ccall(:jl_uv_req_set_data,Void,(Ptr{Void},Ptr{Void}),req,data) +uv_handle_data(handle) = ccall(:jl_uv_handle_data,Ptr{Cvoid},(Ptr{Cvoid},),handle) +uv_req_data(handle) = ccall(:jl_uv_req_data,Ptr{Cvoid},(Ptr{Cvoid},),handle) +uv_req_set_data(req,data) = ccall(:jl_uv_req_set_data,Cvoid,(Ptr{Cvoid},Any),req,data) +uv_req_set_data(req,data::Ptr{Cvoid}) = ccall(:jl_uv_req_set_data,Cvoid,(Ptr{Cvoid},Ptr{Cvoid}),req,data) macro handle_as(hand, typ) quote @@ -39,11 +39,11 @@ macro handle_as(hand, typ) end end -associate_julia_struct(handle::Ptr{Void}, @nospecialize(jlobj)) = - ccall(:jl_uv_associate_julia_struct, Void, (Ptr{Void}, Any), handle, jlobj) +associate_julia_struct(handle::Ptr{Cvoid}, @nospecialize(jlobj)) = + ccall(:jl_uv_associate_julia_struct, Cvoid, (Ptr{Cvoid}, Any), handle, jlobj) disassociate_julia_struct(uv) = disassociate_julia_struct(uv.handle) -disassociate_julia_struct(handle::Ptr{Void}) = - handle != C_NULL && ccall(:jl_uv_disassociate_julia_struct, Void, (Ptr{Void},), handle) +disassociate_julia_struct(handle::Ptr{Cvoid}) = + handle != C_NULL && ccall(:jl_uv_disassociate_julia_struct, Cvoid, (Ptr{Cvoid},), handle) # A dict of all libuv handles that are being waited on somewhere in the system # and should thus not be garbage collected @@ -70,39 +70,39 @@ show(io::IO, e::UVError) = print(io, e.prefix*": "*struverror(e)*" ("*uverrornam ## event loop ## -eventloop() = uv_eventloop::Ptr{Void} -#mkNewEventLoop() = ccall(:jl_new_event_loop,Ptr{Void},()) # this would probably be fine, but is nowhere supported +eventloop() = uv_eventloop::Ptr{Cvoid} +#mkNewEventLoop() = ccall(:jl_new_event_loop,Ptr{Cvoid},()) # this would probably be fine, but is nowhere supported function run_event_loop() - ccall(:jl_run_event_loop,Void,(Ptr{Void},),eventloop()) + ccall(:jl_run_event_loop,Cvoid,(Ptr{Cvoid},),eventloop()) end function process_events(block::Bool) loop = eventloop() if block - return ccall(:jl_run_once,Int32,(Ptr{Void},),loop) + return ccall(:jl_run_once,Int32,(Ptr{Cvoid},),loop) else - return ccall(:jl_process_events,Int32,(Ptr{Void},),loop) + return ccall(:jl_process_events,Int32,(Ptr{Cvoid},),loop) end end function reinit_stdio() - global uv_jl_alloc_buf = cfunction(uv_alloc_buf, Void, Tuple{Ptr{Void}, Csize_t, Ptr{Void}}) - global uv_jl_readcb = cfunction(uv_readcb, Void, Tuple{Ptr{Void}, Cssize_t, Ptr{Void}}) - global uv_jl_connectioncb = cfunction(uv_connectioncb, Void, Tuple{Ptr{Void}, Cint}) - global uv_jl_connectcb = cfunction(uv_connectcb, Void, Tuple{Ptr{Void}, Cint}) - global uv_jl_writecb_task = cfunction(uv_writecb_task, Void, Tuple{Ptr{Void}, Cint}) - global uv_jl_getaddrinfocb = cfunction(uv_getaddrinfocb, Void, Tuple{Ptr{Void}, Cint, Ptr{Void}}) - global uv_jl_getnameinfocb = cfunction(uv_getnameinfocb, Void, Tuple{Ptr{Void}, Cint, Cstring, Cstring}) - global uv_jl_recvcb = cfunction(uv_recvcb, Void, Tuple{Ptr{Void}, Cssize_t, Ptr{Void}, Ptr{Void}, Cuint}) - global uv_jl_sendcb = cfunction(uv_sendcb, Void, Tuple{Ptr{Void}, Cint}) - global uv_jl_return_spawn = cfunction(uv_return_spawn, Void, Tuple{Ptr{Void}, Int64, Int32}) - global uv_jl_asynccb = cfunction(uv_asynccb, Void, Tuple{Ptr{Void}}) - global uv_jl_timercb = cfunction(uv_timercb, Void, Tuple{Ptr{Void}}) - - global uv_eventloop = ccall(:jl_global_event_loop, Ptr{Void}, ()) - global STDIN = init_stdio(ccall(:jl_stdin_stream, Ptr{Void}, ())) - global STDOUT = init_stdio(ccall(:jl_stdout_stream, Ptr{Void}, ())) - global STDERR = init_stdio(ccall(:jl_stderr_stream, Ptr{Void}, ())) + global uv_jl_alloc_buf = cfunction(uv_alloc_buf, Cvoid, Tuple{Ptr{Cvoid}, Csize_t, Ptr{Cvoid}}) + global uv_jl_readcb = cfunction(uv_readcb, Cvoid, Tuple{Ptr{Cvoid}, Cssize_t, Ptr{Cvoid}}) + global uv_jl_connectioncb = cfunction(uv_connectioncb, Cvoid, Tuple{Ptr{Cvoid}, Cint}) + global uv_jl_connectcb = cfunction(uv_connectcb, Cvoid, Tuple{Ptr{Cvoid}, Cint}) + global uv_jl_writecb_task = cfunction(uv_writecb_task, Cvoid, Tuple{Ptr{Cvoid}, Cint}) + global uv_jl_getaddrinfocb = cfunction(uv_getaddrinfocb, Cvoid, Tuple{Ptr{Cvoid}, Cint, Ptr{Cvoid}}) + global uv_jl_getnameinfocb = cfunction(uv_getnameinfocb, Cvoid, Tuple{Ptr{Cvoid}, Cint, Cstring, Cstring}) + global uv_jl_recvcb = cfunction(uv_recvcb, Cvoid, Tuple{Ptr{Cvoid}, Cssize_t, Ptr{Cvoid}, Ptr{Cvoid}, Cuint}) + global uv_jl_sendcb = cfunction(uv_sendcb, Cvoid, Tuple{Ptr{Cvoid}, Cint}) + global uv_jl_return_spawn = cfunction(uv_return_spawn, Cvoid, Tuple{Ptr{Cvoid}, Int64, Int32}) + global uv_jl_asynccb = cfunction(uv_asynccb, Cvoid, Tuple{Ptr{Cvoid}}) + global uv_jl_timercb = cfunction(uv_timercb, Cvoid, Tuple{Ptr{Cvoid}}) + + global uv_eventloop = ccall(:jl_global_event_loop, Ptr{Cvoid}, ()) + global STDIN = init_stdio(ccall(:jl_stdin_stream, Ptr{Cvoid}, ())) + global STDOUT = init_stdio(ccall(:jl_stdout_stream, Ptr{Cvoid}, ())) + global STDERR = init_stdio(ccall(:jl_stderr_stream, Ptr{Cvoid}, ())) end """ diff --git a/base/linalg/bidiag.jl b/base/linalg/bidiag.jl index aba2c0196f282..15cb73809fb5e 100644 --- a/base/linalg/bidiag.jl +++ b/base/linalg/bidiag.jl @@ -186,7 +186,7 @@ similar(B::Bidiagonal, ::Type{T}, dims::Union{Dims{1},Dims{2}}) where {T} = spze #Singular values svdvals!(M::Bidiagonal{<:BlasReal}) = LAPACK.bdsdc!(M.uplo, 'N', M.dv, M.ev)[1] -function svdfact!(M::Bidiagonal{<:BlasReal}; full::Bool = false, thin::Union{Bool,Void} = nothing) +function svdfact!(M::Bidiagonal{<:BlasReal}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svdfact!(A; thin = $(thin))` has ", @@ -197,7 +197,7 @@ function svdfact!(M::Bidiagonal{<:BlasReal}; full::Bool = false, thin::Union{Boo d, e, U, Vt, Q, iQ = LAPACK.bdsdc!(M.uplo, 'I', M.dv, M.ev) SVD(U, d, Vt) end -function svdfact(M::Bidiagonal; full::Bool = false, thin::Union{Bool,Void} = nothing) +function svdfact(M::Bidiagonal; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svdfact(A; thin = $(thin))` has ", diff --git a/base/linalg/blas.jl b/base/linalg/blas.jl index f362b7df008ef..f35f871da5248 100644 --- a/base/linalg/blas.jl +++ b/base/linalg/blas.jl @@ -102,12 +102,12 @@ Set the number of threads the BLAS library should use. function set_num_threads(n::Integer) blas = vendor() if blas == :openblas - return ccall((:openblas_set_num_threads, Base.libblas_name), Void, (Int32,), n) + return ccall((:openblas_set_num_threads, Base.libblas_name), Cvoid, (Int32,), n) elseif blas == :openblas64 - return ccall((:openblas_set_num_threads64_, Base.libblas_name), Void, (Int32,), n) + return ccall((:openblas_set_num_threads64_, Base.libblas_name), Cvoid, (Int32,), n) elseif blas == :mkl # MKL may let us set the number of threads in several ways - return ccall((:MKL_Set_Num_Threads, Base.libblas_name), Void, (Cint,), n) + return ccall((:MKL_Set_Num_Threads, Base.libblas_name), Cvoid, (Cint,), n) end # OSX BLAS looks at an environment variable @@ -178,7 +178,7 @@ for (fname, elty) in ((:dcopy_,:Float64), @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union{Ptr{$elty},StridedArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},StridedArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, DX, incx, DY, incy) DY @@ -209,7 +209,7 @@ for (fname, elty) in ((:dscal_,:Float64), @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union{Ptr{$elty},DenseArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, DA, DX, incx) DX @@ -290,7 +290,7 @@ for (fname, elty) in ((:cblas_zdotc_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotc(n::Integer, DX::Union{Ptr{$elty},DenseArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},DenseArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -308,7 +308,7 @@ for (fname, elty) in ((:cblas_zdotu_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotu(n::Integer, DX::Union{Ptr{$elty},DenseArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},DenseArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -441,7 +441,7 @@ for (fname, elty) in ((:daxpy_,:Float64), #* .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function axpy!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, DenseArray{$elty}}, incx::Integer, dy::Union{Ptr{$elty}, DenseArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, dy, incy) dy @@ -504,7 +504,7 @@ for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), function axpby!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, DenseArray{$elty}}, incx::Integer, beta::($elty), dy::Union{Ptr{$elty}, DenseArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Void, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, beta, dy, incy) dy @@ -559,7 +559,7 @@ for (fname, elty) in ((:dgemv_,:Float64), elseif trans == 'T' && (length(X) != m || length(Y) != n) throw(DimensionMismatch("the transpose of A has dimensions $n, $m, X has length $(length(X)) and Y has length $(length(Y))")) end - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -634,7 +634,7 @@ for (fname, elty) in ((:dgbmv_,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function gbmv!(trans::Char, m::Integer, kl::Integer, ku::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -690,7 +690,7 @@ for (fname, elty, lib) in ((:dsymv_,:Float64,libblas), if m != length(y) throw(DimensionMismatch("A has size $(size(A)), and y has length $(length(y))")) end - ccall((@blasfunc($fname), $lib), Void, + ccall((@blasfunc($fname), $lib), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -743,7 +743,7 @@ for (fname, elty) in ((:zhemv_,:ComplexF64), lda = max(1, stride(A, 2)) incx = stride(x, 1) incy = stride(y, 1) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -773,7 +773,7 @@ for (fname, elty) in ((:dsbmv_,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function sbmv!(uplo::Char, k::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -835,7 +835,7 @@ for (fname, elty) in ((:zhbmv_,:ComplexF64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function hbmv!(uplo::Char, k::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -893,7 +893,7 @@ for (fname, elty) in ((:dtrmv_,:Float64), if n != length(x) throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))")) end - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), uplo, trans, diag, n, @@ -945,7 +945,7 @@ for (fname, elty) in ((:dtrsv_,:Float64), if n != length(x) throw(DimensionMismatch("size of A is $n != length(x) = $(length(x))")) end - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), uplo, trans, diag, n, @@ -977,7 +977,7 @@ for (fname, elty) in ((:dger_,:Float64), if m != length(x) || n != length(y) throw(DimensionMismatch("A has size ($m,$n), x has length $(length(x)), y has length $(length(y))")) end - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), @@ -1009,7 +1009,7 @@ for (fname, elty, lib) in ((:dsyr_,:Float64,libblas), if length(x) != n throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))")) end - ccall((@blasfunc($fname), $lib), Void, + ccall((@blasfunc($fname), $lib), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), uplo, n, α, x, @@ -1038,7 +1038,7 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64), if length(x) != n throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))")) end - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), uplo, n, α, x, @@ -1083,7 +1083,7 @@ for (gemm, elty) in if ka != kb || m != size(C,1) || n != size(C,2) throw(DimensionMismatch("A has size ($m,$ka), B has size ($kb,$n), C has size $(size(C))")) end - ccall((@blasfunc($gemm), libblas), Void, + ccall((@blasfunc($gemm), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -1140,7 +1140,7 @@ for (mfname, elty) in ((:dsymm_,:Float64), if size(B,2) != n throw(DimensionMismatch("B has second dimension $(size(B,2)) but needs to match second dimension of C, $n")) end - ccall((@blasfunc($mfname), libblas), Void, + ccall((@blasfunc($mfname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -1205,7 +1205,7 @@ for (mfname, elty) in ((:zhemm_,:ComplexF64), if size(B,2) != n throw(DimensionMismatch("B has second dimension $(size(B,2)) but needs to match second dimension of C, $n")) end - ccall((@blasfunc($mfname), libblas), Void, + ccall((@blasfunc($mfname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -1263,7 +1263,7 @@ for (fname, elty) in ((:dsyrk_,:Float64), nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("C has size ($n,$n), corresponding dimension of A is $nn")) end k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -1319,7 +1319,7 @@ for (fname, elty, relty) in ((:zherk_, :ComplexF64, :Float64), throw(DimensionMismatch("the matrix to update has dimension $n but the implied dimension of the update is $(size(A, trans == 'N' ? 1 : 2))")) end k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}), @@ -1358,7 +1358,7 @@ for (fname, elty) in ((:dsyr2k_,:Float64), nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("C has size ($n,$n), corresponding dimension of A is $nn")) end k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), @@ -1395,7 +1395,7 @@ for (fname, elty1, elty2) in ((:zher2k_,:ComplexF64,:Float64), (:cher2k_,:Comple nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("C has size ($n,$n), corresponding dimension of A is $nn")) end k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblas), Void, + ccall((@blasfunc($fname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty1}, Ptr{$elty1}, Ref{BlasInt}, Ptr{$elty1}, Ref{BlasInt}, Ref{$elty2}, Ptr{$elty1}, Ref{BlasInt}), @@ -1480,7 +1480,7 @@ for (mmname, smname, elty) in if nA != (side == 'L' ? m : n) throw(DimensionMismatch("size of A, $(size(A)), doesn't match $side size of B with dims, $(size(B))")) end - ccall((@blasfunc($mmname), libblas), Void, + ccall((@blasfunc($mmname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), side, uplo, transa, diag, m, n, @@ -1505,7 +1505,7 @@ for (mmname, smname, elty) in if k != (side == 'L' ? m : n) throw(DimensionMismatch("size of A is ($k,$k), size of B is ($m,$n), side is $side, and transa='$transa'")) end - ccall((@blasfunc($smname), libblas), Void, + ccall((@blasfunc($smname), libblas), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), diff --git a/base/linalg/lapack.jl b/base/linalg/lapack.jl index 6ec02faaf2c8b..dec2ed11b003f 100644 --- a/base/linalg/lapack.jl +++ b/base/linalg/lapack.jl @@ -98,7 +98,7 @@ function version() major = Ref{BlasInt}(0) minor = Ref{BlasInt}(0) patch = Ref{BlasInt}(0) - ccall((@blasfunc(ilaver_), liblapack), Void, + ccall((@blasfunc(ilaver_), liblapack), Cvoid, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), major, minor, patch) return VersionNumber(major[], minor[], patch[]) @@ -123,7 +123,7 @@ for (gbtrf, gbtrs, elty) in mnmn = min(m, n) ipiv = similar(AB, BlasInt, mnmn) info = Ref{BlasInt}() - ccall((@blasfunc($gbtrf), liblapack), Void, + ccall((@blasfunc($gbtrf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, kl, ku, AB, max(1,stride(AB,2)), ipiv, info) @@ -148,7 +148,7 @@ for (gbtrf, gbtrs, elty) in if m != n || m != size(B,1) throw(DimensionMismatch("matrix AB has dimensions $(size(AB)), but right hand side matrix B has dimensions $(size(B))")) end - ccall((@blasfunc($gbtrs), liblapack), Void, + ccall((@blasfunc($gbtrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -202,7 +202,7 @@ for (gebal, gebak, elty, relty) in ilo = Ref{BlasInt}() scale = similar(A, $relty, n) info = Ref{BlasInt}() - ccall((@blasfunc($gebal), liblapack), Void, + ccall((@blasfunc($gebal), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), job, n, A, max(1,stride(A,2)), ilo, ihi, scale, info) @@ -224,7 +224,7 @@ for (gebal, gebak, elty, relty) in chkfinite(V) # balancing routines don't support NaNs and Infs n = checksquare(V) info = Ref{BlasInt}() - ccall((@blasfunc($gebak), liblapack), Void, + ccall((@blasfunc($gebak), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), job, side, size(V,1), ilo, ihi, scale, n, V, max(1,stride(V,2)), info) @@ -288,7 +288,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gebrd), liblapack), Void, + ccall((@blasfunc($gebrd), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -321,7 +321,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(uninitialized, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelqf), liblapack), Void, + ccall((@blasfunc($gelqf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -351,7 +351,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(uninitialized, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqlf), liblapack), Void, + ccall((@blasfunc($geqlf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -392,7 +392,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geqp3), liblapack), Void, + ccall((@blasfunc($geqp3), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), @@ -400,7 +400,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty jpvt, tau, work, lwork, rwork, info) else - ccall((@blasfunc($geqp3), liblapack), Void, + ccall((@blasfunc($geqp3), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -429,7 +429,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(uninitialized, nb*n) if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt), liblapack), Void, + ccall((@blasfunc($geqrt), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -454,7 +454,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty end if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt3), liblapack), Void, + ccall((@blasfunc($geqrt3), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1, stride(A, 2)), @@ -480,7 +480,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqrf), liblapack), Void, + ccall((@blasfunc($geqrf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -508,7 +508,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(uninitialized, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gerqf), liblapack), Void, + ccall((@blasfunc($gerqf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -533,7 +533,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lda = max(1,stride(A, 2)) ipiv = similar(A, BlasInt, min(m,n)) info = Ref{BlasInt}() - ccall((@blasfunc($getrf), liblapack), Void, + ccall((@blasfunc($getrf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, A, lda, ipiv, info) @@ -764,7 +764,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($tzrzf), liblapack), Void, + ccall((@blasfunc($tzrzf), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, @@ -801,7 +801,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrz), liblapack), Void, + ccall((@blasfunc($ormrz), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -865,7 +865,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(uninitialized, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gels), liblapack), Void, + ccall((@blasfunc($gels), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -905,7 +905,7 @@ for (gels, gesv, getrs, getri, elty) in end ipiv = similar(A, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gesv), liblapack), Void, + ccall((@blasfunc($gesv), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -929,7 +929,7 @@ for (gels, gesv, getrs, getri, elty) in end nrhs = size(B, 2) info = Ref{BlasInt}() - ccall((@blasfunc($getrs), liblapack), Void, + ccall((@blasfunc($getrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), trans, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -954,7 +954,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(uninitialized, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($getri), liblapack), Void, + ccall((@blasfunc($getri), liblapack), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, A, lda, ipiv, work, lwork, info) @@ -1049,7 +1049,7 @@ for (gesvx, elty) in iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), liblapack), Void, + ccall((@blasfunc($gesvx), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1118,7 +1118,7 @@ for (gesvx, elty, relty) in rwork = Vector{$relty}(uninitialized, 2n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), liblapack), Void, + ccall((@blasfunc($gesvx), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, @@ -1213,7 +1213,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) iwork = Vector{BlasInt}(uninitialized, 1) for i = 1:2 # first call returns lwork as work[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), liblapack), Void, + ccall((@blasfunc($gelsd), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1258,7 +1258,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), liblapack), Void, + ccall((@blasfunc($gelsy), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1307,7 +1307,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(uninitialized, 1) iwork = Vector{BlasInt}(uninitialized, 1) for i = 1:2 # first call returns lwork as work[1], rwork length as rwork[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), liblapack), Void, + ccall((@blasfunc($gelsd), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1354,7 +1354,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(uninitialized, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), liblapack), Void, + ccall((@blasfunc($gelsy), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1428,7 +1428,7 @@ for (gglse, elty) in ((:dgglse_, :Float64), work = Vector{$elty}(uninitialized, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gglse), liblapack), Void, + ccall((@blasfunc($gglse), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1491,7 +1491,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geev), liblapack), Void, + ccall((@blasfunc($geev), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1499,7 +1499,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobvl, jobvr, n, A, max(1,stride(A,2)), W, VL, n, VR, n, work, lwork, rwork, info) else - ccall((@blasfunc($geev), liblapack), Void, + ccall((@blasfunc($geev), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1554,7 +1554,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesdd), liblapack), Void, + ccall((@blasfunc($gesdd), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1562,7 +1562,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in job, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, iwork, info) else - ccall((@blasfunc($gesdd), liblapack), Void, + ccall((@blasfunc($gesdd), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1622,7 +1622,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesvd), liblapack), Void, + ccall((@blasfunc($gesvd), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1630,7 +1630,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobu, jobvt, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, info) else - ccall((@blasfunc($gesvd), liblapack), Void, + ccall((@blasfunc($gesvd), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1701,7 +1701,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() if cmplx - ccall((@blasfunc($ggsvd), liblapack), Void, + ccall((@blasfunc($ggsvd), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1715,7 +1715,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in V, ldv, Q, ldq, work, rwork, iwork, info) else - ccall((@blasfunc($ggsvd), liblapack), Void, + ccall((@blasfunc($ggsvd), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1820,7 +1820,7 @@ for (f, elty) in ((:dggsvd3_, :Float64), iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), liblapack), Void, + ccall((@blasfunc($f), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1877,7 +1877,7 @@ for (f, elty, relty) in ((:zggsvd3_, :ComplexF64, :Float64), iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), liblapack), Void, + ccall((@blasfunc($f), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1985,7 +1985,7 @@ for (geevx, ggev, elty) in iwork = Vector{BlasInt}(uninitialized, iworksize) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), liblapack), Void, + ccall((@blasfunc($geevx), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2050,7 +2050,7 @@ for (geevx, ggev, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), liblapack), Void, + ccall((@blasfunc($ggev), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -2130,7 +2130,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(uninitialized, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), liblapack), Void, + ccall((@blasfunc($geevx), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2196,7 +2196,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(uninitialized, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), liblapack), Void, + ccall((@blasfunc($ggev), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2269,7 +2269,7 @@ for (laic1, elty) in sestpr = Vector{$elty}(uninitialized, 1) s = Vector{$elty}(uninitialized, 1) c = Vector{$elty}(uninitialized, 1) - ccall((@blasfunc($laic1), liblapack), Void, + ccall((@blasfunc($laic1), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}), @@ -2302,7 +2302,7 @@ for (laic1, elty, relty) in sestpr = Vector{$relty}(uninitialized, 1) s = Vector{$elty}(uninitialized, 1) c = Vector{$elty}(uninitialized, 1) - ccall((@blasfunc($laic1), liblapack), Void, + ccall((@blasfunc($laic1), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$relty}, Ptr{$elty}, Ref{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}), @@ -2343,7 +2343,7 @@ for (gtsv, gttrf, gttrs, elty) in return B # Early exit if possible end info = Ref{BlasInt}() - ccall((@blasfunc($gtsv), liblapack), Void, + ccall((@blasfunc($gtsv), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), dl, d, du, B, max(1,stride(B,2)), info) @@ -2369,7 +2369,7 @@ for (gtsv, gttrf, gttrs, elty) in du2 = similar(d, $elty, n-2) ipiv = similar(d, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gttrf), liblapack), Void, + ccall((@blasfunc($gttrf), liblapack), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), n, dl, d, du, du2, ipiv, info) @@ -2400,7 +2400,7 @@ for (gtsv, gttrf, gttrs, elty) in throw(DimensionMismatch("B has leading dimension $(size(B,1)), but should have $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($gttrs), liblapack), Void, + ccall((@blasfunc($gttrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -2466,7 +2466,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orglq), liblapack), Void, + ccall((@blasfunc($orglq), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -2499,7 +2499,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgqr), liblapack), Void, + ccall((@blasfunc($orgqr), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2534,7 +2534,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgql), liblapack), Void, + ccall((@blasfunc($orgql), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2571,7 +2571,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgrq), liblapack), Void, + ccall((@blasfunc($orgrq), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2617,7 +2617,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormlq), liblapack), Void, + ccall((@blasfunc($ormlq), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -2663,7 +2663,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormqr), liblapack), Void, + ccall((@blasfunc($ormqr), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2712,7 +2712,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormql), liblapack), Void, + ccall((@blasfunc($ormql), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2761,7 +2761,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrq), liblapack), Void, + ccall((@blasfunc($ormrq), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -2816,7 +2816,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in ldc = stride(C, 2) work = Vector{$elty}(uninitialized, wss) info = Ref{BlasInt}() - ccall((@blasfunc($gemqrt), liblapack), Void, + ccall((@blasfunc($gemqrt), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2934,7 +2934,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in throw(DimensionMismatch("first dimension of B, $(size(B,1)), and size of A, ($n,$n), must match!")) end info = Ref{BlasInt}() - ccall((@blasfunc($posv), liblapack), Void, + ccall((@blasfunc($posv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), B, max(1,stride(B,2)), info) @@ -2958,7 +2958,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in return A, 0 end info = Ref{BlasInt}() - ccall((@blasfunc($potrf), liblapack), Void, + ccall((@blasfunc($potrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, size(A,1), A, lda, info) chkargsok(info[]) @@ -2978,7 +2978,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in chkstride1(A) chkuplo(uplo) info = Ref{BlasInt}() - ccall((@blasfunc($potri), liblapack), Void, + ccall((@blasfunc($potri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, size(A,1), A, max(1,stride(A,2)), info) chkargsok(info[]) @@ -3006,7 +3006,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in end ldb = max(1,stride(B,2)) info = Ref{BlasInt}() - ccall((@blasfunc($potrs), liblapack), Void, + ccall((@blasfunc($potrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, nrhs, A, @@ -3031,7 +3031,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in rank = Vector{BlasInt}(uninitialized, 1) work = Vector{$rtyp}(uninitialized, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($pstrf), liblapack), Void, + ccall((@blasfunc($pstrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ref{$rtyp}, Ptr{$rtyp}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), piv, rank, tol, work, info) @@ -3119,7 +3119,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($ptsv), liblapack), Void, + ccall((@blasfunc($ptsv), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3139,7 +3139,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("E has length $(length(E)), but needs $(n - 1)")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrf), liblapack), Void, + ccall((@blasfunc($pttrf), liblapack), Cvoid, (Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}), n, D, E, info) chklapackerror(info[]) @@ -3185,7 +3185,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), liblapack), Void, + ccall((@blasfunc($pttrs), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3218,7 +3218,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), liblapack), Void, + ccall((@blasfunc($pttrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3257,7 +3257,7 @@ for (trtri, trtrs, elty) in chkdiag(diag) lda = max(1,stride(A, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trtri), liblapack), Void, + ccall((@blasfunc($trtri), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, diag, n, A, lda, info) @@ -3282,7 +3282,7 @@ for (trtri, trtrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($trtrs), liblapack), Void, + ccall((@blasfunc($trtrs), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, trans, diag, n, size(B,2), A, max(1,stride(A,2)), @@ -3337,7 +3337,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(uninitialized, 3n) iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), liblapack), Void, + ccall((@blasfunc($trcon), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), norm, uplo, diag, n, @@ -3375,7 +3375,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(uninitialized, 3n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), liblapack), Void, + ccall((@blasfunc($trevc), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt},Ref{BlasInt}, Ptr{BlasInt}, @@ -3430,7 +3430,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(uninitialized, 3n) iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), liblapack), Void, + ccall((@blasfunc($trrfs), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3465,7 +3465,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(uninitialized, 2n) rwork = Vector{$relty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), liblapack), Void, + ccall((@blasfunc($trcon), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), norm, uplo, diag, n, @@ -3504,7 +3504,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(uninitialized, 2n) rwork = Vector{$relty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), liblapack), Void, + ccall((@blasfunc($trevc), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3559,7 +3559,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(uninitialized, 2n) rwork = Vector{$relty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), liblapack), Void, + ccall((@blasfunc($trrfs), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), @@ -3629,7 +3629,7 @@ for (stev, stebz, stegr, stein, elty) in Zmat = similar(dv, $elty, (n, job != 'N' ? n : 0)) work = Vector{$elty}(uninitialized, max(1, 2n-2)) info = Ref{BlasInt}() - ccall((@blasfunc($stev), liblapack), Void, + ccall((@blasfunc($stev), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), job, n, dv, ev, Zmat, n, work, info) @@ -3656,7 +3656,7 @@ for (stev, stebz, stegr, stein, elty) in work = Vector{$elty}(uninitialized, 4*n) iwork = Vector{BlasInt}(uninitialized, 3*n) info = Ref{BlasInt}() - ccall((@blasfunc($stebz), liblapack), Void, + ccall((@blasfunc($stebz), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3690,7 +3690,7 @@ for (stev, stebz, stegr, stein, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($stegr), liblapack), Void, + ccall((@blasfunc($stegr), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3747,7 +3747,7 @@ for (stev, stebz, stegr, stein, elty) in iwork = Vector{BlasInt}(uninitialized, n) ifail = Vector{BlasInt}(uninitialized, m) info = Ref{BlasInt}() - ccall((@blasfunc($stein), liblapack), Void, + ccall((@blasfunc($stein), liblapack), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3835,7 +3835,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), liblapack), Void, + ccall((@blasfunc($syconv), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info) @@ -3863,7 +3863,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Void, + ccall((@blasfunc($sysv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -3897,7 +3897,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Void, + ccall((@blasfunc($sytrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, A, stride(A,2), ipiv, work, lwork, info) @@ -3925,7 +3925,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), liblapack), Void, +# ccall((@blasfunc($sytri), liblapack), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -3952,7 +3952,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Void, + ccall((@blasfunc($sytri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, info) @@ -3978,7 +3978,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Void, + ccall((@blasfunc($sytrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -4013,7 +4013,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Void, + ccall((@blasfunc($sysv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4047,7 +4047,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Void, + ccall((@blasfunc($sytrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, A, stride(A,2), ipiv, work, lwork, info) @@ -4073,7 +4073,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Void, + ccall((@blasfunc($sytri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, info) @@ -4099,7 +4099,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Void, + ccall((@blasfunc($sytrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -4138,7 +4138,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), liblapack), Void, + ccall((@blasfunc($syconvf), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), uplo, way, n, A, @@ -4171,7 +4171,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), liblapack), Void, + ccall((@blasfunc($syconv), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info) @@ -4199,7 +4199,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), liblapack), Void, + ccall((@blasfunc($hesv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4230,7 +4230,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), liblapack), Void, + ccall((@blasfunc($hetrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info) @@ -4259,7 +4259,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($hetri), liblapack), Void, +# ccall((@blasfunc($hetri), liblapack), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -4287,7 +4287,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), liblapack), Void, + ccall((@blasfunc($hetri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, info) @@ -4311,7 +4311,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), liblapack), Void, + ccall((@blasfunc($hetrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -4345,7 +4345,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), liblapack), Void, + ccall((@blasfunc($hesv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4376,7 +4376,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), liblapack), Void, + ccall((@blasfunc($hetrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info) @@ -4403,7 +4403,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), liblapack), Void, + ccall((@blasfunc($hetri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, info) @@ -4427,7 +4427,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), liblapack), Void, + ccall((@blasfunc($hetrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -4462,7 +4462,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Void, + ccall((@blasfunc($sysv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4497,7 +4497,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Void, + ccall((@blasfunc($sytrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info) @@ -4526,7 +4526,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), liblapack), Void, +# ccall((@blasfunc($sytri), liblapack), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -4553,7 +4553,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Void, + ccall((@blasfunc($sytri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, info) @@ -4578,7 +4578,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Void, + ccall((@blasfunc($sytrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -4613,7 +4613,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Void, + ccall((@blasfunc($sysv), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4648,7 +4648,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Void, + ccall((@blasfunc($sytrf), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info) @@ -4675,7 +4675,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in chkuplo(uplo) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Void, + ccall((@blasfunc($sytri), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), uplo, n, A, max(1,stride(A,2)), ipiv, work, info) @@ -4700,7 +4700,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Void, + ccall((@blasfunc($sytrs), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -4739,7 +4739,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), liblapack), Void, + ccall((@blasfunc($syconvf), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), uplo, way, n, A, @@ -4870,7 +4870,7 @@ for (syev, syevr, sygvd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), liblapack), Void, + ccall((@blasfunc($syev), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), jobz, uplo, n, A, max(1,stride(A,2)), W, work, lwork, info) @@ -4920,7 +4920,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), liblapack), Void, + ccall((@blasfunc($syevr), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -4971,7 +4971,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), liblapack), Void, + ccall((@blasfunc($sygvd), liblapack), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, @@ -5015,7 +5015,7 @@ for (syev, syevr, sygvd, elty, relty) in rwork = Vector{$relty}(uninitialized, max(1, 3n-2)) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), liblapack), Void, + ccall((@blasfunc($syev), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), jobz, uplo, n, A, stride(A,2), W, work, lwork, rwork, info) @@ -5070,7 +5070,7 @@ for (syev, syevr, sygvd, elty, relty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), liblapack), Void, + ccall((@blasfunc($syevr), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5125,7 +5125,7 @@ for (syev, syevr, sygvd, elty, relty) in lrwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), liblapack), Void, + ccall((@blasfunc($sygvd), liblapack), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, @@ -5223,7 +5223,7 @@ for (bdsqr, relty, elty) in # Allocate work = Vector{$relty}(uninitialized, 4n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsqr), liblapack), Void, + ccall((@blasfunc($bdsqr), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5293,7 +5293,7 @@ for (bdsdc, elty) in work = Vector{$elty}(uninitialized, lwork) iwork = Vector{BlasInt}(uninitialized, 8n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsdc), liblapack), Void, + ccall((@blasfunc($bdsdc), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -5343,7 +5343,7 @@ for (gecon, elty) in work = Vector{$elty}(uninitialized, 4n) iwork = Vector{BlasInt}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), liblapack), Void, + ccall((@blasfunc($gecon), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -5377,7 +5377,7 @@ for (gecon, elty, relty) in work = Vector{$elty}(uninitialized, 2n) rwork = Vector{$relty}(uninitialized, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), liblapack), Void, + ccall((@blasfunc($gecon), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), @@ -5420,7 +5420,7 @@ for (gehrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gehrd), liblapack), Void, + ccall((@blasfunc($gehrd), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5470,7 +5470,7 @@ for (orghr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orghr), liblapack), Void, + ccall((@blasfunc($orghr), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5526,7 +5526,7 @@ for (ormhr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormhr), liblapack), Void, + ccall((@blasfunc($ormhr), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5570,11 +5570,11 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), liblapack), Void, - (Ref{UInt8}, Ref{UInt8}, Ptr{Void}, Ref{BlasInt}, + ccall((@blasfunc($gees), liblapack), Cvoid, + (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, - Ref{BlasInt}, Ptr{Void}, Ptr{BlasInt}), + Ref{BlasInt}, Ptr{Cvoid}, Ptr{BlasInt}), jobvs, 'N', C_NULL, n, A, max(1, stride(A, 2)), sdim, wr, wi, vs, ldvs, work, @@ -5615,12 +5615,12 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), liblapack), Void, - (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Void}, + ccall((@blasfunc($gges), liblapack), Cvoid, + (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, - Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{Void}, + Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{Cvoid}, Ptr{BlasInt}), jobvsl, jobvsr, 'N', C_NULL, n, A, max(1,stride(A, 2)), B, @@ -5664,11 +5664,11 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(uninitialized, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), liblapack), Void, - (Ref{UInt8}, Ref{UInt8}, Ptr{Void}, Ref{BlasInt}, + ccall((@blasfunc($gees), liblapack), Cvoid, + (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, - Ptr{$relty}, Ptr{Void}, Ptr{BlasInt}), + Ptr{$relty}, Ptr{Cvoid}, Ptr{BlasInt}), jobvs, sort, C_NULL, n, A, max(1, stride(A, 2)), sdim, w, vs, ldvs, work, lwork, @@ -5710,12 +5710,12 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(uninitialized, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), liblapack), Void, - (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Void}, + ccall((@blasfunc($gges), liblapack), Cvoid, + (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, - Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{Void}, + Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{Cvoid}, Ptr{BlasInt}), jobvsl, jobvsr, 'N', C_NULL, n, A, max(1, stride(A, 2)), B, @@ -5775,7 +5775,7 @@ for (trexc, trsen, tgsen, elty) in ldq = max(1, stride(Q, 2)) work = Vector{$elty}(uninitialized, n) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), liblapack), Void, + ccall((@blasfunc($trexc), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -5817,7 +5817,7 @@ for (trexc, trsen, tgsen, elty) in s = Ref{$elty}(zero($elty)) sep = Ref{$elty}(zero($elty)) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($trsen), liblapack), Void, + ccall((@blasfunc($trsen), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, @@ -5882,12 +5882,12 @@ for (trexc, trsen, tgsen, elty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), liblapack), Void, + ccall((@blasfunc($tgsen), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, - Ref{BlasInt}, Ptr{Void}, Ptr{Void}, Ptr{Void}, + Ref{BlasInt}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}), 0, 1, 1, select, @@ -5926,7 +5926,7 @@ for (trexc, trsen, tgsen, elty, relty) in ldt = max(1, stride(T, 2)) ldq = max(1, stride(Q, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), liblapack), Void, + ccall((@blasfunc($trexc), liblapack), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -5964,7 +5964,7 @@ for (trexc, trsen, tgsen, elty, relty) in s = Ref{$relty}(zero($relty)) sep = Ref{$relty}(zero($relty)) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($trsen), liblapack), Void, + ccall((@blasfunc($trsen), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, @@ -6026,12 +6026,12 @@ for (trexc, trsen, tgsen, elty, relty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), liblapack), Void, + ccall((@blasfunc($tgsen), liblapack), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, - Ref{BlasInt}, Ptr{Void}, Ptr{Void}, Ptr{Void}, + Ref{BlasInt}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}), 0, 1, 1, select, @@ -6107,7 +6107,7 @@ for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), ldc = max(1, stride(C, 2)) scale = Vector{$relty}(uninitialized, 1) info = Ref{BlasInt}() - ccall((@blasfunc($fn), liblapack), Void, + ccall((@blasfunc($fn), liblapack), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), diff --git a/base/linalg/linalg.jl b/base/linalg/linalg.jl index 9dd0c65d719df..73a2f9dc24f51 100644 --- a/base/linalg/linalg.jl +++ b/base/linalg/linalg.jl @@ -314,7 +314,7 @@ function __init__() try BLAS.check() if BLAS.vendor() == :mkl - ccall((:MKL_Set_Interface_Layer, Base.libblas_name), Void, (Cint,), USE_BLAS64 ? 1 : 0) + ccall((:MKL_Set_Interface_Layer, Base.libblas_name), Cvoid, (Cint,), USE_BLAS64 ? 1 : 0) end catch ex Base.showerror_nostdio(ex, diff --git a/base/linalg/lq.jl b/base/linalg/lq.jl index a096b7f6ed3d8..d4424900dbd9a 100644 --- a/base/linalg/lq.jl +++ b/base/linalg/lq.jl @@ -47,7 +47,7 @@ full/square form of `Q` is requested via `full = true`, `L` is not extended with rectangular factor `Q`. "Thin" factorizations more broadly are also referred to as "reduced" factorizatons. """ -function lq(A::Union{Number,AbstractMatrix}; full::Bool = false, thin::Union{Bool,Void} = nothing) +function lq(A::Union{Number,AbstractMatrix}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `lq(A; thin = $(thin))` has ", diff --git a/base/linalg/qr.jl b/base/linalg/qr.jl index 6b4392af26f54..435f2a67ac12e 100644 --- a/base/linalg/qr.jl +++ b/base/linalg/qr.jl @@ -315,7 +315,7 @@ The default is to compute a "thin" factorization. Note that `R` is not extended with zeros when a full/square orthogonal factor `Q` is requested (via `full = true`). """ function qr(A::Union{Number,AbstractMatrix}, pivot::Union{Val{false},Val{true}} = Val(false); - full::Bool = false, thin::Union{Bool,Void} = nothing) + full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `qr(A, pivot; thin = $(thin))` has ", diff --git a/base/linalg/svd.jl b/base/linalg/svd.jl index d6993ab192759..1ee5eba8ad55b 100644 --- a/base/linalg/svd.jl +++ b/base/linalg/svd.jl @@ -42,7 +42,7 @@ julia> A 0.0 0.0 -2.0 0.0 0.0 ``` """ -function svdfact!(A::StridedMatrix{T}; full::Bool = false, thin::Union{Bool,Void} = nothing) where T<:BlasFloat +function svdfact!(A::StridedMatrix{T}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) where T<:BlasFloat # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svdfact!(A; thin = $(thin))` has ", @@ -92,7 +92,7 @@ julia> F[:U] * Diagonal(F[:S]) * F[:Vt] 0.0 2.0 0.0 0.0 0.0 ``` """ -function svdfact(A::StridedVecOrMat{T}; full::Bool = false, thin::Union{Bool,Void} = nothing) where T +function svdfact(A::StridedVecOrMat{T}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) where T # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svdfact(A; thin = $(thin))` has ", @@ -102,7 +102,7 @@ function svdfact(A::StridedVecOrMat{T}; full::Bool = false, thin::Union{Bool,Voi end svdfact!(copy_oftype(A, eigtype(T)), full = full) end -function svdfact(x::Number; full::Bool = false, thin::Union{Bool,Void} = nothing) +function svdfact(x::Number; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svdfact(A; thin = $(thin))` has ", @@ -112,7 +112,7 @@ function svdfact(x::Number; full::Bool = false, thin::Union{Bool,Void} = nothing end return SVD(x == 0 ? fill(one(x), 1, 1) : fill(x/abs(x), 1, 1), [abs(x)], fill(one(x), 1, 1)) end -function svdfact(x::Integer; full::Bool = false, thin::Union{Bool,Void} = nothing) +function svdfact(x::Integer; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svdfact(A; thin = $(thin))` has ", @@ -156,7 +156,7 @@ julia> U * Diagonal(S) * V' 0.0 2.0 0.0 0.0 0.0 ``` """ -function svd(A::AbstractArray; full::Bool = false, thin::Union{Bool,Void} = nothing) +function svd(A::AbstractArray; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svd(A; thin = $(thin))` has ", @@ -167,7 +167,7 @@ function svd(A::AbstractArray; full::Bool = false, thin::Union{Bool,Void} = noth F = svdfact(A, full = full) F.U, F.S, adjoint(F.Vt) end -function svd(x::Number; full::Bool = false, thin::Union{Bool,Void} = nothing) +function svd(x::Number; full::Bool = false, thin::Union{Bool,Nothing} = nothing) # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7 if thin != nothing Base.depwarn(string("the `thin` keyword argument in `svd(A; thin = $(thin))` has ", diff --git a/base/loading.jl b/base/loading.jl index 92674e21323b4..e7a22b3524b40 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -50,7 +50,7 @@ elseif Sys.isapple() buf = Vector{UInt8}(uninitialized, length(path_basename) + header_size + 1) while true ret = ccall(:getattrlist, Cint, - (Cstring, Ptr{Void}, Ptr{Void}, Csize_t, Culong), + (Cstring, Ptr{Cvoid}, Ptr{Cvoid}, Csize_t, Culong), path, attr_list, buf, sizeof(buf), FSOPT_NOFOLLOW) systemerror(:getattrlist, ret ≠ 0) filename_length = @gc_preserve buf unsafe_load( @@ -498,7 +498,7 @@ include_string(m::Module, txt::String, fname::String) = include_string(m::Module, txt::AbstractString, fname::AbstractString="string") = include_string(m, String(txt), String(fname)) -function source_path(default::Union{AbstractString,Void}="") +function source_path(default::Union{AbstractString,Nothing}="") t = current_task() while true s = t.storage @@ -661,7 +661,7 @@ end module_uuid(m::Module) = ccall(:jl_module_uuid, UInt64, (Any,), m) -isvalid_cache_header(f::IOStream) = 0 != ccall(:jl_read_verify_header, Cint, (Ptr{Void},), f.ios) +isvalid_cache_header(f::IOStream) = 0 != ccall(:jl_read_verify_header, Cint, (Ptr{Cvoid},), f.ios) function parse_cache_header(f::IO) modules = Vector{Pair{Symbol, UInt64}}() diff --git a/base/lock.jl b/base/lock.jl index 7bc9548149df7..eb78d7f77671f 100644 --- a/base/lock.jl +++ b/base/lock.jl @@ -11,7 +11,7 @@ Each [`lock`](@ref) must be matched with an [`unlock`](@ref). This lock is NOT threadsafe. See [`Threads.Mutex`](@ref) for a threadsafe lock. """ mutable struct ReentrantLock - locked_by::Union{Task, Void} + locked_by::Union{Task, Nothing} cond_wait::Condition reentrancy_cnt::Int diff --git a/base/locks.jl b/base/locks.jl index 96fa8c6c43f55..3cfa467d941fd 100644 --- a/base/locks.jl +++ b/base/locks.jl @@ -58,9 +58,9 @@ function lock(l::TatasLock) return end end - ccall(:jl_cpu_pause, Void, ()) + ccall(:jl_cpu_pause, Cvoid, ()) # Temporary solution before we have gc transition support in codegen. - ccall(:jl_gc_safepoint, Void, ()) + ccall(:jl_gc_safepoint, Cvoid, ()) end end @@ -73,7 +73,7 @@ end function unlock(l::TatasLock) l.handle[] = 0 - ccall(:jl_cpu_wake, Void, ()) + ccall(:jl_cpu_wake, Cvoid, ()) return end @@ -119,9 +119,9 @@ function lock(l::RecursiveTatasLock) return end end - ccall(:jl_cpu_pause, Void, ()) + ccall(:jl_cpu_pause, Cvoid, ()) # Temporary solution before we have gc transition support in codegen. - ccall(:jl_gc_safepoint, Void, ()) + ccall(:jl_gc_safepoint, Cvoid, ()) end end @@ -146,7 +146,7 @@ function unlock(l::RecursiveTatasLock) if l.handle[] == 1 l.ownertid[] = 0 l.handle[] = 0 - ccall(:jl_cpu_wake, Void, ()) + ccall(:jl_cpu_wake, Cvoid, ()) else l.handle[] -= 1 end @@ -183,22 +183,22 @@ See also [`SpinLock`](@ref) for a lighter-weight lock. """ mutable struct Mutex <: AbstractLock ownertid::Int16 - handle::Ptr{Void} + handle::Ptr{Cvoid} function Mutex() m = new(zero(Int16), Libc.malloc(UV_MUTEX_SIZE)) - ccall(:uv_mutex_init, Void, (Ptr{Void},), m.handle) + ccall(:uv_mutex_init, Cvoid, (Ptr{Cvoid},), m.handle) finalizer(_uv_hook_close, m) return m end end -unsafe_convert(::Type{Ptr{Void}}, m::Mutex) = m.handle +unsafe_convert(::Type{Ptr{Cvoid}}, m::Mutex) = m.handle function _uv_hook_close(x::Mutex) h = x.handle if h != C_NULL x.handle = C_NULL - ccall(:uv_mutex_destroy, Void, (Ptr{Void},), h) + ccall(:uv_mutex_destroy, Cvoid, (Ptr{Cvoid},), h) Libc.free(h) nothing end @@ -211,8 +211,8 @@ function lock(m::Mutex) # Temporary solution before we have gc transition support in codegen. # This could mess up gc state when we add codegen support. gc_state = ccall(:jl_gc_safe_enter, Int8, ()) - ccall(:uv_mutex_lock, Void, (Ptr{Void},), m) - ccall(:jl_gc_safe_leave, Void, (Int8,), gc_state) + ccall(:uv_mutex_lock, Cvoid, (Ptr{Cvoid},), m) + ccall(:jl_gc_safe_leave, Cvoid, (Int8,), gc_state) m.ownertid = threadid() return end @@ -221,7 +221,7 @@ function trylock(m::Mutex) if m.ownertid == threadid() return true end - r = ccall(:uv_mutex_trylock, Cint, (Ptr{Void},), m) + r = ccall(:uv_mutex_trylock, Cint, (Ptr{Cvoid},), m) if r == 0 m.ownertid = threadid() end @@ -231,7 +231,7 @@ end function unlock(m::Mutex) @assert(m.ownertid == threadid(), "unlock from wrong thread") m.ownertid = 0 - ccall(:uv_mutex_unlock, Void, (Ptr{Void},), m) + ccall(:uv_mutex_unlock, Cvoid, (Ptr{Cvoid},), m) return end diff --git a/base/methodshow.jl b/base/methodshow.jl index 35bae1f1671a0..f05e3e4e0935c 100644 --- a/base/methodshow.jl +++ b/base/methodshow.jl @@ -47,7 +47,7 @@ function method_argnames(m::Method) return m.generator.argnames end argnames = Vector{Any}(uninitialized, m.nargs) - ccall(:jl_fill_argnames, Void, (Any, Any), m.source, argnames) + ccall(:jl_fill_argnames, Cvoid, (Any, Any), m.source, argnames) return argnames end @@ -102,7 +102,7 @@ function show_method_params(io::IO, tv) end end -function show(io::IO, m::Method; kwtype::Union{DataType, Void}=nothing) +function show(io::IO, m::Method; kwtype::Union{DataType, Nothing}=nothing) tv, decls, file, line = arg_decl_parts(m) sig = unwrap_unionall(m.sig) ft0 = sig.parameters[1] @@ -233,7 +233,7 @@ function url(m::Method) end end -function show(io::IO, ::MIME"text/html", m::Method; kwtype::Union{DataType, Void}=nothing) +function show(io::IO, ::MIME"text/html", m::Method; kwtype::Union{DataType, Nothing}=nothing) tv, decls, file, line = arg_decl_parts(m) sig = unwrap_unionall(m.sig) ft0 = sig.parameters[1] diff --git a/base/missing.jl b/base/missing.jl index f7e04f096d489..229c3deb49d62 100644 --- a/base/missing.jl +++ b/base/missing.jl @@ -33,9 +33,9 @@ promote_rule(::Type{Missing}, ::Type{Missing}) = Missing convert(::Type{Union{T, Missing}}, x) where {T} = convert(T, x) # To fix ambiguities convert(::Type{Missing}, ::Missing) = missing -convert(::Type{Union{Void, Missing}}, x::Union{Void, Missing}) = x -convert(::Type{Union{Void, Missing}}, x) = - throw(MethodError(convert, (Union{Void, Missing}, x))) +convert(::Type{Union{Nothing, Missing}}, x::Union{Nothing, Missing}) = x +convert(::Type{Union{Nothing, Missing}}, x) = + throw(MethodError(convert, (Union{Nothing, Missing}, x))) # To print more appropriate message than "T not defined" convert(::Type{Missing}, x) = throw(MethodError(convert, (Missing, x))) @@ -202,4 +202,4 @@ end i, state = next(eachindex(itr.x), state) @inbounds v = itr.x[i]::eltype(itr) (v, _next_nonmissing_ind(itr.x, state)) -end \ No newline at end of file +end diff --git a/base/mpfr.jl b/base/mpfr.jl index c3208e53c5d34..016462f26937e 100644 --- a/base/mpfr.jl +++ b/base/mpfr.jl @@ -59,13 +59,13 @@ mutable struct BigFloat <: AbstractFloat function BigFloat() prec = precision(BigFloat) z = new(zero(Clong), zero(Cint), zero(Clong), C_NULL) - ccall((:mpfr_init2,:libmpfr), Void, (Ref{BigFloat}, Clong), z, prec) + ccall((:mpfr_init2,:libmpfr), Cvoid, (Ref{BigFloat}, Clong), z, prec) finalizer(cglobal((:mpfr_clear, :libmpfr)), z) return z end # Not recommended for general use: - function BigFloat(prec::Clong, sign::Cint, exp::Clong, d::Ptr{Void}) + function BigFloat(prec::Clong, sign::Cint, exp::Clong, d::Ptr{Cvoid}) new(prec, sign, exp, d) end end @@ -959,14 +959,14 @@ get_emin() = ccall((:mpfr_get_emin, :libmpfr), Clong, ()) get_emin_min() = ccall((:mpfr_get_emin_min, :libmpfr), Clong, ()) get_emin_max() = ccall((:mpfr_get_emin_max, :libmpfr), Clong, ()) -set_emax!(x) = ccall((:mpfr_set_emax, :libmpfr), Void, (Clong,), x) -set_emin!(x) = ccall((:mpfr_set_emin, :libmpfr), Void, (Clong,), x) +set_emax!(x) = ccall((:mpfr_set_emax, :libmpfr), Cvoid, (Clong,), x) +set_emin!(x) = ccall((:mpfr_set_emin, :libmpfr), Cvoid, (Clong,), x) function Base.deepcopy_internal(x::BigFloat, stackdict::ObjectIdDict) haskey(stackdict, x) && return stackdict[x] prec = precision(x) y = BigFloat(zero(Clong), zero(Cint), zero(Clong), C_NULL) - ccall((:mpfr_init2,:libmpfr), Void, (Ref{BigFloat}, Clong), y, prec) + ccall((:mpfr_init2,:libmpfr), Cvoid, (Ref{BigFloat}, Clong), y, prec) finalizer(cglobal((:mpfr_clear, :libmpfr)), y) ccall((:mpfr_set, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Int32), y, x, ROUNDING_MODE[]) stackdict[x] = y diff --git a/base/namedtuple.jl b/base/namedtuple.jl index e2be45251134b..6606456a43462 100644 --- a/base/namedtuple.jl +++ b/base/namedtuple.jl @@ -19,7 +19,7 @@ function NamedTuple{names,T}(args::Tuple) where {names, T <: Tuple} NT = NamedTuple{names,T} types = T.parameters fields = Any[ convert(types[i], args[i]) for i = 1:N ] - ccall(:jl_new_structv, Any, (Any, Ptr{Void}, UInt32), NT, fields, N)::NT + ccall(:jl_new_structv, Any, (Any, Ptr{Cvoid}, UInt32), NT, fields, N)::NT end else throw(ArgumentError("Wrong number of arguments to named tuple constructor.")) diff --git a/base/options.jl b/base/options.jl index 6095f6ac6dfaf..099b61388023c 100644 --- a/base/options.jl +++ b/base/options.jl @@ -43,7 +43,7 @@ end # This runs early in the sysimage != is not defined yet if sizeof(JLOptions) === ccall(:jl_sizeof_jl_options, Int, ()) else - ccall(:jl_throw, Void, (Any,), "Option structure mismatch") + ccall(:jl_throw, Cvoid, (Any,), "Option structure mismatch") end JLOptions() = unsafe_load(cglobal(:jl_options, JLOptions)) diff --git a/base/ordering.jl b/base/ordering.jl index 7d3f50f1baac4..f09967f3382a9 100644 --- a/base/ordering.jl +++ b/base/ordering.jl @@ -69,7 +69,7 @@ _ord(lt::typeof(isless), by, order::Ordering) = By(by) _ord(lt, by::typeof(identity), order::Ordering) = Lt(lt) _ord(lt, by, order::Ordering) = Lt((x,y)->lt(by(x),by(y))) -ord(lt, by, rev::Void, order::Ordering=Forward) = _ord(lt, by, order) +ord(lt, by, rev::Nothing, order::Ordering=Forward) = _ord(lt, by, order) function ord(lt, by, rev::Bool, order::Ordering=Forward) o = _ord(lt, by, order) diff --git a/base/parse.jl b/base/parse.jl index 9ecf359f7452b..303d622035837 100644 --- a/base/parse.jl +++ b/base/parse.jl @@ -264,9 +264,9 @@ function tryparse_internal(::Type{Float32}, s::SubString{String}, startpos::Int, end tryparse(::Type{T}, s::AbstractString) where {T<:Union{Float32,Float64}} = tryparse(T, String(s)) tryparse(::Type{Float16}, s::AbstractString) = - convert(Union{Float16, Void}, tryparse(Float32, s)) + convert(Union{Float16, Nothing}, tryparse(Float32, s)) tryparse_internal(::Type{Float16}, s::AbstractString, startpos::Int, endpos::Int) = - convert(Union{Float16, Void}, tryparse_internal(Float32, s, startpos, endpos)) + convert(Union{Float16, Nothing}, tryparse_internal(Float32, s, startpos, endpos)) ## string to complex functions ## diff --git a/base/path.jl b/base/path.jl index 524fe8c899597..147bdc2d23cf1 100644 --- a/base/path.jl +++ b/base/path.jl @@ -291,7 +291,7 @@ function realpath(path::AbstractString) buf = zeros(UInt16, length(p)) while true n = ccall((:GetFullPathNameW, "kernel32"), stdcall, - UInt32, (Ptr{UInt16}, UInt32, Ptr{UInt16}, Ptr{Void}), + UInt32, (Ptr{UInt16}, UInt32, Ptr{UInt16}, Ptr{Cvoid}), p, length(buf), buf, C_NULL) systemerror(:realpath, n == 0) x = n < length(buf) # is the buffer big enough? diff --git a/base/pcre.jl b/base/pcre.jl index 86fa17c9bd677..d144e9a6a5b1c 100644 --- a/base/pcre.jl +++ b/base/pcre.jl @@ -8,20 +8,20 @@ include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "pcre_h.jl")) # incl const PCRE_LIB = "libpcre2-8" -const JIT_STACK = Ref{Ptr{Void}}(C_NULL) -const MATCH_CONTEXT = Ref{Ptr{Void}}(C_NULL) +const JIT_STACK = Ref{Ptr{Cvoid}}(C_NULL) +const MATCH_CONTEXT = Ref{Ptr{Cvoid}}(C_NULL) function __init__() try JIT_STACK_START_SIZE = 32768 JIT_STACK_MAX_SIZE = 1048576 - JIT_STACK[] = ccall((:pcre2_jit_stack_create_8, PCRE_LIB), Ptr{Void}, - (Cint, Cint, Ptr{Void}), + JIT_STACK[] = ccall((:pcre2_jit_stack_create_8, PCRE_LIB), Ptr{Cvoid}, + (Cint, Cint, Ptr{Cvoid}), JIT_STACK_START_SIZE, JIT_STACK_MAX_SIZE, C_NULL) MATCH_CONTEXT[] = ccall((:pcre2_match_context_create_8, PCRE_LIB), - Ptr{Void}, (Ptr{Void},), C_NULL) - ccall((:pcre2_jit_stack_assign_8, PCRE_LIB), Void, - (Ptr{Void}, Ptr{Void}, Ptr{Void}), MATCH_CONTEXT[], C_NULL, JIT_STACK[]) + Ptr{Cvoid}, (Ptr{Cvoid},), C_NULL) + ccall((:pcre2_jit_stack_assign_8, PCRE_LIB), Cvoid, + (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), MATCH_CONTEXT[], C_NULL, JIT_STACK[]) catch ex Base.showerror_nostdio(ex, "WARNING: Error during initialization of module PCRE") @@ -69,10 +69,10 @@ const OPTIONS_MASK = COMPILE_MASK | EXECUTE_MASK const UNSET = ~Csize_t(0) # Indicates that an output vector element is unset -function info(regex::Ptr{Void}, what::Integer, ::Type{T}) where T +function info(regex::Ptr{Cvoid}, what::Integer, ::Type{T}) where T buf = Ref{T}() ret = ccall((:pcre2_pattern_info_8, PCRE_LIB), Int32, - (Ptr{Void}, Int32, Ptr{Void}), + (Ptr{Cvoid}, Int32, Ptr{Cvoid}), regex, what, buf) if ret != 0 error(ret == ERROR_NULL ? "NULL regex object" : @@ -85,50 +85,50 @@ end function get_ovec(match_data) ptr = ccall((:pcre2_get_ovector_pointer_8, PCRE_LIB), Ptr{Csize_t}, - (Ptr{Void},), match_data) + (Ptr{Cvoid},), match_data) n = ccall((:pcre2_get_ovector_count_8, PCRE_LIB), UInt32, - (Ptr{Void},), match_data) + (Ptr{Cvoid},), match_data) unsafe_wrap(Array, ptr, 2n, false) end function compile(pattern::AbstractString, options::Integer) errno = Ref{Cint}(0) erroff = Ref{Csize_t}(0) - re_ptr = ccall((:pcre2_compile_8, PCRE_LIB), Ptr{Void}, - (Ptr{UInt8}, Csize_t, UInt32, Ref{Cint}, Ref{Csize_t}, Ptr{Void}), + re_ptr = ccall((:pcre2_compile_8, PCRE_LIB), Ptr{Cvoid}, + (Ptr{UInt8}, Csize_t, UInt32, Ref{Cint}, Ref{Csize_t}, Ptr{Cvoid}), pattern, sizeof(pattern), options, errno, erroff, C_NULL) re_ptr == C_NULL && error("PCRE compilation error: $(err_message(errno[])) at offset $(erroff[])") re_ptr end -function jit_compile(regex::Ptr{Void}) +function jit_compile(regex::Ptr{Cvoid}) errno = ccall((:pcre2_jit_compile_8, PCRE_LIB), Cint, - (Ptr{Void}, UInt32), regex, JIT_COMPLETE) + (Ptr{Cvoid}, UInt32), regex, JIT_COMPLETE) errno == 0 || error("PCRE JIT error: $(err_message(errno))") end free_match_data(match_data) = - ccall((:pcre2_match_data_free_8, PCRE_LIB), Void, (Ptr{Void},), match_data) + ccall((:pcre2_match_data_free_8, PCRE_LIB), Cvoid, (Ptr{Cvoid},), match_data) free_re(re) = - ccall((:pcre2_code_free_8, PCRE_LIB), Void, (Ptr{Void},), re) + ccall((:pcre2_code_free_8, PCRE_LIB), Cvoid, (Ptr{Cvoid},), re) free_jit_stack(stack) = - ccall((:pcre2_jit_stack_free_8, PCRE_LIB), Void, (Ptr{Void},), stack) + ccall((:pcre2_jit_stack_free_8, PCRE_LIB), Cvoid, (Ptr{Cvoid},), stack) free_match_context(context) = - ccall((:pcre2_match_context_free_8, PCRE_LIB), Void, (Ptr{Void},), context) + ccall((:pcre2_match_context_free_8, PCRE_LIB), Cvoid, (Ptr{Cvoid},), context) function err_message(errno) buffer = Vector{UInt8}(uninitialized, 256) - ccall((:pcre2_get_error_message_8, PCRE_LIB), Void, + ccall((:pcre2_get_error_message_8, PCRE_LIB), Cvoid, (Int32, Ptr{UInt8}, Csize_t), errno, buffer, sizeof(buffer)) Base.@gc_preserve buffer unsafe_string(pointer(buffer)) end function exec(re,subject,offset,options,match_data) rc = ccall((:pcre2_match_8, PCRE_LIB), Cint, - (Ptr{Void}, Ptr{UInt8}, Csize_t, Csize_t, Cuint, Ptr{Void}, Ptr{Void}), + (Ptr{Cvoid}, Ptr{UInt8}, Csize_t, Csize_t, Cuint, Ptr{Cvoid}, Ptr{Cvoid}), re, subject, sizeof(subject), offset, options, match_data, MATCH_CONTEXT[]) # rc == -1 means no match, -2 means partial match. rc < -2 && error("PCRE.exec error: $(err_message(rc))") @@ -137,18 +137,18 @@ end function create_match_data(re) ccall((:pcre2_match_data_create_from_pattern_8, PCRE_LIB), - Ptr{Void}, (Ptr{Void}, Ptr{Void}), re, C_NULL) + Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}), re, C_NULL) end function substring_number_from_name(re, name) ccall((:pcre2_substring_number_from_name_8, PCRE_LIB), Cint, - (Ptr{Void}, Cstring), re, name) + (Ptr{Cvoid}, Cstring), re, name) end function substring_length_bynumber(match_data, number) s = Ref{Csize_t}() rc = ccall((:pcre2_substring_length_bynumber_8, PCRE_LIB), Cint, - (Ptr{Void}, UInt32, Ref{Csize_t}), match_data, number, s) + (Ptr{Cvoid}, UInt32, Ref{Csize_t}), match_data, number, s) rc < 0 && error("PCRE error: $(err_message(rc))") convert(Int, s[]) end @@ -156,7 +156,7 @@ end function substring_copy_bynumber(match_data, number, buf, buf_size) s = Ref{Csize_t}(buf_size) rc = ccall((:pcre2_substring_copy_bynumber_8, PCRE_LIB), Cint, - (Ptr{Void}, UInt32, Ptr{UInt8}, Ref{Csize_t}), + (Ptr{Cvoid}, UInt32, Ptr{UInt8}, Ref{Csize_t}), match_data, number, buf, s) rc < 0 && error("PCRE error: $(err_message(rc))") convert(Int, s[]) diff --git a/base/pkg/pkg.jl b/base/pkg/pkg.jl index cbf1230de71b1..c734557755580 100644 --- a/base/pkg/pkg.jl +++ b/base/pkg/pkg.jl @@ -22,7 +22,7 @@ const META_BRANCH = "metadata-v2" struct PkgError <: Exception msg::AbstractString - ex::Union{Exception, Void} + ex::Union{Exception, Nothing} end PkgError(msg::AbstractString) = PkgError(msg, nothing) function Base.showerror(io::IO, pkgerr::PkgError) @@ -137,7 +137,7 @@ package. installed() = cd(Entry.installed) """ - installed(pkg) -> Void | VersionNumber + installed(pkg) -> Nothing | VersionNumber If `pkg` is installed, return the installed version number. If `pkg` is registered, but not installed, return `nothing`. diff --git a/base/pkg/query.jl b/base/pkg/query.jl index efc0e5dc6a559..a4ca902dd7ea4 100644 --- a/base/pkg/query.jl +++ b/base/pkg/query.jl @@ -215,7 +215,7 @@ function check_partial_updates(reqs::Requires, end end -const PackageState = Union{Void,VersionNumber} +const PackageState = Union{Nothing,VersionNumber} function diff(have::Dict, want::Dict, avail::Dict, fixed::Dict) change = Vector{Tuple{String,Tuple{PackageState,PackageState}}}() diff --git a/base/pointer.jl b/base/pointer.jl index 2daa2e4a4408a..fb4c12b57f357 100644 --- a/base/pointer.jl +++ b/base/pointer.jl @@ -15,7 +15,7 @@ Ptr The C null pointer constant, sometimes used when calling external code. """ -const C_NULL = bitcast(Ptr{Void}, 0) +const C_NULL = bitcast(Ptr{Cvoid}, 0) # TODO: deprecate these conversions. C doesn't even allow them. @@ -83,13 +83,13 @@ a valid memory address to data of the requested length. """ function unsafe_wrap(::Union{Type{Array},Type{Array{T}},Type{Array{T,N}}}, p::Ptr{T}, dims::NTuple{N,Int}, own::Bool=false) where {T,N} - ccall(:jl_ptr_to_array, Array{T,N}, (Any, Ptr{Void}, Any, Int32), + ccall(:jl_ptr_to_array, Array{T,N}, (Any, Ptr{Cvoid}, Any, Int32), Array{T,N}, p, dims, own) end function unsafe_wrap(::Union{Type{Array},Type{Array{T}},Type{Array{T,1}}}, p::Ptr{T}, d::Integer, own::Bool=false) where {T} ccall(:jl_ptr_to_array_1d, Array{T,1}, - (Any, Ptr{Void}, Csize_t, Cint), Array{T,1}, p, d, own) + (Any, Ptr{Cvoid}, Csize_t, Cint), Array{T,1}, p, d, own) end unsafe_wrap(Atype::Type, p::Ptr, dims::NTuple{N,<:Integer}, own::Bool=false) where {N} = unsafe_wrap(Atype, p, convert(Tuple{Vararg{Int}}, dims), own) @@ -127,7 +127,7 @@ Convert a `Ptr` to an object reference. Assumes the pointer refers to a valid he Julia object. If this is not the case, undefined behavior results, hence this function is considered "unsafe" and should be used with care. """ -unsafe_pointer_to_objref(x::Ptr) = ccall(:jl_value_ptr, Any, (Ptr{Void},), x) +unsafe_pointer_to_objref(x::Ptr) = ccall(:jl_value_ptr, Any, (Ptr{Cvoid},), x) """ pointer_from_objref(x) @@ -136,8 +136,8 @@ Get the memory address of a Julia object as a `Ptr`. The existence of the result will not protect the object from garbage collection, so you must ensure that the object remains referenced for the whole time that the `Ptr` will be used. """ -pointer_from_objref(@nospecialize(x)) = ccall(:jl_value_ptr, Ptr{Void}, (Any,), x) -data_pointer_from_objref(@nospecialize(x)) = pointer_from_objref(x)::Ptr{Void} +pointer_from_objref(@nospecialize(x)) = ccall(:jl_value_ptr, Ptr{Cvoid}, (Any,), x) +data_pointer_from_objref(@nospecialize(x)) = pointer_from_objref(x)::Ptr{Cvoid} eltype(::Type{Ptr{T}}) where {T} = T diff --git a/base/precompile.jl b/base/precompile.jl index e4ba7ffbf6e55..72c9b57f8d220 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -14,7 +14,7 @@ precompile(Tuple{Type{Base.Multimedia.TextDisplay}, Base.TTY}) precompile(Tuple{typeof(Base._start)}) precompile(Tuple{typeof(Base.copyto!), Array{String, 1}, Int64, Array{Any, 1}, Int64, Int64}) precompile(Tuple{typeof(Base.finalizer), typeof(Base.uvfinalize), Base.TCPServer}) -precompile(Tuple{Type{Base.TCPServer}, Ptr{Void}, Int64}) +precompile(Tuple{Type{Base.TCPServer}, Ptr{Cvoid}, Int64}) precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Int32}) precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Libc.RawFD}) precompile(Tuple{typeof(Base.uv_status_string), Base.TCPServer}) @@ -98,7 +98,7 @@ precompile(Tuple{typeof(Base.finalizer), typeof(Base.uvfinalize), Base.Process}) precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Base.DevNullStream, Bool}}) precompile(Tuple{Type{Ref{Base.Cstring}}, Array{String, 1}}) precompile(Tuple{typeof(Core.Inference.eltype), Type{Array{String, 1}}}) -precompile(Tuple{typeof(Base.string), Void, String, DataType}) +precompile(Tuple{typeof(Base.string), Nothing, String, DataType}) precompile(Tuple{typeof(Base.print), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, String, Char}) precompile(Tuple{typeof(Base.throw_boundserror), Base.UnitRange{Int64}, Tuple{Base.UnitRange{Int64}}}) precompile(Tuple{typeof(Core.Inference.convert), Type{DataType}, Type{Bool}}) @@ -177,9 +177,9 @@ precompile(Tuple{typeof(Base.show_circular), Base.IOContext{Base.GenericIOBuffer precompile(Tuple{typeof(Base.show_delim_array), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Tuple{}, Char, Char, Char, Bool, Int64, Int64}) precompile(Tuple{typeof(Base.throw_boundserror), Array{Base.StackTraces.StackFrame, 1}, Tuple{Base.UnitRange{Int64}}}) precompile(Tuple{typeof(Base.splice!), Array{Base.StackTraces.StackFrame, 1}, Base.UnitRange{Int64}, Array{Any, 1}}) -precompile(Tuple{typeof(Base.REPL.ip_matches_func), Ptr{Void}, Symbol}) -precompile(Tuple{typeof(Base.throw_boundserror), Array{Ptr{Void}, 1}, Tuple{Base.UnitRange{Int64}}}) -precompile(Tuple{typeof(Base.unsafe_copyto!), Array{Ptr{Void}, 1}, Int64, Array{Ptr{Void}, 1}, Int64, Int64}) +precompile(Tuple{typeof(Base.REPL.ip_matches_func), Ptr{Cvoid}, Symbol}) +precompile(Tuple{typeof(Base.throw_boundserror), Array{Ptr{Cvoid}, 1}, Tuple{Base.UnitRange{Int64}}}) +precompile(Tuple{typeof(Base.unsafe_copyto!), Array{Ptr{Cvoid}, 1}, Int64, Array{Ptr{Cvoid}, 1}, Int64, Int64}) precompile(Tuple{Type{Base.Channel{Any}}, Int64}) precompile(Tuple{typeof(Base.rsearch), String, UInt8, Int64}) precompile(Tuple{typeof(Base.rsearch), String, Char, Int64}) @@ -199,24 +199,24 @@ precompile(Tuple{typeof(Base.sizehint!), Base.Dict{Symbol, Any}, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Symbol, Any}, Base.LineEdit.Prompt, Symbol}) precompile(Tuple{typeof(Base.copyto!), Base.IndexLinear, Array{Symbol, 1}, Base.IndexLinear, Array{UInt8, 1}}) precompile(Tuple{getfield(Base, Symbol("#kw##readline")), Array{Any, 1}, typeof(Base.readline), Base.IOStream}) -precompile(Tuple{Type{Core.Inference.Generator{I, F} where F where I}, Type{Core.Inference.Const}, Tuple{Void}}) -precompile(Tuple{Type{Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}, Type{Core.Inference.Const}, Tuple{Void}}) -precompile(Tuple{typeof(Core.Inference.convert), Type{Tuple{Void}}, Tuple{Void}}) -precompile(Tuple{typeof(Core.Inference.collect), Type{Any}, Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}) -precompile(Tuple{typeof(Core.Inference.iteratorsize), Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}) -precompile(Tuple{typeof(Core.Inference.iteratorsize), Type{Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}}) -precompile(Tuple{typeof(Core.Inference.iteratorsize), Type{Tuple{Void}}}) -precompile(Tuple{typeof(Core.Inference._collect), Type{Any}, Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}, Core.Inference.HasLength}) -precompile(Tuple{typeof(Core.Inference.length), Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}) -precompile(Tuple{typeof(Core.Inference.length), Tuple{Void}}) -precompile(Tuple{typeof(Core.Inference.copyto!), Array{Any, 1}, Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}) -precompile(Tuple{typeof(Core.Inference.start), Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}}) -precompile(Tuple{typeof(Core.Inference.start), Tuple{Void}}) -precompile(Tuple{typeof(Core.Inference.done), Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}, Int64}) -precompile(Tuple{typeof(Core.Inference.done), Tuple{Void}, Int64}) -precompile(Tuple{typeof(Core.Inference.next), Core.Inference.Generator{Tuple{Void}, Type{Core.Inference.Const}}, Int64}) -precompile(Tuple{typeof(Core.Inference.next), Tuple{Void}, Int64}) -precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Void}, Int64}) +precompile(Tuple{Type{Core.Inference.Generator{I, F} where F where I}, Type{Core.Inference.Const}, Tuple{Nothing}}) +precompile(Tuple{Type{Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}, Type{Core.Inference.Const}, Tuple{Nothing}}) +precompile(Tuple{typeof(Core.Inference.convert), Type{Tuple{Nothing}}, Tuple{Nothing}}) +precompile(Tuple{typeof(Core.Inference.collect), Type{Any}, Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}) +precompile(Tuple{typeof(Core.Inference.iteratorsize), Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}) +precompile(Tuple{typeof(Core.Inference.iteratorsize), Type{Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}}) +precompile(Tuple{typeof(Core.Inference.iteratorsize), Type{Tuple{Nothing}}}) +precompile(Tuple{typeof(Core.Inference._collect), Type{Any}, Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}, Core.Inference.HasLength}) +precompile(Tuple{typeof(Core.Inference.length), Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}) +precompile(Tuple{typeof(Core.Inference.length), Tuple{Nothing}}) +precompile(Tuple{typeof(Core.Inference.copyto!), Array{Any, 1}, Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}) +precompile(Tuple{typeof(Core.Inference.start), Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}}) +precompile(Tuple{typeof(Core.Inference.start), Tuple{Nothing}}) +precompile(Tuple{typeof(Core.Inference.done), Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}, Int64}) +precompile(Tuple{typeof(Core.Inference.done), Tuple{Nothing}, Int64}) +precompile(Tuple{typeof(Core.Inference.next), Core.Inference.Generator{Tuple{Nothing}, Type{Core.Inference.Const}}, Int64}) +precompile(Tuple{typeof(Core.Inference.next), Tuple{Nothing}, Int64}) +precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Nothing}, Int64}) precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Array{UInt8, 1}}, Array{String, 1}, Char}) precompile(Tuple{Type{Core.Inference.Generator{I, F} where F where I}, Type{Core.Inference.Const}, Tuple{String, typeof(Base.info)}}) precompile(Tuple{Type{Core.Inference.Generator{Tuple{String, typeof(Base.info)}, Type{Core.Inference.Const}}}, Type{Core.Inference.Const}, Tuple{String, typeof(Base.info)}}) @@ -305,8 +305,8 @@ precompile(Tuple{typeof(Base.LineEdit.keymap_unify), Array{Base.Dict{Any, Any}, precompile(Tuple{typeof(Base.LineEdit.validate_keymap), Base.Dict{Char, Any}}) precompile(Tuple{Type{Expr}, Symbol, GlobalRef, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue, SSAValue}) precompile(Tuple{typeof(Core.Inference.isbits), Tuple{String, typeof(Base.info)}}) -precompile(Tuple{typeof(Base.:(==)), Void, String}) -precompile(Tuple{Type{Symbol}, Void}) +precompile(Tuple{typeof(Base.:(==)), Nothing, String}) +precompile(Tuple{Type{Symbol}, Nothing}) precompile(Tuple{Type{Symbol}, Base.SubString{String}}) precompile(Tuple{typeof(Core.Inference.isbits), Base.REPL.REPLCompletionProvider}) precompile(Tuple{getfield(Core, Symbol("#kw#Type")), Array{Any, 1}, Type{Base.LineEdit.Prompt}, String}) @@ -325,13 +325,13 @@ precompile(Tuple{typeof(Core.Inference.isbits), Array{Base.Multimedia.AbstractDi precompile(Tuple{typeof(Base.Multimedia.popdisplay), Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}}) precompile(Tuple{Type{String}, Base.BitArray{1}}) precompile(Tuple{typeof(Base.REPL.ends_with_semicolon), String}) -precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Void, Int64}}) +precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Nothing, Int64}}) precompile(Tuple{typeof(Base.Multimedia.popdisplay), Base.REPL.REPLDisplay{Base.REPL.BasicREPL}}) precompile(Tuple{typeof(Base.Multimedia.popdisplay), Base.REPL.REPLDisplay{Base.REPL.StreamREPL}}) precompile(Tuple{typeof(Base.REPL.start_repl_backend), Base.Channel{Any}, Base.Channel{Any}}) -precompile(Tuple{typeof(Base._collect), Array{Ptr{Void}, 1}, Base.Generator{Array{Ptr{Void}, 1}, typeof(Base.StackTraces.lookup)}, Base.EltypeUnknown, Base.HasShape}) +precompile(Tuple{typeof(Base._collect), Array{Ptr{Cvoid}, 1}, Base.Generator{Array{Ptr{Cvoid}, 1}, typeof(Base.StackTraces.lookup)}, Base.EltypeUnknown, Base.HasShape}) precompile(Tuple{typeof(Base.shift!), Array{Base.StackTraces.StackFrame, 1}}) -precompile(Tuple{typeof(Base.StackTraces.stacktrace), Array{Ptr{Void}, 1}, Bool}) +precompile(Tuple{typeof(Base.StackTraces.stacktrace), Array{Ptr{Cvoid}, 1}, Bool}) precompile(Tuple{typeof(Base.success), Base.Process}) precompile(Tuple{typeof(Base.mapreduce_impl), typeof(Base.success), typeof(Base.:(&)), Array{Base.Process, 1}, Int64, Int64, Int64}) precompile(Tuple{typeof(Base.string), Base.Cmd}) @@ -341,13 +341,13 @@ precompile(Tuple{typeof(Core.Inference.isbits), Tuple{String, String, String}}) precompile(Tuple{getfield(Base, Symbol("#kw##shell_escape")), Array{Any, 1}, typeof(Base.shell_escape), Base.Cmd}) precompile(Tuple{typeof(Base.show), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Cmd}) precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Cmd}) -precompile(Tuple{typeof(Core.Inference.isbits), Ptr{Void}}) -precompile(Tuple{typeof(Base.cconvert), Type{Ptr{Base.Cstring}}, Ptr{Void}}) -precompile(Tuple{typeof(Base.cconvert), Type{Ptr{Base.Cstring}}, Void}) -precompile(Tuple{typeof(Base.cconvert), Type{Base.Cstring}, Ptr{Void}}) -precompile(Tuple{typeof(Base.unsafe_convert), Type{Ptr{Base.Cstring}}, Ptr{Void}}) +precompile(Tuple{typeof(Core.Inference.isbits), Ptr{Cvoid}}) +precompile(Tuple{typeof(Base.cconvert), Type{Ptr{Base.Cstring}}, Ptr{Cvoid}}) +precompile(Tuple{typeof(Base.cconvert), Type{Ptr{Base.Cstring}}, Nothing}) +precompile(Tuple{typeof(Base.cconvert), Type{Base.Cstring}, Ptr{Cvoid}}) +precompile(Tuple{typeof(Base.unsafe_convert), Type{Ptr{Base.Cstring}}, Ptr{Cvoid}}) precompile(Tuple{typeof(Base.unsafe_convert), Type{Ptr{Base.Cstring}}, Base.RefArray{Base.Cstring, Array{Base.Cstring, 1}, Any}}) -precompile(Tuple{Type{Base.Process}, Base.Cmd, Ptr{Void}, Base.DevNullStream, Base.DevNullStream, Base.DevNullStream}) +precompile(Tuple{Type{Base.Process}, Base.Cmd, Ptr{Cvoid}, Base.DevNullStream, Base.DevNullStream, Base.DevNullStream}) precompile(Tuple{getfield(Base, Symbol("#kw##spawn")), Array{Any, 1}, typeof(Base.spawn), Base.Cmd, Tuple{Base.DevNullStream, Base.DevNullStream, Base.DevNullStream}}) precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Tuple{String}, Tuple{String}, Tuple{String}}}) precompile(Tuple{typeof(Base.cmd_gen), Tuple{Tuple{String}, Tuple{String}, Tuple{String}}}) @@ -357,7 +357,7 @@ precompile(Tuple{typeof(Base.Terminals.hascolor), Base.Terminals.TTYTerminal}) precompile(Tuple{Type{Base.REPL.LineEditREPL}, Base.Terminals.TTYTerminal, Bool}) precompile(Tuple{typeof(Base.close), Base.IOStream}) precompile(Tuple{typeof(Base._atexit)}) -precompile(Tuple{getfield(Base, Symbol("#kw##notify")), Array{Any, 1}, typeof(Base.notify), Base.Condition, Void}) +precompile(Tuple{getfield(Base, Symbol("#kw##notify")), Array{Any, 1}, typeof(Base.notify), Base.Condition, Nothing}) precompile(Tuple{typeof(Base.uvfinalize), Base.TTY}) precompile(Tuple{typeof(Base.uv_status_string), Base.TTY}) precompile(Tuple{typeof(Base._fd), Base.TTY}) @@ -387,22 +387,22 @@ precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Int64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, Int64, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, String, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, String, String, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Void, String}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Void, String, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Nothing, String}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Nothing, String, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, String, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Char, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Char, String, Int64}) -precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##add_nested_key!")), Array{Any, 1}, typeof(Base.LineEdit.add_nested_key!), Base.Dict{Char, Any}, String, Void}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Void, Char, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Void, Char}) +precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##add_nested_key!")), Array{Any, 1}, typeof(Base.LineEdit.add_nested_key!), Base.Dict{Char, Any}, String, Nothing}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Nothing, Char, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Nothing, Char}) precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##add_nested_key!")), Array{Any, 1}, typeof(Base.LineEdit.add_nested_key!), Base.Dict{Char, Any}, String, Base.LineEdit.KeyAlias}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Base.LineEdit.KeyAlias, Char, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Base.LineEdit.KeyAlias, Char}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Void}, Void, String}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Void}, String}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Void}, Void, String, Int64}) -precompile(Tuple{typeof(Base.LineEdit.fixup_keymaps!), Base.Dict{Char, Any}, Int64, Char, Void}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Nothing}, Nothing, String}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Nothing}, String}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Nothing}, Nothing, String, Int64}) +precompile(Tuple{typeof(Base.LineEdit.fixup_keymaps!), Base.Dict{Char, Any}, Int64, Char, Nothing}) precompile(Tuple{typeof(Base.LineEdit.run_interface), Base.Terminals.TTYTerminal, Base.LineEdit.ModalInterface}) precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##refresh_multi_line")), Array{Any, 1}, typeof(Base.LineEdit.refresh_multi_line), Base.Terminals.TerminalBuffer, Base.Terminals.TTYTerminal, Base.GenericIOBuffer{Array{UInt8, 1}}, Base.LineEdit.InputAreaState, Base.LineEdit.PromptState}) precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##refresh_multi_line")), Array{Any, 1}, typeof(Base.LineEdit.refresh_multi_line), Base.Terminals.TerminalBuffer, Base.Terminals.TTYTerminal, Base.GenericIOBuffer{Array{UInt8, 1}}, Base.LineEdit.InputAreaState, Base.LineEdit.PrefixSearchState}) @@ -425,7 +425,7 @@ precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, B precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}}) precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}, Int64}) -precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Tuple{}, Void}}) +precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Tuple{}, Nothing}}) precompile(Tuple{typeof(Base.take!), Base.Channel{Any}}) precompile(Tuple{typeof(Base.n_avail), Base.Channel{Any}}) precompile(Tuple{typeof(Base.check_channel_state), Base.Channel{Any}}) @@ -489,12 +489,12 @@ precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Expr, Int64}}) precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Expr, Int64}}) precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Expr, Int64}}) precompile(Tuple{typeof(Base.REPL.eval_user_input), Expr, Base.REPL.REPLBackend}) -precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Int64, Void}}) -precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Int64, Void}}) -precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Int64, Void}}) -precompile(Tuple{typeof(Base.start), Tuple{Int64, Void}}) -precompile(Tuple{typeof(Base.REPL.print_response), Base.REPL.LineEditREPL, Int64, Void, Bool, Bool}) -precompile(Tuple{typeof(Base.REPL.print_response), Base.Terminals.TTYTerminal, Int64, Void, Bool, Bool, Void}) +precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Int64, Nothing}}) +precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Int64, Nothing}}) +precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Int64, Nothing}}) +precompile(Tuple{typeof(Base.start), Tuple{Int64, Nothing}}) +precompile(Tuple{typeof(Base.REPL.print_response), Base.REPL.LineEditREPL, Int64, Nothing, Bool, Bool}) +precompile(Tuple{typeof(Base.REPL.print_response), Base.Terminals.TTYTerminal, Int64, Nothing, Bool, Bool, Nothing}) precompile(Tuple{typeof(Base.print), Base.Terminals.TTYTerminal, DataType}) precompile(Tuple{typeof(Base.print), Base.Terminals.TTYTerminal, Char}) precompile(Tuple{typeof(Base.print), Base.Terminals.TTYTerminal, String, DataType, String, Char}) @@ -527,7 +527,7 @@ precompile(Tuple{typeof(Base.show), Base.IOContext{Base.Terminals.TTYTerminal}, precompile(Tuple{typeof(Base.StackTraces.show_spec_linfo), Base.IOContext{Base.Terminals.TTYTerminal}, Base.StackTraces.StackFrame}) precompile(Tuple{getfield(Base, Symbol("#kw##show")), Array{Any, 1}, typeof(Base.show), Base.IOContext{Base.Terminals.TTYTerminal}, Base.StackTraces.StackFrame}) precompile(Tuple{getfield(Base, Symbol("#kw##show_trace_entry")), Array{Any, 1}, typeof(Base.show_trace_entry), Base.IOContext{Base.Terminals.TTYTerminal}, Base.StackTraces.StackFrame, Int64}) -precompile(Tuple{typeof(Base.show_backtrace), Base.Terminals.TTYTerminal, Array{Ptr{Void}, 1}}) +precompile(Tuple{typeof(Base.show_backtrace), Base.Terminals.TTYTerminal, Array{Ptr{Cvoid}, 1}}) precompile(Tuple{typeof(Base.Multimedia.display), Int64}) precompile(Tuple{typeof(Core.Inference.isbits), Base.MIME{Symbol("text/plain")}}) precompile(Tuple{typeof(Core.Inference.isbits), Tuple{typeof(Base.Multimedia.display), typeof(Base.show)}}) @@ -549,19 +549,19 @@ precompile(Tuple{typeof(Base.LineEdit.complete_line), Base.REPL.REPLCompletionPr precompile(Tuple{getfield(Base, Symbol("#kw##parse")), Array{Any, 1}, typeof(Base.parse), String}) precompile(Tuple{typeof(Base.rsearch), String, Array{Char, 1}, Int64}) precompile(Tuple{getfield(Base.REPLCompletions, Symbol("#kw##find_start_brace")), Array{Any, 1}, typeof(Base.REPLCompletions.find_start_brace), String}) -precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Void, Void, Void}}) +precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Nothing, Nothing, Nothing}}) precompile(Tuple{typeof(Base.isidentifier), Base.SubString{String}}) -precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Bool, Void, Void}}) +precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Bool, Nothing, Nothing}}) precompile(Tuple{typeof(Base.Filesystem.readdir), String}) precompile(Tuple{typeof(Base.cmp), String, Base.SubString{String}}) -precompile(Tuple{typeof(Base.skip_deleted), Base.Dict{String, Void}, Int64}) -precompile(Tuple{typeof(Base.PCRE.exec), Ptr{Void}, String, UInt32, UInt32, Ptr{Void}}) -precompile(Tuple{typeof(Base.PCRE.exec), Ptr{Void}, String, UInt64, UInt32, Ptr{Void}}) +precompile(Tuple{typeof(Base.skip_deleted), Base.Dict{String, Nothing}, Int64}) +precompile(Tuple{typeof(Base.PCRE.exec), Ptr{Cvoid}, String, UInt32, UInt32, Ptr{Cvoid}}) +precompile(Tuple{typeof(Base.PCRE.exec), Ptr{Cvoid}, String, UInt64, UInt32, Ptr{Cvoid}}) precompile(Tuple{typeof(Base.nextind), String, UInt64}) precompile(Tuple{typeof(Base.matchall), Base.Regex, String, Bool}) precompile(Tuple{typeof(Base.skip_deleted), Base.Dict{String, String}, Int64}) precompile(Tuple{typeof(Base.reverse), String}) -precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Void, Bool}}) +precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Nothing, Bool}}) precompile(Tuple{typeof(Base._convert), Type{Array{Method, 1}}, Base.BitArray{1}}) precompile(Tuple{typeof(Base.unsafe_copyto!), Array{Method, 1}, Int64, Array{Method, 1}, Int64, Int64}) precompile(Tuple{typeof(Base.copyto!), Array{Method, 1}, Int64, Array{Method, 1}, Int64, Int64}) @@ -597,7 +597,7 @@ precompile(Tuple{typeof(Base._rsearchindex), String, String, Int64}) precompile(Tuple{typeof(Base.deleteat!), Array{Symbol, 1}, Base.UnitRange{Int64}}) precompile(Tuple{typeof(Base.copyto!), Array{String, 1}, Base.Generator{Array{Symbol, 1}, typeof(Base.string)}}) precompile(Tuple{typeof(Base.deleteat!), Array{String, 1}, Base.UnitRange{Int64}}) -precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{String, Void}, String}) +precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{String, Nothing}, String}) precompile(Tuple{typeof(Base.push!), Base.Set{String}, String}) precompile(Tuple{typeof(Base.isstructtype), DataType}) precompile(Tuple{typeof(Base.start), Array{Int64, 1}}) @@ -607,10 +607,10 @@ precompile(Tuple{typeof(Core.Inference.isbits), Tuple{DataType, Bool}}) precompile(Tuple{typeof(Base.is_default_method), Method}) precompile(Tuple{getfield(Base, Symbol("#kw##show")), Array{Any, 1}, typeof(Base.show), Base.GenericIOBuffer{Array{UInt8, 1}}, Method}) precompile(Tuple{typeof(Base.sort!), Array{String, 1}}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{String, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{String, Void}, String}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{String, Void}, Void, String, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{String, Void}, Void, String}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{String, Nothing}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{String, Nothing}, String}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{String, Nothing}, Nothing, String, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{String, Nothing}, Nothing, String}) precompile(Tuple{typeof(Base.Filesystem.realpath), Base.SubString{String}}) precompile(Tuple{typeof(Base.Filesystem.readdir), Base.SubString{String}}) precompile(Tuple{typeof(Base.REPLCompletions.dict_identifier_key), String, Symbol}) @@ -760,9 +760,9 @@ precompile(Tuple{Type{Base.Set{Symbol}}, Tuple{Symbol}}) precompile(Tuple{typeof(Base.union!), Base.Set{Symbol}, Tuple{Symbol}}) precompile(Tuple{typeof(Base.unique_from), Array{Any, 1}, Array{Symbol, 1}, Base.Set{Symbol}, Int64}) precompile(Tuple{typeof(Base.convert), Type{Base.Set{Any}}, Base.Set{Symbol}}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Void}, Symbol}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Void}, Void, Symbol, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Void}, Void, Symbol}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Nothing}, Symbol}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Nothing}, Nothing, Symbol, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Nothing}, Nothing, Symbol}) precompile(Tuple{typeof(Base.union!), Base.Set{Any}, Base.Set{Symbol}}) precompile(Tuple{typeof(Base.convert), Type{Array{Any, 1}}, Array{Symbol, 1}}) precompile(Tuple{typeof(Base.copyto!), Base.IndexLinear, Array{Any, 1}, Base.IndexLinear, Array{Symbol, 1}}) @@ -882,13 +882,13 @@ precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Array{Base.Docs.D precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Docs.Binding, Symbol, Int64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Type{Union{}}, Symbol, Int64}) precompile(Tuple{typeof(Base._collect), Array{Base.Docs.DocStr, 1}, Base.Generator{Array{Base.Docs.DocStr, 1}, typeof(Base.Docs.parsedoc)}, Base.EltypeUnknown, Base.HasShape}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Void}, typeof(Type)}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, typeof(Type), Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Void}, DataType}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, DataType, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, DataType}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, typeof(Type)}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, typeof(Type)}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, Nothing, typeof(Type), Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, DataType}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, Nothing, DataType, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, Nothing, DataType}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, Nothing, typeof(Type)}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{Union{DataType, typeof(Type)}, Nothing}, Int64}) precompile(Tuple{typeof(Base._subtypes), Module, DataType, Base.Set{Union{DataType, typeof(Type)}}, Base.Set{Module}}) precompile(Tuple{typeof(Base._subtypes), Module, DataType}) precompile(Tuple{typeof(Base.isempty), Array{Int64, 1}}) @@ -952,13 +952,13 @@ precompile(Tuple{getfield(Base, Symbol("#kw##parse")), Array{Any, 1}, typeof(Bas precompile(Tuple{typeof(Base.Markdown.interpinner), Base.GenericIOBuffer{Array{UInt8, 1}}, Bool}) precompile(Tuple{typeof(Base.Markdown.indentcode), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Markdown.MD}) precompile(Tuple{typeof(Base.Markdown.footnote), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Markdown.MD}) -precompile(Tuple{Type{Base.Markdown.Footnote}, Void, Array{Any, 1}}) +precompile(Tuple{Type{Base.Markdown.Footnote}, Nothing, Array{Any, 1}}) precompile(Tuple{Type{Base.Markdown.Footnote}, Base.SubString{String}, Array{Any, 1}}) precompile(Tuple{typeof(Base.Markdown.github_table), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Markdown.MD}) precompile(Tuple{typeof(Base.replace), String, String, String, Int64}) precompile(Tuple{typeof(Base.pop!), Array{Base.SubString{String}, 1}}) precompile(Tuple{typeof(Base.union!), Base.Set{Char}, String}) -precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Char, Void}, Char}) +precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Char, Nothing}, Char}) precompile(Tuple{typeof(Base.issubset), Base.SubString{String}, Base.Set{Char}}) precompile(Tuple{typeof(Core.Inference.length), Tuple{Core.Inference.Const, Core.Inference.Const, Core.Inference.Const, Core.Inference.Const, Core.Inference.Const}}) precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, Core.Inference.Const, Core.Inference.Const, Core.Inference.Const, Core.Inference.Const}, Int64}) @@ -968,11 +968,11 @@ precompile(Tuple{typeof(Base.Markdown.parseinline), Base.GenericIOBuffer{Base.Su precompile(Tuple{typeof(Base.read), Base.GenericIOBuffer{Base.SubArray{UInt8, 1, Array{UInt8, 1}, Tuple{Base.UnitRange{Int64}}, true}}, Type{Char}}) precompile(Tuple{typeof(Base.Markdown.parseinline), Base.GenericIOBuffer{Base.SubArray{UInt8, 1, Array{UInt8, 1}, Tuple{Base.UnitRange{Int64}}, true}}, Base.Markdown.MD, Base.Markdown.Config}) precompile(Tuple{typeof(Base.copyto!), Base.IndexLinear, Array{Array{Any, 1}, 1}, Base.IndexLinear, Array{Any, 1}}) -precompile(Tuple{typeof(Base.Markdown.parsealign), Void}) +precompile(Tuple{typeof(Base.Markdown.parsealign), Nothing}) precompile(Tuple{typeof(Base.Markdown.parsealign), Array{Base.SubString{String}, 1}}) -precompile(Tuple{typeof(Base.Markdown.rowlength!), Void, Int64}) +precompile(Tuple{typeof(Base.Markdown.rowlength!), Nothing, Int64}) precompile(Tuple{typeof(Base.Markdown.rowlength!), Array{Base.SubString{String}, 1}, Int64}) -precompile(Tuple{Type{Base.Markdown.Table}, Array{Any, 1}, Void}) +precompile(Tuple{Type{Base.Markdown.Table}, Array{Any, 1}, Nothing}) precompile(Tuple{Type{Base.Markdown.Table}, Array{Any, 1}, Array{Symbol, 1}}) precompile(Tuple{typeof(Base.Markdown.horizontalrule), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Markdown.MD}) precompile(Tuple{typeof(Core.Inference.isbits), Base.Markdown.HorizontalRule}) @@ -996,11 +996,11 @@ precompile(Tuple{typeof(Base.copyto!), Base.IndexLinear, Array{Any, 1}, Base.Ind precompile(Tuple{Type{Base.Markdown.MD}, Array{Base.Markdown.MD, 1}}) precompile(Tuple{Type{Base.Markdown.MD}, Base.Markdown.MD}) precompile(Tuple{typeof(Base.vcat), Base.Markdown.MD}) -precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Base.Markdown.MD, Void}}) -precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Base.Markdown.MD, Void}}) -precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Base.Markdown.MD, Void}}) -precompile(Tuple{typeof(Base.start), Tuple{Base.Markdown.MD, Void}}) -precompile(Tuple{typeof(Base.indexed_next), Tuple{Base.Markdown.MD, Void}, Int64, Int64}) +precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Base.Markdown.MD, Nothing}}) +precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Base.Markdown.MD, Nothing}}) +precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Base.Markdown.MD, Nothing}}) +precompile(Tuple{typeof(Base.start), Tuple{Base.Markdown.MD, Nothing}}) +precompile(Tuple{typeof(Base.indexed_next), Tuple{Base.Markdown.MD, Nothing}, Int64, Int64}) precompile(Tuple{typeof(Base.Multimedia.display), Base.Markdown.MD}) precompile(Tuple{typeof(Base.Multimedia.display), Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, Base.Markdown.MD}) precompile(Tuple{typeof(Base.displaysize), Base.Terminals.TTYTerminal}) @@ -1057,38 +1057,38 @@ precompile(Tuple{typeof(Base.open), Base.CmdRedirect, String, Base.DevNullStream precompile(Tuple{typeof(Base.spawn), Base.CmdRedirect, Tuple{Base.DevNullStream, Base.Pipe, Base.IOStream}}) precompile(Tuple{getfield(Base, Symbol("#kw##spawn")), Array{Any, 1}, typeof(Base.spawn), Base.Cmd, Tuple{Base.DevNullStream, Base.Pipe, Base.IOStream}}) precompile(Tuple{getfield(Base, Symbol("#kw##init_pipe!")), Array{Any, 1}, typeof(Base.init_pipe!), Base.PipeEndpoint}) -precompile(Tuple{typeof(Base._link_pipe), Ptr{Void}, Ptr{Void}}) +precompile(Tuple{typeof(Base._link_pipe), Ptr{Cvoid}, Ptr{Cvoid}}) precompile(Tuple{typeof(Base.link_pipe), Base.PipeEndpoint, Bool, Base.PipeEndpoint, Bool}) precompile(Tuple{typeof(Base.close), Base.Filesystem.File}) precompile(Tuple{typeof(Base.setup_stdio), Base.Pipe, Bool}) precompile(Tuple{typeof(Base.setup_stdio), Base.IOStream, Bool}) -precompile(Tuple{Type{Base.Process}, Base.Cmd, Ptr{Void}, Base.DevNullStream, Base.Pipe, Base.IOStream}) -precompile(Tuple{typeof(Base._jl_spawn), String, Array{String, 1}, Ptr{Void}, Base.Process, Base.DevNullStream, Base.PipeEndpoint, Base.Filesystem.File}) +precompile(Tuple{Type{Base.Process}, Base.Cmd, Ptr{Cvoid}, Base.DevNullStream, Base.Pipe, Base.IOStream}) +precompile(Tuple{typeof(Base._jl_spawn), String, Array{String, 1}, Ptr{Cvoid}, Base.Process, Base.DevNullStream, Base.PipeEndpoint, Base.Filesystem.File}) precompile(Tuple{Type{Base.Timer}, Int64, Float64}) precompile(Tuple{typeof(Base.sleep), Int64}) precompile(Tuple{typeof(Base._uv_hook_close), Base.PipeEndpoint}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{IO, Void}}}) -precompile(Tuple{Type{Base.Union{IO, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{AbstractString, Void}}}) -precompile(Tuple{Type{Base.Union{AbstractString, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Integer, Void}}}) -precompile(Tuple{Type{Base.Union{Integer, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Int64, Symbol, Void}}}) -precompile(Tuple{Type{Base.Union{Int64, Symbol, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Cmd, Void}}}) -precompile(Tuple{Type{Base.Union{Base.Cmd, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Some{Any}, Void}}}) -precompile(Tuple{Type{Base.Union{Some{Any}, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Bool, Void}}}) -precompile(Tuple{Type{Base.Union{Bool, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Process, Void}}}) -precompile(Tuple{Type{Base.Union{Base.Process, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Dict{K, V}, Void} where V where K}}) -precompile(Tuple{Type{Base.Union{Base.Dict{K, V}, Void} where V where K}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Array{T, N}, Void} where N where T}}) -precompile(Tuple{Type{Base.Union{Array{T, N}, Void} where N where T}}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.Process, Void}}, Base.Process}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Bool, Void}}, Bool}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{IO, Nothing}}}) +precompile(Tuple{Type{Base.Union{IO, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{AbstractString, Nothing}}}) +precompile(Tuple{Type{Base.Union{AbstractString, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Integer, Nothing}}}) +precompile(Tuple{Type{Base.Union{Integer, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Int64, Symbol, Nothing}}}) +precompile(Tuple{Type{Base.Union{Int64, Symbol, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Cmd, Nothing}}}) +precompile(Tuple{Type{Base.Union{Base.Cmd, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Some{Any}, Nothing}}}) +precompile(Tuple{Type{Base.Union{Some{Any}, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Bool, Nothing}}}) +precompile(Tuple{Type{Base.Union{Bool, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Process, Nothing}}}) +precompile(Tuple{Type{Base.Union{Base.Process, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Dict{K, V}, Nothing} where V where K}}) +precompile(Tuple{Type{Base.Union{Base.Dict{K, V}, Nothing} where V where K}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Array{T, N}, Nothing} where N where T}}) +precompile(Tuple{Type{Base.Union{Array{T, N}, Nothing} where N where T}}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.Process, Nothing}}, Base.Process}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Bool, Nothing}}, Bool}) precompile(Tuple{typeof(Base.task_done_hook), Task}) precompile(Tuple{typeof(Base.getindex), Tuple{Array{Any, 1}, Tuple{}}, Int64}) precompile(Tuple{Type{Base.TCPSocket}}) @@ -1153,9 +1153,9 @@ precompile(Tuple{typeof(Base.ndigits0z), UInt8}) precompile(Tuple{typeof(Base.dec), UInt8, Int64, Bool}) precompile(Tuple{typeof(Core.Inference.length), Tuple{Core.Inference.Const, typeof(Type), Core.Inference.Const}}) precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, typeof(Type), Core.Inference.Const}, Int64}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Void}, Int64}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Void}, Void, Int64, Int64}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Nothing}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Nothing}, Int64}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Nothing}, Nothing, Int64, Int64}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{AbstractString, Base.Semaphore}, Int64}) precompile(Tuple{typeof(Base.resize!), Array{Base.Semaphore, 1}, Int64}) precompile(Tuple{typeof(Base.acquire), Base.Semaphore}) @@ -1174,7 +1174,7 @@ precompile(Tuple{typeof(Base._uv_hook_close), Base.Timer}) precompile(Tuple{typeof(Base.notify), Base.Condition, Base.EOFError, Bool, Bool}) precompile(Tuple{typeof(Base.unpreserve_handle), Base.Timer}) precompile(Tuple{typeof(Base.disassociate_julia_struct), Base.Timer}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{AbstractString, Void}}, Base.SubString{String}}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{AbstractString, Nothing}}, Base.SubString{String}}) precompile(Tuple{typeof(Base.connect!), Base.TCPSocket, Base.SubString{String}, UInt16}) precompile(Tuple{typeof(Base.notify), Base.Condition, Base.IPv4, Bool, Bool}) precompile(Tuple{typeof(Base.schedule), Task, Base.IPv4}) @@ -1183,7 +1183,7 @@ precompile(Tuple{typeof(Base.uv_status_string), Base.TCPSocket}) precompile(Tuple{typeof(Base._fd), Base.TCPSocket}) precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.TCPSocket}) precompile(Tuple{typeof(Base.isopen), Base.TCPSocket}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{AbstractString, Void}}, String}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{AbstractString, Nothing}}, String}) precompile(Tuple{typeof(Base.unpreserve_handle), Base.TCPSocket}) precompile(Tuple{typeof(Base.check_open), Base.TCPSocket}) precompile(Tuple{typeof(Base.stream_wait), Base.TCPSocket, Base.Condition}) @@ -1200,7 +1200,7 @@ precompile(Tuple{typeof(Base.unsafe_read), Base.TCPSocket, Ptr{UInt8}, UInt64}) precompile(Tuple{typeof(Base.read!), Base.TCPSocket, Array{Int64, 1}}) precompile(Tuple{typeof(Base.read), Base.TCPSocket, Type{UInt8}}) precompile(Tuple{typeof(Base.convert), Type{IO}, Base.TCPSocket}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.VersionNumber, Void}}, Base.Union{Base.VersionNumber, Void}}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.VersionNumber, Nothing}}, Base.Union{Base.VersionNumber, Nothing}}) precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Array{UInt8, 1}}, Tuple{Int64}, Char}) precompile(Tuple{typeof(Base.close), Base.TCPSocket}) precompile(Tuple{typeof(Base.convert), Type{Base.AbstractChannel}, Base.Channel{Any}}) @@ -1209,10 +1209,10 @@ precompile(Tuple{typeof(Base.dec), UInt8, Int64, Bool}) precompile(Tuple{typeof(Core.Inference.mk_getfield), TypedSlot, Int64, Type{Integer}}) precompile(Tuple{typeof(Core.Inference.length), Tuple{Core.Inference.Const, DataType, Core.Inference.Const}}) precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, DataType, Core.Inference.Const}, Int64}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Void}, Int64}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Void}, Void, Int64, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Void}, Void, Int64}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Nothing}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Nothing}, Int64}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Nothing}, Nothing, Int64, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Nothing}, Nothing, Int64}) precompile(Tuple{typeof(Base.wait_connected), Base.TCPSocket}) precompile(Tuple{typeof(Base.write), Base.TCPSocket, String}) precompile(Tuple{typeof(Base.uv_write), Base.TCPSocket, Ptr{UInt8}, UInt64}) @@ -1233,9 +1233,9 @@ precompile(Tuple{typeof(Base.resize!), Array{UInt64, 1}, Int64}) precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, UInt64}, UInt64}) precompile(Tuple{typeof(Core.Inference.isbits), Symbol}) precompile(Tuple{typeof(Base.isassigned), Array{Symbol, 1}, Int64}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, Void}, UInt64}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{UInt64, Void}, Void, UInt64, Int64}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, Nothing}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, Nothing}, UInt64}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{UInt64, Nothing}, Nothing, UInt64, Int64}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Any}, TypeName}) precompile(Tuple{typeof(Base.Serializer.object_number), TypeName}) precompile(Tuple{typeof(Base.isassigned), Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}, Int64}) @@ -1265,32 +1265,32 @@ precompile(Tuple{typeof(Base.read!), Base.TCPSocket, Array{Int64, 1}}) precompile(Tuple{typeof(Base.read), Base.TCPSocket, Type{UInt8}}) precompile(Tuple{typeof(Base._array_for), Type{Union{}}, Base.UnitRange{Int64}, Base.HasShape}) precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Array{UInt8, 1}}, Tuple{Int64}, Char}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Void}, Void, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Nothing}, Nothing, Int64}) precompile(Tuple{Type{Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}}, Tuple{Int64}}) precompile(Tuple{typeof(Base.eachindex), Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}}) precompile(Tuple{typeof(Base.LinAlg.BLAS.set_num_threads), Int64}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{IO, Void}}}) -precompile(Tuple{Type{Base.Union{IO, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{AbstractString, Void}}}) -precompile(Tuple{Type{Base.Union{AbstractString, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Integer, Void}}}) -precompile(Tuple{Type{Base.Union{Integer, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Some{Union{Int64, Symbol}}, Void}}}) -precompile(Tuple{Type{Base.Union{Int64, Symbol, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Cmd, Void}}}) -precompile(Tuple{Type{Base.Union{Base.Cmd, Void}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{IO, Nothing}}}) +precompile(Tuple{Type{Base.Union{IO, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{AbstractString, Nothing}}}) +precompile(Tuple{Type{Base.Union{AbstractString, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Integer, Nothing}}}) +precompile(Tuple{Type{Base.Union{Integer, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Some{Union{Int64, Symbol}}, Nothing}}}) +precompile(Tuple{Type{Base.Union{Int64, Symbol, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Cmd, Nothing}}}) +precompile(Tuple{Type{Base.Union{Base.Cmd, Nothing}}}) precompile(Tuple{typeof(Base.eltype), Type{Any}}) precompile(Tuple{Type{Any}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Bool, Void}}}) -precompile(Tuple{Type{Base.Union{Bool, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Process, Void}}}) -precompile(Tuple{Type{Base.Union{Base.Process, Void}}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Dict{K, V}, Void} where V where K}}) -precompile(Tuple{Type{Base.Union{Base.Dict{K, V}, Void} where V where K}}) -precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Array{T, N}, Void} where N where T}}) -precompile(Tuple{Type{Base.Union{Array{T, N}, Void} where N where T}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Bool, Nothing}}}) +precompile(Tuple{Type{Base.Union{Bool, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Process, Nothing}}}) +precompile(Tuple{Type{Base.Union{Base.Process, Nothing}}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Base.Dict{K, V}, Nothing} where V where K}}) +precompile(Tuple{Type{Base.Union{Base.Dict{K, V}, Nothing} where V where K}}) +precompile(Tuple{typeof(Base.eltype), Type{Base.Union{Array{T, N}, Nothing} where N where T}}) +precompile(Tuple{Type{Base.Union{Array{T, N}, Nothing} where N where T}}) precompile(Tuple{typeof(Base.convert), Type{IO}, Base.TCPSocket}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.VersionNumber, Void}}, Base.VersionNumber}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.VersionNumber, Nothing}}, Base.VersionNumber}) precompile(Tuple{typeof(Base.unsafe_write), Base.TCPSocket, Ptr{UInt8}, UInt64}) precompile(Tuple{typeof(Base.uv_write), Base.TCPSocket, Ptr{UInt8}, UInt64}) precompile(Tuple{typeof(Base.flush), Base.TCPSocket}) @@ -1307,17 +1307,17 @@ precompile(Tuple{typeof(Base.promote_result), Type{Int64}, Type{UInt8}, Type{Uni precompile(Tuple{typeof(Base.read!), Base.TCPSocket, Array{UInt64, 1}}) precompile(Tuple{typeof(Base._array_for), Type{Union{}}, Base.UnitRange{Int64}, Base.HasShape}) precompile(Tuple{typeof(Base.read), Base.TCPSocket, Type{Int64}}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{WeakRef, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{WeakRef, Void}, WeakRef}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{WeakRef, Void}, Void, WeakRef, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{WeakRef, Void}, Void, WeakRef}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{WeakRef, Nothing}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{WeakRef, Nothing}, WeakRef}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{WeakRef, Nothing}, Nothing, WeakRef, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{WeakRef, Nothing}, Nothing, WeakRef}) precompile(Tuple{Type{Base.Channel{Int64}}, Int64}) -precompile(Tuple{typeof(Base.get), Base.Union{Base.Dict{K, V}, Void} where V where K, Base.Dict{Any, Any}}) +precompile(Tuple{typeof(Base.get), Base.Union{Base.Dict{K, V}, Nothing} where V where K, Base.Dict{Any, Any}}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Int64, Symbol}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Int64, Symbol, Int64}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.Dict{K, V}, Void} where V where K}, Base.Dict{Any, Any}}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Integer, Void}}, Int64}) -precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.VersionNumber, Void}}, Base.VersionNumber}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.Dict{K, V}, Nothing} where V where K}, Base.Dict{Any, Any}}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Integer, Nothing}}, Int64}) +precompile(Tuple{typeof(Base.convert), Type{Base.Union{Base.VersionNumber, Nothing}}, Base.VersionNumber}) precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Int64}) precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Int64}) precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Int64}) @@ -1331,14 +1331,14 @@ precompile(Tuple{typeof(Base.Serializer.serialize_array_data), Base.TCPSocket, A precompile(Tuple{typeof(Base.sort!), Array{Int64, 1}, Int64, Int64, Base.Sort.InsertionSortAlg, Base.Order.ForwardOrdering}) precompile(Tuple{typeof(Base.Sort.partition!), Array{Int64, 1}, Int64, Int64, Base.Order.ForwardOrdering}) precompile(Tuple{typeof(Base.sort!), Array{Int64, 1}, Int64, Int64, Base.Sort.QuickSortAlg, Base.Order.ForwardOrdering}) -precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Array{Int64, 1}, Void}}) -precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Array{Int64, 1}, Void}}) -precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Array{Int64, 1}, Void}}) +precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Array{Int64, 1}, Nothing}}) +precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Array{Int64, 1}, Nothing}}) +precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Array{Int64, 1}, Nothing}}) precompile(Tuple{typeof(Base.promote_type), Type{Int64}, Type{Int64}}) -precompile(Tuple{typeof(Base.sizehint!), Base.Dict{Int64, Void}, Int64}) +precompile(Tuple{typeof(Base.sizehint!), Base.Dict{Int64, Nothing}, Int64}) precompile(Tuple{typeof(Base.union!), Base.Set{Int64}, Array{Int64, 1}}) -precompile(Tuple{typeof(Base.start), Tuple{Array{Int64, 1}, Void}}) -precompile(Tuple{typeof(Base.indexed_next), Tuple{Array{Int64, 1}, Void}, Int64, Int64}) +precompile(Tuple{typeof(Base.start), Tuple{Array{Int64, 1}, Nothing}}) +precompile(Tuple{typeof(Base.indexed_next), Tuple{Array{Int64, 1}, Nothing}, Int64, Int64}) precompile(Tuple{typeof(Base.setdiff), Array{Int64, 1}, Array{Int64, 1}}) precompile(Tuple{typeof(Base.Multimedia.display), Array{Int64, 1}}) precompile(Tuple{typeof(Base.isassigned), Array{Int64, 1}, Int64}) @@ -1387,7 +1387,7 @@ precompile(Tuple{typeof(Base.uvfinalize), Base.TCPSocket}) precompile(Tuple{typeof(Base._uv_hook_close), Base.TCPSocket}) precompile(Tuple{typeof(Base.in), Int64, Base.BitSet}) precompile(Tuple{typeof(Base._uv_hook_close), Base.Process}) -precompile(Tuple{typeof(Base._delete!), Base.Dict{WeakRef, Void}, Int64}) +precompile(Tuple{typeof(Base._delete!), Base.Dict{WeakRef, Nothing}, Int64}) precompile(Tuple{typeof(Base.delete!), Base.BitSet, Int64}) precompile(Tuple{typeof(Base.isempty), Base.BitSet}) precompile(Tuple{typeof(Base.any), Base.BitArray{1}}) @@ -1401,7 +1401,7 @@ precompile(Tuple{getfield(Base, Symbol("#kw##spawn")), Array{Any, 1}, typeof(Bas precompile(Tuple{getfield(Base, Symbol("#kw##systemerror")), Array{Any, 1}, typeof(Base.systemerror), Symbol, Bool}) precompile(Tuple{getfield(Base, Symbol("#kw##with_output_color")), Array{Any, 1}, typeof(Base.with_output_color), typeof(Base.println), Symbol, Base.IOStream, Base.SubString{String}}) precompile(Tuple{getfield(Base, Symbol("#kw##with_output_color")), Array{Any, 1}, typeof(Base.with_output_color), typeof(Base.print), Symbol, Base.IOStream, String}) -precompile(Tuple{Type{Base.Process}, Base.Cmd, Ptr{Void}, Base.Pipe, Base.TTY, Base.IOStream}) +precompile(Tuple{Type{Base.Process}, Base.Cmd, Ptr{Cvoid}, Base.Pipe, Base.TTY, Base.IOStream}) precompile(Tuple{Type{Base.Set{Tuple{String, Float64}}}, Tuple{Tuple{String, Float64}}}) precompile(Tuple{Type{Base.VersionNumber}, Int64, Int64, Int64, Tuple{String, Int64}, Tuple{}}) precompile(Tuple{Type{Base.VersionNumber}, Int64, Int64, Int64, Tuple{String}, Tuple{Int64}}) @@ -1437,21 +1437,21 @@ precompile(Tuple{typeof(Base.Grisu._show), Base.IOContext{Base.GenericIOBuffer{A precompile(Tuple{typeof(Base.hash), Tuple{String, Float64}, UInt64}) precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Symbol, Base.Condition}, Symbol}) precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Symbol, UInt64}, Symbol}) -precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Tuple{String, Float64}, Nothing}, Tuple{String, Float64}}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, Base.Condition}, Symbol}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, UInt64}, Symbol}) -precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}}) +precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Tuple{String, Float64}, Nothing}, Tuple{String, Float64}}) precompile(Tuple{typeof(Base.ident_cmp), Tuple{String, String, Int64}, Tuple{String, Int64}}) precompile(Tuple{typeof(Base.include_relative), String}) precompile(Tuple{typeof(Base._include_from_serialized), String, Vector{Module}}) precompile(Tuple{typeof(Base.indexed_next), Tuple{Symbol, UInt64}, Int64, Int64}) -precompile(Tuple{typeof(Base.indexed_next), Tuple{Void, Void}, Int64, Int64}) +precompile(Tuple{typeof(Base.indexed_next), Tuple{Nothing, Nothing}, Int64, Int64}) precompile(Tuple{typeof(Base.isassigned), Array{String, 1}, Int64}) precompile(Tuple{typeof(Base.isempty), Tuple{String, Int64}}) precompile(Tuple{typeof(Base.isequal), Float64, String}) precompile(Tuple{typeof(Base.isequal), String, Float64}) precompile(Tuple{typeof(Base.isequal), Tuple{String, Float64}, Tuple{String, Float64}}) -precompile(Tuple{typeof(Base._jl_spawn), String, Array{String, 1}, Ptr{Void}, Base.Process, Base.PipeEndpoint, Base.TTY, Base.Filesystem.File}) +precompile(Tuple{typeof(Base._jl_spawn), String, Array{String, 1}, Ptr{Cvoid}, Base.Process, Base.PipeEndpoint, Base.TTY, Base.Filesystem.File}) precompile(Tuple{typeof(Base.julia_cmd)}) precompile(Tuple{typeof(Base.next), Base.Generator{Array{Any, 1}, typeof(Base.FastMath.make_fastmath)}, Int64}) precompile(Tuple{typeof(Base.open), Base.CmdRedirect, String, Base.TTY}) @@ -1465,9 +1465,9 @@ precompile(Tuple{typeof(Base.__precompile__)}) precompile(Tuple{typeof(Base.__precompile__), Bool}) precompile(Tuple{typeof(Base.println_with_color), Symbol, Base.IOStream, Base.SubString{String}}) precompile(Tuple{typeof(Base.push!), Array{Tuple{String, Float64}, 1}, Tuple{String, Float64}}) -precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Void, Void}}) -precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Void, Void}}) -precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Void, Void}}) +precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Nothing, Nothing}}) +precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Nothing, Nothing}}) +precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Nothing, Nothing}}) precompile(Tuple{typeof(Base.read), Base.IOStream, Type{Int32}}) precompile(Tuple{typeof(Base.read), Base.IOStream, Type{Int64}}) precompile(Tuple{typeof(Base.read), Base.IOStream, Type{UInt64}}) @@ -1478,11 +1478,11 @@ precompile(Tuple{typeof(Base.read), Base.PipeEndpoint, Type{UInt64}}) precompile(Tuple{typeof(Base.read), Base.PipeEndpoint, Type{UInt8}}) precompile(Tuple{typeof(Base.readbytes_all!), Base.IOStream, Array{UInt8, 1}, Int32}) precompile(Tuple{typeof(Base.readbytes_some!), Base.IOStream, Array{UInt8, 1}, Int32}) -precompile(Tuple{typeof(Base._redirect), Base.IOStream, Base.Dict{Tuple{Union{Module, Void}, Union{Symbol, Void}}, IO}, Base.StackTraces.StackFrame}) -precompile(Tuple{typeof(Base._redirect), Base.IOStream, Base.Dict{Tuple{Union{Module, Void}, Union{Symbol, Void}}, IO}, Symbol}) +precompile(Tuple{typeof(Base._redirect), Base.IOStream, Base.Dict{Tuple{Union{Module, Nothing}, Union{Symbol, Nothing}}, IO}, Base.StackTraces.StackFrame}) +precompile(Tuple{typeof(Base._redirect), Base.IOStream, Base.Dict{Tuple{Union{Module, Nothing}, Union{Symbol, Nothing}}, IO}, Symbol}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{Symbol, Base.Condition}, Int64}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{Symbol, UInt64}, Int64}) -precompile(Tuple{typeof(Base.rehash!), Base.Dict{Tuple{String, Float64}, Void}, Int64}) +precompile(Tuple{typeof(Base.rehash!), Base.Dict{Tuple{String, Float64}, Nothing}, Int64}) precompile(Tuple{typeof(Base.remove_linenums!), Module}) precompile(Tuple{typeof(Base._require_from_serialized), Symbol, String, Vector{Pair{Symbol, UInt64}}}) precompile(Tuple{typeof(Base._require_search_from_serialized), Symbol, String}) @@ -1531,16 +1531,16 @@ precompile(Tuple{typeof(Base.setindex!), Base.Dict{Symbol, Base.Condition}, Base precompile(Tuple{typeof(Base._setindex!), Base.Dict{Symbol, Base.Condition}, Base.Condition, Symbol, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Symbol, UInt64}, UInt64, Symbol}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Symbol, UInt64}, UInt64, Symbol, Int64}) -precompile(Tuple{typeof(Base.setindex!), Base.Dict{Tuple{String, Float64}, Void}, Void, Tuple{String, Float64}}) -precompile(Tuple{typeof(Base._setindex!), Base.Dict{Tuple{String, Float64}, Void}, Void, Tuple{String, Float64}, Int64}) +precompile(Tuple{typeof(Base.setindex!), Base.Dict{Tuple{String, Float64}, Nothing}, Nothing, Tuple{String, Float64}}) +precompile(Tuple{typeof(Base._setindex!), Base.Dict{Tuple{String, Float64}, Nothing}, Nothing, Tuple{String, Float64}, Int64}) precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Float64}) precompile(Tuple{typeof(Base.show_delim_array), Base.GenericIOBuffer{Array{UInt8, 1}}, Tuple{String, Float64}, Char, Char, Char, Bool, Int64, Int64}) precompile(Tuple{typeof(Base.show_unquoted), Base.GenericIOBuffer{Array{UInt8, 1}}, Expr}) -precompile(Tuple{typeof(Base.skip_deleted), Base.Dict{Tuple{String, Float64}, Void}, Int64}) +precompile(Tuple{typeof(Base.skip_deleted), Base.Dict{Tuple{String, Float64}, Nothing}, Int64}) precompile(Tuple{typeof(Base.spawn), Base.CmdRedirect, Tuple{Base.Pipe, Base.TTY, Base.IOStream}}) precompile(Tuple{typeof(Base.stale_cachefile), String, String}) precompile(Tuple{typeof(Base.start), Tuple{Symbol, UInt64}}) -precompile(Tuple{typeof(Base.start), Tuple{Void, Void}}) +precompile(Tuple{typeof(Base.start), Tuple{Nothing, Nothing}}) precompile(Tuple{typeof(Base.:(>)), String, String}) precompile(Tuple{typeof(Base.trunc), Float64, Int64, Int64}) precompile(Tuple{typeof(Base.union!), Base.Set{Tuple{String, Float64}}, Tuple{Tuple{String, Float64}}}) diff --git a/base/printf.jl b/base/printf.jl index 536fb5decaf17..0527878932160 100644 --- a/base/printf.jl +++ b/base/printf.jl @@ -1002,7 +1002,7 @@ end function ini_dec(x::SmallFloatingPoint, n::Int) if x == 0.0 - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), DIGITS, '0', n) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), DIGITS, '0', n) return Int32(1), Int32(1), signbit(x) else len,pt,neg = grisu(x,Grisu.PRECISION,n) @@ -1012,15 +1012,15 @@ end function ini_dec(x::BigInt, n::Int) if x.size == 0 - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), DIGITS, '0', n) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), DIGITS, '0', n) return Int32(1), Int32(1), false end d = Base.ndigits0z(x) if d <= n info = decode_dec(x) d == n && return info - p = convert(Ptr{Void}, DIGITS) + info[2] - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), p, '0', n - info[2]) + p = convert(Ptr{Cvoid}, DIGITS) + info[2] + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), p, '0', n - info[2]) return info end return (n, d, decode_dec(round(BigInt,x/big(10)^(d-n)))[3]) @@ -1039,7 +1039,7 @@ ini_hex(x::Real, symbols::Array{UInt8,1}) = ini_hex(float(x), symbols) function ini_hex(x::SmallFloatingPoint, n::Int, symbols::Array{UInt8,1}) x = Float64(x) if x == 0.0 - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), DIGITS, '0', n) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), DIGITS, '0', n) return Int32(1), Int32(0), signbit(x) else s, p = frexp(x) @@ -1048,7 +1048,7 @@ function ini_hex(x::SmallFloatingPoint, n::Int, symbols::Array{UInt8,1}) # ensure last 2 exponent bits either 01 or 10 u = (reinterpret(UInt64,s) & 0x003f_ffff_ffff_ffff) >> (52-sigbits) if n > 14 - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), DIGITS, '0', n) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), DIGITS, '0', n) end i = (sizeof(u)<<1)-(leading_zeros(u)>>2) while i > 0 @@ -1064,7 +1064,7 @@ end function ini_hex(x::SmallFloatingPoint, symbols::Array{UInt8,1}) x = Float64(x) if x == 0.0 - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), DIGITS, '0', 1) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), DIGITS, '0', 1) return Int32(1), Int32(0), signbit(x) else s, p = frexp(x) diff --git a/base/process.jl b/base/process.jl index ec60da41bbe1c..7bde9efb63fe2 100644 --- a/base/process.jl +++ b/base/process.jl @@ -11,7 +11,7 @@ struct Cmd <: AbstractCmd exec::Vector{String} ignorestatus::Bool flags::UInt32 # libuv process flags - env::Union{Array{String},Void} + env::Union{Array{String},Nothing} dir::String Cmd(exec::Vector{String}) = new(exec, false, 0x00, nothing, "") @@ -152,11 +152,11 @@ uvhandle(x::Ptr) = x uvtype(::Ptr) = UV_STREAM # Not actually a pointer, but that's how we pass it through the C API so it's fine -uvhandle(x::RawFD) = convert(Ptr{Void}, x.fd % UInt) +uvhandle(x::RawFD) = convert(Ptr{Cvoid}, x.fd % UInt) uvtype(x::RawFD) = UV_RAW_FD const Redirectable = Union{IO, FileRedirect, RawFD} -const StdIOSet = NTuple{3, Union{Redirectable, Ptr{Void}}} # XXX: remove Ptr{Void} once libuv is refactored to use upstream release +const StdIOSet = NTuple{3, Union{Redirectable, Ptr{Cvoid}}} # XXX: remove Ptr{Cvoid} once libuv is refactored to use upstream release struct CmdRedirect <: AbstractCmd cmd::AbstractCmd @@ -209,7 +209,7 @@ byteenv(env::AbstractArray{<:AbstractString}) = String[cstr(x) for x in env] byteenv(env::AbstractDict) = String[cstr(string(k)*"="*string(v)) for (k,v) in env] -byteenv(env::Void) = nothing +byteenv(env::Nothing) = nothing byteenv(env::Union{AbstractVector{Pair{T}}, Tuple{Vararg{Pair{T}}}}) where {T<:AbstractString} = String[cstr(k*"="*string(v)) for (k,v) in env] @@ -302,7 +302,7 @@ pipeline(a, b, c, d...) = pipeline(pipeline(a,b), c, d...) mutable struct Process <: AbstractPipe cmd::Cmd - handle::Ptr{Void} + handle::Ptr{Cvoid} in::IO out::IO err::IO @@ -311,10 +311,10 @@ mutable struct Process <: AbstractPipe exitnotify::Condition closenotify::Condition openstream::Symbol # for open(cmd) deprecation - function Process(cmd::Cmd, handle::Ptr{Void}, - in::Union{Redirectable, Ptr{Void}}, - out::Union{Redirectable, Ptr{Void}}, - err::Union{Redirectable, Ptr{Void}}) + function Process(cmd::Cmd, handle::Ptr{Cvoid}, + in::Union{Redirectable, Ptr{Cvoid}}, + out::Union{Redirectable, Ptr{Cvoid}}, + err::Union{Redirectable, Ptr{Cvoid}}) if !isa(in, IO) in = DevNull end @@ -347,19 +347,19 @@ end pipe_reader(p::ProcessChain) = p.out pipe_writer(p::ProcessChain) = p.in -function _jl_spawn(cmd, argv, loop::Ptr{Void}, pp::Process, +function _jl_spawn(cmd, argv, loop::Ptr{Cvoid}, pp::Process, in, out, err) proc = Libc.malloc(_sizeof_uv_process) disassociate_julia_struct(proc) error = ccall(:jl_spawn, Int32, - (Cstring, Ptr{Cstring}, Ptr{Void}, Ptr{Void}, Any, Int32, - Ptr{Void}, Int32, Ptr{Void}, Int32, Ptr{Void}, Int32, Ptr{Cstring}, Cstring, Ptr{Void}), + (Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid}, Any, Int32, + Ptr{Cvoid}, Int32, Ptr{Cvoid}, Int32, Ptr{Cvoid}, Int32, Ptr{Cstring}, Cstring, Ptr{Cvoid}), cmd, argv, loop, proc, pp, uvtype(in), uvhandle(in), uvtype(out), uvhandle(out), uvtype(err), uvhandle(err), pp.cmd.flags, pp.cmd.env === nothing ? C_NULL : pp.cmd.env, isempty(pp.cmd.dir) ? C_NULL : pp.cmd.dir, - uv_jl_return_spawn::Ptr{Void}) + uv_jl_return_spawn::Ptr{Cvoid}) if error != 0 - ccall(:jl_forceclose_uv, Void, (Ptr{Void},), proc) + ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), proc) throw(UVError("could not spawn "*string(pp.cmd), error)) end associate_julia_struct(proc, pp) @@ -369,19 +369,19 @@ end function uvfinalize(proc::Process) if proc.handle != C_NULL disassociate_julia_struct(proc.handle) - ccall(:jl_close_uv, Void, (Ptr{Void},), proc.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), proc.handle) proc.handle = C_NULL end nothing end -function uv_return_spawn(p::Ptr{Void}, exit_status::Int64, termsignal::Int32) - data = ccall(:jl_uv_process_data, Ptr{Void}, (Ptr{Void},), p) +function uv_return_spawn(p::Ptr{Cvoid}, exit_status::Int64, termsignal::Int32) + data = ccall(:jl_uv_process_data, Ptr{Cvoid}, (Ptr{Cvoid},), p) data == C_NULL && return proc = unsafe_pointer_to_objref(data)::Process proc.exitcode = exit_status proc.termsignal = termsignal - ccall(:jl_close_uv, Void, (Ptr{Void},), proc.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), proc.handle) notify(proc.exitnotify) nothing end @@ -391,7 +391,7 @@ function _uv_hook_close(proc::Process) notify(proc.closenotify) end -function spawn(redirect::CmdRedirect, stdios::StdIOSet; chain::Union{ProcessChain, Void}=nothing) +function spawn(redirect::CmdRedirect, stdios::StdIOSet; chain::Union{ProcessChain, Nothing}=nothing) spawn(redirect.cmd, (redirect.stream_no == STDIN_NO ? redirect.handle : stdios[1], redirect.stream_no == STDOUT_NO ? redirect.handle : stdios[2], @@ -399,7 +399,7 @@ function spawn(redirect::CmdRedirect, stdios::StdIOSet; chain::Union{ProcessChai chain=chain) end -function spawn(cmds::OrCmds, stdios::StdIOSet; chain::Union{ProcessChain, Void}=nothing) +function spawn(cmds::OrCmds, stdios::StdIOSet; chain::Union{ProcessChain, Nothing}=nothing) out_pipe = Libc.malloc(_sizeof_uv_named_pipe) in_pipe = Libc.malloc(_sizeof_uv_named_pipe) link_pipe(in_pipe, false, out_pipe, false) @@ -418,7 +418,7 @@ function spawn(cmds::OrCmds, stdios::StdIOSet; chain::Union{ProcessChain, Void}= chain end -function spawn(cmds::ErrOrCmds, stdios::StdIOSet; chain::Union{ProcessChain, Void}=nothing) +function spawn(cmds::ErrOrCmds, stdios::StdIOSet; chain::Union{ProcessChain, Nothing}=nothing) out_pipe = Libc.malloc(_sizeof_uv_named_pipe) in_pipe = Libc.malloc(_sizeof_uv_named_pipe) link_pipe(in_pipe, false, out_pipe, false) @@ -482,11 +482,11 @@ function setup_stdio(io, readable::Bool) return io, false end -function setup_stdio(stdio::Ptr{Void}, readable::Bool) +function setup_stdio(stdio::Ptr{Cvoid}, readable::Bool) return (stdio, false) end -function close_stdio(stdio::Ptr{Void}) +function close_stdio(stdio::Ptr{Cvoid}) close_pipe_sync(stdio) Libc.free(stdio) end @@ -505,7 +505,7 @@ function setup_stdio(anon::Function, stdio::StdIOSet) close_err && close_stdio(err) end -function spawn(cmd::Cmd, stdios::StdIOSet; chain::Union{ProcessChain, Void}=nothing) +function spawn(cmd::Cmd, stdios::StdIOSet; chain::Union{ProcessChain, Nothing}=nothing) if isempty(cmd.exec) throw(ArgumentError("cannot spawn empty command")) end @@ -521,7 +521,7 @@ function spawn(cmd::Cmd, stdios::StdIOSet; chain::Union{ProcessChain, Void}=noth pp end -function spawn(cmds::AndCmds, stdios::StdIOSet; chain::Union{ProcessChain, Void}=nothing) +function spawn(cmds::AndCmds, stdios::StdIOSet; chain::Union{ProcessChain, Nothing}=nothing) if chain === nothing chain = ProcessChain(stdios) end @@ -555,7 +555,7 @@ spawn_opts_inherit(in::Redirectable=RawFD(0), out::Redirectable=RawFD(1), err::R Run a command object asynchronously, returning the resulting `Process` object. """ -spawn(cmds::AbstractCmd, args...; chain::Union{ProcessChain, Void}=nothing) = +spawn(cmds::AbstractCmd, args...; chain::Union{ProcessChain, Nothing}=nothing) = spawn(cmds, spawn_opts_swallow(args...)...; chain=chain) function eachline(cmd::AbstractCmd; chomp::Bool=true) @@ -733,7 +733,7 @@ permissions). function kill(p::Process, signum::Integer) if process_running(p) @assert p.handle != C_NULL - err = ccall(:uv_process_kill, Int32, (Ptr{Void}, Int32), p.handle, signum) + err = ccall(:uv_process_kill, Int32, (Ptr{Cvoid}, Int32), p.handle, signum) if err != 0 && err != UV_ESRCH throw(UVError("kill", err)) end @@ -743,8 +743,8 @@ kill(ps::Vector{Process}) = foreach(kill, ps) kill(ps::ProcessChain) = foreach(kill, ps.processes) kill(p::Process) = kill(p, SIGTERM) -function _contains_newline(bufptr::Ptr{Void}, len::Int32) - return (ccall(:memchr, Ptr{Void}, (Ptr{Void},Int32,Csize_t), bufptr, '\n', len) != C_NULL) +function _contains_newline(bufptr::Ptr{Cvoid}, len::Int32) + return (ccall(:memchr, Ptr{Cvoid}, (Ptr{Cvoid},Int32,Csize_t), bufptr, '\n', len) != C_NULL) end ## process status ## diff --git a/base/random/RNGs.jl b/base/random/RNGs.jl index 113b7e3dc5bc1..0274ad640b6ed 100644 --- a/base/random/RNGs.jl +++ b/base/random/RNGs.jl @@ -33,7 +33,7 @@ end # os-test for T in (Bool, BitInteger_types...) if Sys.iswindows() @eval function rand!(rd::RandomDevice, A::Array{$T}, ::SamplerType{$T}) - ccall((:SystemFunction036, :Advapi32), stdcall, UInt8, (Ptr{Void}, UInt32), + ccall((:SystemFunction036, :Advapi32), stdcall, UInt8, (Ptr{Cvoid}, UInt32), A, sizeof(A)) A end @@ -54,7 +54,7 @@ The entropy is obtained from the operating system. """ RandomDevice -RandomDevice(::Void) = RandomDevice() +RandomDevice(::Nothing) = RandomDevice() srand(rng::RandomDevice) = rng diff --git a/base/random/dSFMT.jl b/base/random/dSFMT.jl index 71348634026ec..c6891e6011f53 100644 --- a/base/random/dSFMT.jl +++ b/base/random/dSFMT.jl @@ -61,21 +61,21 @@ const dsfmt_min_array_size = dsfmt_get_min_array_size() function dsfmt_init_gen_rand(s::DSFMT_state, seed::UInt32) ccall((:dsfmt_init_gen_rand,:libdSFMT), - Void, - (Ptr{Void}, UInt32,), + Cvoid, + (Ptr{Cvoid}, UInt32,), s.val, seed) end function dsfmt_init_by_array(s::DSFMT_state, seed::Vector{UInt32}) ccall((:dsfmt_init_by_array,:libdSFMT), - Void, - (Ptr{Void}, Ptr{UInt32}, Int32), + Cvoid, + (Ptr{Cvoid}, Ptr{UInt32}, Int32), s.val, seed, length(seed)) end function dsfmt_gv_init_by_array(seed::Vector{UInt32}) ccall((:dsfmt_gv_init_by_array,:libdSFMT), - Void, + Cvoid, (Ptr{UInt32}, Int32), seed, length(seed)) end @@ -84,8 +84,8 @@ function dsfmt_fill_array_close1_open2!(s::DSFMT_state, A::Ptr{Float64}, n::Int) @assert Csize_t(A) % 16 == 0 # the underlying C array must be 16-byte aligned @assert dsfmt_min_array_size <= n && iseven(n) ccall((:dsfmt_fill_array_close1_open2,:libdSFMT), - Void, - (Ptr{Void}, Ptr{Float64}, Int), + Cvoid, + (Ptr{Cvoid}, Ptr{Float64}, Int), s.val, A, n) end @@ -93,8 +93,8 @@ function dsfmt_fill_array_close_open!(s::DSFMT_state, A::Ptr{Float64}, n::Int) @assert Csize_t(A) % 16 == 0 # the underlying C array must be 16-byte aligned @assert dsfmt_min_array_size <= n && iseven(n) ccall((:dsfmt_fill_array_close_open,:libdSFMT), - Void, - (Ptr{Void}, Ptr{Float64}, Int), + Cvoid, + (Ptr{Cvoid}, Ptr{Float64}, Int), s.val, A, n) end @@ -188,7 +188,7 @@ function dsfmt_jump(s::DSFMT_state, jp::GF2X) work = zeros(Int32, JN32) rwork = reinterpret(UInt64, work) dsfmt = Vector{UInt64}(uninitialized, nval >> 1) - ccall(:memcpy, Ptr{Void}, (Ptr{UInt64}, Ptr{Int32}, Csize_t), + ccall(:memcpy, Ptr{Cvoid}, (Ptr{UInt64}, Ptr{Int32}, Csize_t), dsfmt, val, (nval - 1) * sizeof(Int32)) dsfmt[end] = UInt64(N*2) diff --git a/base/random/generation.jl b/base/random/generation.jl index 3b4aa83469b7f..e584bf8385c53 100644 --- a/base/random/generation.jl +++ b/base/random/generation.jl @@ -89,7 +89,7 @@ end # alternative, with 1 bit less of precision # TODO: make an API for requesting full or not-full precision -function _rand(rng::AbstractRNG, sp::SamplerBigFloat, ::CloseOpen{BigFloat}, ::Void) +function _rand(rng::AbstractRNG, sp::SamplerBigFloat, ::CloseOpen{BigFloat}, ::Nothing) z = _rand(rng, sp, Close1Open2(BigFloat)) ccall((:mpfr_sub_ui, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Culong, Int32), z, z, 1, Base.MPFR.ROUNDING_MODE[]) diff --git a/base/random/random.jl b/base/random/random.jl index 6fc87571d4590..2af2bcc31935c 100644 --- a/base/random/random.jl +++ b/base/random/random.jl @@ -346,6 +346,6 @@ julia> rand(MersenneTwister(), Bool) # not reproducible either true ``` """ -srand(rng::AbstractRNG, ::Void) = srand(rng) +srand(rng::AbstractRNG, ::Nothing) = srand(rng) end # module diff --git a/base/reflection.jl b/base/reflection.jl index 5fe5fda2e4cc7..a6acf20394778 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -100,7 +100,7 @@ isdeprecated(m::Module, s::Symbol) = ccall(:jl_is_binding_deprecated, Cint, (Any isbindingresolved(m::Module, var::Symbol) = ccall(:jl_binding_resolved_p, Cint, (Any, Any), m, var) != 0 function binding_module(m::Module, s::Symbol) - p = ccall(:jl_get_module_of_binding, Ptr{Void}, (Any, Any), m, s) + p = ccall(:jl_get_module_of_binding, Ptr{Cvoid}, (Any, Any), m, s) p == C_NULL && return m return unsafe_pointer_to_objref(p)::Module end @@ -818,9 +818,9 @@ function _dump_function_linfo(linfo::Core.MethodInstance, world::UInt, native::B throw(ArgumentError("'syntax' must be either :intel or :att")) end if native - llvmf = ccall(:jl_get_llvmf_decl, Ptr{Void}, (Any, UInt, Bool, CodegenParams), linfo, world, wrapper, params) + llvmf = ccall(:jl_get_llvmf_decl, Ptr{Cvoid}, (Any, UInt, Bool, CodegenParams), linfo, world, wrapper, params) else - llvmf = ccall(:jl_get_llvmf_defn, Ptr{Void}, (Any, UInt, Bool, Bool, CodegenParams), linfo, world, wrapper, optimize, params) + llvmf = ccall(:jl_get_llvmf_defn, Ptr{Cvoid}, (Any, UInt, Bool, Bool, CodegenParams), linfo, world, wrapper, optimize, params) end if llvmf == C_NULL error("could not compile the specified method") @@ -828,10 +828,10 @@ function _dump_function_linfo(linfo::Core.MethodInstance, world::UInt, native::B if native str = ccall(:jl_dump_function_asm, Ref{String}, - (Ptr{Void}, Cint, Ptr{UInt8}), llvmf, 0, syntax) + (Ptr{Cvoid}, Cint, Ptr{UInt8}), llvmf, 0, syntax) else str = ccall(:jl_dump_function_ir, Ref{String}, - (Ptr{Void}, Bool, Bool), llvmf, strip_ir_metadata, dump_module) + (Ptr{Cvoid}, Bool, Bool), llvmf, strip_ir_metadata, dump_module) end # TODO: use jl_is_cacheable_sig instead of isleaftype @@ -1089,7 +1089,7 @@ end Make method `m` uncallable and force recompilation of any methods that use(d) it. """ function delete_method(m::Method) - ccall(:jl_method_table_disable, Void, (Any, Any), MethodTable(m), m) + ccall(:jl_method_table_disable, Cvoid, (Any, Any), MethodTable(m), m) end function MethodTable(m::Method) diff --git a/base/refpointer.jl b/base/refpointer.jl index 09e1ba8ca03e2..ab2f11e4975e9 100644 --- a/base/refpointer.jl +++ b/base/refpointer.jl @@ -63,23 +63,23 @@ function unsafe_convert(P::Type{Ptr{T}}, b::RefValue{T}) where T # it can rebox the `b.x` if we simply call `pointer_from_objref(b.x)` on it. # Instead, explicitly load the pointer from the `RefValue` so that the pointer # is the same as the one rooted in the `RefValue` object. - return convert(P, pointerref(Ptr{Ptr{Void}}(pointer_from_objref(b)), 1, 0)) + return convert(P, pointerref(Ptr{Ptr{Cvoid}}(pointer_from_objref(b)), 1, 0)) end end function unsafe_convert(P::Type{Ptr{Any}}, b::RefValue{Any}) return convert(P, data_pointer_from_objref(b)) end -unsafe_convert(::Type{Ptr{Void}}, b::RefValue{T}) where {T} = convert(Ptr{Void}, unsafe_convert(Ptr{T}, b)) +unsafe_convert(::Type{Ptr{Cvoid}}, b::RefValue{T}) where {T} = convert(Ptr{Cvoid}, unsafe_convert(Ptr{T}, b)) ### Methods for a Ref object that is backed by an array at index i struct RefArray{T,A<:AbstractArray{T},R} <: Ref{T} x::A i::Int - roots::R # should be either ::Void or ::Any + roots::R # should be either ::Nothing or ::Any RefArray{T,A,R}(x,i,roots=nothing) where {T,A<:AbstractArray{T},R} = new(x,i,roots) end RefArray(x::AbstractArray{T}, i::Int, roots::Any) where {T} = RefArray{T,typeof(x),Any}(x, i, roots) -RefArray(x::AbstractArray{T}, i::Int=1, roots::Void=nothing) where {T} = RefArray{T,typeof(x),Void}(x, i, nothing) +RefArray(x::AbstractArray{T}, i::Int=1, roots::Nothing=nothing) where {T} = RefArray{T,typeof(x),Nothing}(x, i, nothing) convert(::Type{Ref{T}}, x::AbstractArray{T}) where {T} = RefArray(x, 1) Ref(x::AbstractArray, i::Integer=1) = RefArray(x, i) @@ -93,7 +93,7 @@ end function unsafe_convert(P::Type{Ptr{Any}}, b::RefArray{Any}) return convert(P, pointer(b.x, b.i)) end -unsafe_convert(::Type{Ptr{Void}}, b::RefArray{T}) where {T} = convert(Ptr{Void}, unsafe_convert(Ptr{T}, b)) +unsafe_convert(::Type{Ptr{Cvoid}}, b::RefArray{T}) where {T} = convert(Ptr{Cvoid}, unsafe_convert(Ptr{T}, b)) # convert Arrays to pointer arrays for ccall function Ref{P}(a::Array{<:Union{Ptr,Cwstring,Cstring}}) where P<:Union{Ptr,Cwstring,Cstring} diff --git a/base/regex.jl b/base/regex.jl index 2fd5a804bf1af..726c33f77f02f 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -11,10 +11,10 @@ mutable struct Regex pattern::String compile_options::UInt32 match_options::UInt32 - regex::Ptr{Void} - extra::Ptr{Void} + regex::Ptr{Cvoid} + extra::Ptr{Cvoid} ovec::Vector{Csize_t} - match_data::Ptr{Void} + match_data::Ptr{Cvoid} function Regex(pattern::AbstractString, compile_options::Integer, match_options::Integer) @@ -106,7 +106,7 @@ end struct RegexMatch match::SubString{String} - captures::Vector{Union{Void,SubString{String}}} + captures::Vector{Union{Nothing,SubString{String}}} offset::Int offsets::Vector{Int} regex::Regex @@ -192,7 +192,7 @@ julia> m = match(rx, "cabac") RegexMatch("aba", 1="b") julia> m.captures -1-element Array{Union{Void, SubString{String}},1}: +1-element Array{Union{Nothing, SubString{String}},1}: "b" julia> m.match @@ -213,7 +213,7 @@ function match(re::Regex, str::Union{SubString{String}, String}, idx::Integer, a ovec = re.ovec n = div(length(ovec),2) - 1 mat = SubString(str, ovec[1]+1, prevind(str, ovec[2]+1)) - cap = Union{Void,SubString{String}}[ovec[2i+1] == PCRE.UNSET ? nothing : + cap = Union{Nothing,SubString{String}}[ovec[2i+1] == PCRE.UNSET ? nothing : SubString(str, ovec[2i+1]+1, prevind(str, ovec[2i+2]+1)) for i=1:n] off = Int[ ovec[2i+1]+1 for i=1:n ] diff --git a/base/repl/LineEdit.jl b/base/repl/LineEdit.jl index e0b443634dbe5..072472db6c3b2 100644 --- a/base/repl/LineEdit.jl +++ b/base/repl/LineEdit.jl @@ -1277,7 +1277,7 @@ function match_input(k::Function, s, term, cs, keymap) return keymap_fcn(k, String(cs)) end -match_input(k::Void, s, term, cs, keymap) = (s,p) -> return :ok +match_input(k::Nothing, s, term, cs, keymap) = (s,p) -> return :ok match_input(k::KeyAlias, s, term, cs, keymap) = match_input(keymap, s, IOBuffer(k.seq), Char[], keymap) @@ -1295,7 +1295,7 @@ function match_input(k::Dict, s, term=terminal(s), cs=Char[], keymap = k) return match_input(get(k, key, nothing), s, term, cs, keymap) end -keymap_fcn(f::Void, c) = (s, p) -> return :ok +keymap_fcn(f::Nothing, c) = (s, p) -> return :ok function keymap_fcn(f::Function, c) return function (s, p) r = eval(Expr(:call,f,s, p, c)) @@ -1419,7 +1419,7 @@ end # source is the keymap specified by the user (with normalized keys) function keymap_merge(target,source) ret = copy(target) - direct_keys = filter(p -> isa(p.second, Union{Function, KeyAlias, Void}), source) + direct_keys = filter(p -> isa(p.second, Union{Function, KeyAlias, Nothing}), source) # first direct entries for key in keys(direct_keys) add_nested_key!(ret, key, source[key]; override = true) diff --git a/base/repl/REPL.jl b/base/repl/REPL.jl index 47175d5982a7b..9454ed26a7860 100644 --- a/base/repl/REPL.jl +++ b/base/repl/REPL.jl @@ -300,9 +300,9 @@ mutable struct LineEditREPL <: AbstractREPL in_help::Bool envcolors::Bool waserror::Bool - specialdisplay::Union{Void,AbstractDisplay} + specialdisplay::Union{Nothing,AbstractDisplay} options::Options - mistate::Union{MIState,Void} + mistate::Union{MIState,Nothing} interface::ModalInterface backendref::REPLBackendRef LineEditREPL(t,hascolor,prompt_color,input_color,answer_color,shell_color,help_color,history_file,in_shell,in_help,envcolors) = @@ -354,12 +354,12 @@ end mutable struct REPLHistoryProvider <: HistoryProvider history::Array{String,1} - history_file::Union{Void,IO} + history_file::Union{Nothing,IO} start_idx::Int cur_idx::Int last_idx::Int last_buffer::IOBuffer - last_mode::Union{Void,Prompt} + last_mode::Union{Nothing,Prompt} mode_mapping::Dict modes::Array{Symbol,1} end diff --git a/base/repl/Terminals.jl b/base/repl/Terminals.jl index 7ed5d2b82dc6f..dd3dae3a32fac 100644 --- a/base/repl/Terminals.jl +++ b/base/repl/Terminals.jl @@ -128,13 +128,13 @@ if Sys.iswindows() t.in_stream, t.out_stream, t.err_stream) true else - ccall(:jl_tty_set_mode, Int32, (Ptr{Void},Int32), t.in_stream.handle, raw) != -1 + ccall(:jl_tty_set_mode, Int32, (Ptr{Cvoid},Int32), t.in_stream.handle, raw) != -1 end end else function raw!(t::TTYTerminal, raw::Bool) check_open(t.in_stream) - ccall(:jl_tty_set_mode, Int32, (Ptr{Void},Int32), t.in_stream.handle, raw) != -1 + ccall(:jl_tty_set_mode, Int32, (Ptr{Cvoid},Int32), t.in_stream.handle, raw) != -1 end end diff --git a/base/replutil.jl b/base/replutil.jl index de8046e4377ff..6d93f4dce3761 100644 --- a/base/replutil.jl +++ b/base/replutil.jl @@ -455,11 +455,11 @@ end #Show an error by directly calling jl_printf. #Useful in Base submodule __init__ functions where STDERR isn't defined yet. function showerror_nostdio(err, msg::AbstractString) - stderr_stream = ccall(:jl_stderr_stream, Ptr{Void}, ()) - ccall(:jl_printf, Cint, (Ptr{Void},Cstring), stderr_stream, msg) - ccall(:jl_printf, Cint, (Ptr{Void},Cstring), stderr_stream, ":\n") - ccall(:jl_static_show, Csize_t, (Ptr{Void},Any), stderr_stream, err) - ccall(:jl_printf, Cint, (Ptr{Void},Cstring), stderr_stream, "\n") + stderr_stream = ccall(:jl_stderr_stream, Ptr{Cvoid}, ()) + ccall(:jl_printf, Cint, (Ptr{Cvoid},Cstring), stderr_stream, msg) + ccall(:jl_printf, Cint, (Ptr{Cvoid},Cstring), stderr_stream, ":\n") + ccall(:jl_static_show, Csize_t, (Ptr{Cvoid},Any), stderr_stream, err) + ccall(:jl_printf, Cint, (Ptr{Cvoid},Cstring), stderr_stream, "\n") end function show_method_candidates(io::IO, ex::MethodError, kwargs::NamedTuple = NamedTuple()) diff --git a/base/rounding.jl b/base/rounding.jl index b7f442da68b52..f983b5bfc8b15 100644 --- a/base/rounding.jl +++ b/base/rounding.jl @@ -3,7 +3,7 @@ module Rounding let fenv_consts = Vector{Cint}(uninitialized, 9) - ccall(:jl_get_fenv_consts, Void, (Ptr{Cint},), fenv_consts) + ccall(:jl_get_fenv_consts, Cvoid, (Ptr{Cint},), fenv_consts) global const JL_FE_INEXACT = fenv_consts[1] global const JL_FE_UNDERFLOW = fenv_consts[2] global const JL_FE_OVERFLOW = fenv_consts[3] diff --git a/base/serialize.jl b/base/serialize.jl index d68366ff72785..d7053ad20bb8d 100644 --- a/base/serialize.jl +++ b/base/serialize.jl @@ -80,7 +80,7 @@ const NTAGS = length(TAGS) function sertag(@nospecialize(v)) ptr = pointer_from_objref(v) - ptags = convert(Ptr{Ptr{Void}}, pointer(TAGS)) + ptags = convert(Ptr{Ptr{Cvoid}}, pointer(TAGS)) # note: constant ints & reserved slots never returned here @inbounds for i in 1:(NTAGS-(n_reserved_slots+2*n_int_literals)) ptr == unsafe_load(ptags,i) && return i%Int32 @@ -864,7 +864,7 @@ function deserialize(s::AbstractSerializer, ::Type{Method}) line = deserialize(s)::Int32 sig = deserialize(s)::DataType sparam_syms = deserialize(s)::SimpleVector - ambig = deserialize(s)::Union{Array{Any,1}, Void} + ambig = deserialize(s)::Union{Array{Any,1}, Nothing} nargs = deserialize(s)::Int32 isva = deserialize(s)::Bool template = deserialize(s) @@ -893,7 +893,7 @@ function deserialize(s::AbstractSerializer, ::Type{Method}) end ftype = ccall(:jl_first_argument_datatype, Any, (Any,), sig)::DataType if isdefined(ftype.name, :mt) && nothing === ccall(:jl_methtable_lookup, Any, (Any, Any, UInt), ftype.name.mt, sig, typemax(UInt)) - ccall(:jl_method_table_insert, Void, (Any, Any, Ptr{Void}), ftype.name.mt, meth, C_NULL) + ccall(:jl_method_table_insert, Cvoid, (Any, Any, Ptr{Cvoid}), ftype.name.mt, meth, C_NULL) end remember_object(s, meth, lnumber) end @@ -901,7 +901,7 @@ function deserialize(s::AbstractSerializer, ::Type{Method}) end function deserialize(s::AbstractSerializer, ::Type{Core.MethodInstance}) - linfo = ccall(:jl_new_method_instance_uninit, Ref{Core.MethodInstance}, (Ptr{Void},), C_NULL) + linfo = ccall(:jl_new_method_instance_uninit, Ref{Core.MethodInstance}, (Ptr{Cvoid},), C_NULL) deserialize_cycle(s, linfo) linfo.inferred = deserialize(s)::CodeInfo tag = Int32(read(s.io, UInt8)::UInt8) @@ -1017,7 +1017,7 @@ function deserialize_typename(s::AbstractSerializer, number) tn, tn.module, super, parameters, names, types, abstr, mutabl, ninitialized) tn.wrapper = ndt.name.wrapper - ccall(:jl_set_const, Void, (Any, Any, Any), tn.module, tn.name, tn.wrapper) + ccall(:jl_set_const, Cvoid, (Any, Any, Any), tn.module, tn.name, tn.wrapper) ty = tn.wrapper if has_instance && !isdefined(ty, :instance) # use setfield! directly to avoid `fieldtype` lowering expecting to see a Singleton object already on ty @@ -1036,7 +1036,7 @@ function deserialize_typename(s::AbstractSerializer, number) tn.mt.max_args = maxa for def in defs if isdefined(def, :sig) - ccall(:jl_method_table_insert, Void, (Any, Any, Ptr{Void}), tn.mt, def, C_NULL) + ccall(:jl_method_table_insert, Cvoid, (Any, Any, Ptr{Cvoid}), tn.mt, def, C_NULL) end end end @@ -1157,7 +1157,7 @@ function deserialize(s::AbstractSerializer, t::DataType) return ccall(:jl_new_struct, Any, (Any,Any...), t, f1, f2, f3) else flds = Any[ deserialize(s) for i = 1:nf ] - return ccall(:jl_new_structv, Any, (Any,Ptr{Void},UInt32), t, flds, nf) + return ccall(:jl_new_structv, Any, (Any,Ptr{Cvoid},UInt32), t, flds, nf) end else x = ccall(:jl_new_struct_uninit, Any, (Any,), t) @@ -1165,7 +1165,7 @@ function deserialize(s::AbstractSerializer, t::DataType) for i in 1:nf tag = Int32(read(s.io, UInt8)::UInt8) if tag != UNDEFREF_TAG - ccall(:jl_set_nth_field, Void, (Any, Csize_t, Any), x, i-1, handle_deserialize(s, tag)) + ccall(:jl_set_nth_field, Cvoid, (Any, Csize_t, Any), x, i-1, handle_deserialize(s, tag)) end end return x diff --git a/base/set.jl b/base/set.jl index f1de13afd08c7..b708916058f43 100644 --- a/base/set.jl +++ b/base/set.jl @@ -3,10 +3,10 @@ eltype(::Type{AbstractSet{T}}) where {T} = T mutable struct Set{T} <: AbstractSet{T} - dict::Dict{T,Void} + dict::Dict{T,Nothing} - Set{T}() where {T} = new(Dict{T,Void}()) - Set{T}(s::Set{T}) where {T} = new(Dict{T,Void}(s.dict)) + Set{T}() where {T} = new(Dict{T,Nothing}()) + Set{T}(s::Set{T}) where {T} = new(Dict{T,Nothing}(s.dict)) end Set{T}(itr) where {T} = union!(Set{T}(), itr) diff --git a/base/show.jl b/base/show.jl index 9a5a8d072ba82..98f8a897bd77d 100644 --- a/base/show.jl +++ b/base/show.jl @@ -370,7 +370,7 @@ function show(io::IO, tn::TypeName) show_type_name(io, tn) end -show(io::IO, ::Void) = print(io, "nothing") +show(io::IO, ::Nothing) = print(io, "nothing") show(io::IO, b::Bool) = print(io, b ? "true" : "false") show(io::IO, n::Signed) = (write(io, dec(n)); nothing) show(io::IO, n::Unsigned) = print(io, "0x", hex(n,sizeof(n)<<1)) @@ -725,7 +725,7 @@ emphasize(io, str::AbstractString) = get(io, :color, false) ? show_linenumber(io::IO, line) = print(io, "#= line ", line, " =#") show_linenumber(io::IO, line, file) = print(io, "#= ", file, ":", line, " =#") -show_linenumber(io::IO, line, file::Void) = show_linenumber(io, line) +show_linenumber(io::IO, line, file::Nothing) = show_linenumber(io, line) # show a block, e g if/for/etc function show_block(io::IO, head, args::Vector, body, indent::Int) diff --git a/base/socket.jl b/base/socket.jl index f5e703f352a8f..57dc7dd0278cf 100644 --- a/base/socket.jl +++ b/base/socket.jl @@ -256,17 +256,17 @@ InetAddr(ip::IPAddr, port) = InetAddr{typeof(ip)}(ip, port) ## SOCKETS ## mutable struct TCPSocket <: LibuvStream - handle::Ptr{Void} + handle::Ptr{Cvoid} status::Int buffer::IOBuffer readnotify::Condition connectnotify::Condition closenotify::Condition - sendbuf::Union{IOBuffer, Void} + sendbuf::Union{IOBuffer, Nothing} lock::ReentrantLock throttle::Int - function TCPSocket(handle::Ptr{Void}, status) + function TCPSocket(handle::Ptr{Cvoid}, status) tcp = new( handle, status, @@ -288,7 +288,7 @@ function TCPSocket(; delay=true) tcp = TCPSocket(Libc.malloc(_sizeof_uv_tcp), StatusUninit) af_spec = delay ? 0 : 2 # AF_UNSPEC is 0, AF_INET is 2 - err = ccall(:uv_tcp_init_ex, Cint, (Ptr{Void}, Ptr{Void}, Cuint), + err = ccall(:uv_tcp_init_ex, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cuint), eventloop(), tcp.handle, af_spec) uv_error("failed to create tcp socket", err) tcp.status = StatusInit @@ -296,12 +296,12 @@ function TCPSocket(; delay=true) end mutable struct TCPServer <: LibuvServer - handle::Ptr{Void} + handle::Ptr{Cvoid} status::Int connectnotify::Condition closenotify::Condition - function TCPServer(handle::Ptr{Void}, status) + function TCPServer(handle::Ptr{Cvoid}, status) tcp = new( handle, status, @@ -319,7 +319,7 @@ end function TCPServer(; delay=true) tcp = TCPServer(Libc.malloc(_sizeof_uv_tcp), StatusUninit) af_spec = delay ? 0 : 2 # AF_UNSPEC is 0, AF_INET is 2 - err = ccall(:uv_tcp_init_ex, Cint, (Ptr{Void}, Ptr{Void}, Cuint), + err = ccall(:uv_tcp_init_ex, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cuint), eventloop(), tcp.handle, af_spec) uv_error("failed to create tcp server", err) tcp.status = StatusInit @@ -331,12 +331,12 @@ iswritable(io::TCPSocket) = isopen(io) && io.status != StatusClosing ## VARIOUS METHODS TO BE MOVED TO BETTER LOCATION -_jl_connect_raw(sock::TCPSocket, sockaddr::Ptr{Void}) = - ccall(:jl_connect_raw, Int32, (Ptr{Void}, Ptr{Void}, Ptr{Void}), sock.handle, sockaddr, uv_jl_connectcb::Ptr{Void}) -_jl_sockaddr_from_addrinfo(addrinfo::Ptr{Void}) = - ccall(:jl_sockaddr_from_addrinfo, Ptr{Void}, (Ptr{Void},), addrinfo) -_jl_sockaddr_set_port(ptr::Ptr{Void}, port::UInt16) = - ccall(:jl_sockaddr_set_port, Void, (Ptr{Void}, UInt16), ptr, port) +_jl_connect_raw(sock::TCPSocket, sockaddr::Ptr{Cvoid}) = + ccall(:jl_connect_raw, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), sock.handle, sockaddr, uv_jl_connectcb::Ptr{Cvoid}) +_jl_sockaddr_from_addrinfo(addrinfo::Ptr{Cvoid}) = + ccall(:jl_sockaddr_from_addrinfo, Ptr{Cvoid}, (Ptr{Cvoid},), addrinfo) +_jl_sockaddr_set_port(ptr::Ptr{Cvoid}, port::UInt16) = + ccall(:jl_sockaddr_set_port, Cvoid, (Ptr{Cvoid}, UInt16), ptr, port) """ accept(server[,client]) @@ -356,13 +356,13 @@ accept(server::PipeServer) = accept(server, init_pipe!(PipeEndpoint(); # UDP mutable struct UDPSocket <: LibuvStream - handle::Ptr{Void} + handle::Ptr{Cvoid} status::Int recvnotify::Condition sendnotify::Condition closenotify::Condition - function UDPSocket(handle::Ptr{Void}, status) + function UDPSocket(handle::Ptr{Cvoid}, status) udp = new( handle, status, @@ -376,7 +376,7 @@ mutable struct UDPSocket <: LibuvStream end function UDPSocket() this = UDPSocket(Libc.malloc(_sizeof_uv_udp), StatusUninit) - err = ccall(:uv_udp_init, Cint, (Ptr{Void}, Ptr{Void}), + err = ccall(:uv_udp_init, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), eventloop(), this.handle) uv_error("failed to create udp socket", err) this.status = StatusInit @@ -412,16 +412,16 @@ const UV_UDP_REUSEADDR = 4 ## -_bind(sock::TCPServer, host::IPv4, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_tcp_bind, Int32, (Ptr{Void}, UInt16, UInt32, Cuint), +_bind(sock::TCPServer, host::IPv4, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_tcp_bind, Int32, (Ptr{Cvoid}, UInt16, UInt32, Cuint), sock.handle, hton(port), hton(host.host), flags) -_bind(sock::TCPServer, host::IPv6, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_tcp_bind6, Int32, (Ptr{Void}, UInt16, Ptr{UInt128}, Cuint), +_bind(sock::TCPServer, host::IPv6, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_tcp_bind6, Int32, (Ptr{Cvoid}, UInt16, Ptr{UInt128}, Cuint), sock.handle, hton(port), Ref(hton(host.host)), flags) -_bind(sock::UDPSocket, host::IPv4, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_udp_bind, Int32, (Ptr{Void}, UInt16, UInt32, UInt32), +_bind(sock::UDPSocket, host::IPv4, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_udp_bind, Int32, (Ptr{Cvoid}, UInt16, UInt32, UInt32), sock.handle, hton(port), hton(host.host), flags) -_bind(sock::UDPSocket, host::IPv6, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_udp_bind6, Int32, (Ptr{Void}, UInt16, Ptr{UInt128}, UInt32), +_bind(sock::UDPSocket, host::IPv6, port::UInt16, flags::UInt32 = UInt32(0)) = ccall(:jl_udp_bind6, Int32, (Ptr{Cvoid}, UInt16, Ptr{UInt128}, UInt32), sock.handle, hton(port), Ref(hton(host.host)), flags) """ @@ -476,16 +476,16 @@ function setopt(sock::UDPSocket; multicast_loop = nothing, multicast_ttl=nothing error("Cannot set options on uninitialized socket") end if multicast_loop !== nothing - uv_error("multicast_loop",ccall(:uv_udp_set_multicast_loop,Cint,(Ptr{Void},Cint),sock.handle,multicast_loop) < 0) + uv_error("multicast_loop",ccall(:uv_udp_set_multicast_loop,Cint,(Ptr{Cvoid},Cint),sock.handle,multicast_loop) < 0) end if multicast_ttl !== nothing - uv_error("multicast_ttl",ccall(:uv_udp_set_multicast_ttl,Cint,(Ptr{Void},Cint),sock.handle,multicast_ttl)) + uv_error("multicast_ttl",ccall(:uv_udp_set_multicast_ttl,Cint,(Ptr{Cvoid},Cint),sock.handle,multicast_ttl)) end if enable_broadcast !== nothing - uv_error("enable_broadcast",ccall(:uv_udp_set_broadcast,Cint,(Ptr{Void},Cint),sock.handle,enable_broadcast)) + uv_error("enable_broadcast",ccall(:uv_udp_set_broadcast,Cint,(Ptr{Cvoid},Cint),sock.handle,enable_broadcast)) end if ttl !== nothing - uv_error("ttl",ccall(:uv_udp_set_ttl,Cint,(Ptr{Void},Cint),sock.handle,ttl)) + uv_error("ttl",ccall(:uv_udp_set_ttl,Cint,(Ptr{Cvoid},Cint),sock.handle,ttl)) end end @@ -510,9 +510,9 @@ function recvfrom(sock::UDPSocket) if sock.status != StatusInit && sock.status != StatusOpen && sock.status != StatusActive error("UDPSocket is not initialized and open") end - if ccall(:uv_is_active, Cint, (Ptr{Void},), sock.handle) == 0 - uv_error("recv_start", ccall(:uv_udp_recv_start, Cint, (Ptr{Void}, Ptr{Void}, Ptr{Void}), - sock.handle, uv_jl_alloc_buf::Ptr{Void}, uv_jl_recvcb::Ptr{Void})) + if ccall(:uv_is_active, Cint, (Ptr{Cvoid},), sock.handle) == 0 + uv_error("recv_start", ccall(:uv_udp_recv_start, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), + sock.handle, uv_jl_alloc_buf::Ptr{Cvoid}, uv_jl_recvcb::Ptr{Cvoid})) end sock.status = StatusActive return stream_wait(sock, sock.recvnotify)::Tuple{Union{IPv4, IPv6}, Vector{UInt8}} @@ -520,7 +520,7 @@ end alloc_buf_hook(sock::UDPSocket, size::UInt) = (Libc.malloc(size), size) -function uv_recvcb(handle::Ptr{Void}, nread::Cssize_t, buf::Ptr{Void}, addr::Ptr{Void}, flags::Cuint) +function uv_recvcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid}, addr::Ptr{Cvoid}, flags::Cuint) # C signature documented as (*uv_udp_recv_cb)(...) sock = @handle_as handle UDPSocket if nread < 0 @@ -530,34 +530,34 @@ function uv_recvcb(handle::Ptr{Void}, nread::Cssize_t, buf::Ptr{Void}, addr::Ptr Libc.free(buf_addr) notify_error(sock.recvnotify, "Partial message received") else - buf_addr = ccall(:jl_uv_buf_base, Ptr{Void}, (Ptr{Void},), buf) - buf_size = ccall(:jl_uv_buf_len, Csize_t, (Ptr{Void},), buf) + buf_addr = ccall(:jl_uv_buf_base, Ptr{Cvoid}, (Ptr{Cvoid},), buf) + buf_size = ccall(:jl_uv_buf_len, Csize_t, (Ptr{Cvoid},), buf) # need to check the address type in order to convert to a Julia IPAddr addrout = if addr == C_NULL IPv4(0) - elseif ccall(:jl_sockaddr_in_is_ip4, Cint, (Ptr{Void},), addr) == 1 - IPv4(ntoh(ccall(:jl_sockaddr_host4, UInt32, (Ptr{Void},), addr))) + elseif ccall(:jl_sockaddr_in_is_ip4, Cint, (Ptr{Cvoid},), addr) == 1 + IPv4(ntoh(ccall(:jl_sockaddr_host4, UInt32, (Ptr{Cvoid},), addr))) else tmp = [UInt128(0)] - ccall(:jl_sockaddr_host6, UInt32, (Ptr{Void}, Ptr{UInt8}), addr, pointer(tmp)) + ccall(:jl_sockaddr_host6, UInt32, (Ptr{Cvoid}, Ptr{UInt8}), addr, pointer(tmp)) IPv6(ntoh(tmp[1])) end buf = unsafe_wrap(Array, convert(Ptr{UInt8}, buf_addr), Int(nread), true) notify(sock.recvnotify, (addrout, buf)) end - ccall(:uv_udp_recv_stop, Cint, (Ptr{Void},), sock.handle) + ccall(:uv_udp_recv_stop, Cint, (Ptr{Cvoid},), sock.handle) sock.status = StatusOpen nothing end function _send(sock::UDPSocket, ipaddr::IPv4, port::UInt16, buf) - ccall(:jl_udp_send, Cint, (Ptr{Void}, UInt16, UInt32, Ptr{UInt8}, Csize_t, Ptr{Void}), - sock.handle, hton(port), hton(ipaddr.host), buf, sizeof(buf), uv_jl_sendcb::Ptr{Void}) + ccall(:jl_udp_send, Cint, (Ptr{Cvoid}, UInt16, UInt32, Ptr{UInt8}, Csize_t, Ptr{Cvoid}), + sock.handle, hton(port), hton(ipaddr.host), buf, sizeof(buf), uv_jl_sendcb::Ptr{Cvoid}) end function _send(sock::UDPSocket, ipaddr::IPv6, port::UInt16, buf) - ccall(:jl_udp_send6, Cint, (Ptr{Void}, UInt16, Ref{UInt128}, Ptr{UInt8}, Csize_t, Ptr{Void}), - sock.handle, hton(port), hton(ipaddr.host), buf, sizeof(buf), uv_jl_sendcb::Ptr{Void}) + ccall(:jl_udp_send6, Cint, (Ptr{Cvoid}, UInt16, Ref{UInt128}, Ptr{UInt8}, Csize_t, Ptr{Cvoid}), + sock.handle, hton(port), hton(ipaddr.host), buf, sizeof(buf), uv_jl_sendcb::Ptr{Cvoid}) end """ @@ -575,7 +575,7 @@ function send(sock::UDPSocket,ipaddr,port,msg) nothing end -function uv_sendcb(handle::Ptr{Void}, status::Cint) +function uv_sendcb(handle::Ptr{Cvoid}, status::Cint) sock = @handle_as handle UDPSocket if status < 0 notify_error(sock.sendnotify, UVError("UDP send failed", status)) @@ -597,7 +597,7 @@ function show(io::IO, err::DNSError) " (", uverrorname(err.code), ")") end -function uv_getaddrinfocb(req::Ptr{Void}, status::Cint, addrinfo::Ptr{Void}) +function uv_getaddrinfocb(req::Ptr{Cvoid}, status::Cint, addrinfo::Ptr{Cvoid}) data = uv_req_data(req) if data != C_NULL t = unsafe_pointer_to_objref(data)::Task @@ -608,18 +608,18 @@ function uv_getaddrinfocb(req::Ptr{Void}, status::Cint, addrinfo::Ptr{Void}) freeaddrinfo = addrinfo addrs = IPAddr[] while addrinfo != C_NULL - sockaddr = ccall(:jl_sockaddr_from_addrinfo, Ptr{Void}, (Ptr{Void},), addrinfo) - if ccall(:jl_sockaddr_is_ip4, Int32, (Ptr{Void},), sockaddr) == 1 - ip4addr = ccall(:jl_sockaddr_host4, UInt32, (Ptr{Void},), sockaddr) + sockaddr = ccall(:jl_sockaddr_from_addrinfo, Ptr{Cvoid}, (Ptr{Cvoid},), addrinfo) + if ccall(:jl_sockaddr_is_ip4, Int32, (Ptr{Cvoid},), sockaddr) == 1 + ip4addr = ccall(:jl_sockaddr_host4, UInt32, (Ptr{Cvoid},), sockaddr) push!(addrs, IPv4(ntoh(ip4addr))) - elseif ccall(:jl_sockaddr_is_ip6, Int32, (Ptr{Void},), sockaddr) == 1 + elseif ccall(:jl_sockaddr_is_ip6, Int32, (Ptr{Cvoid},), sockaddr) == 1 ip6addr = Ref{UInt128}() - scope_id = ccall(:jl_sockaddr_host6, UInt32, (Ptr{Void}, Ptr{UInt128}), sockaddr, ip6addr) + scope_id = ccall(:jl_sockaddr_host6, UInt32, (Ptr{Cvoid}, Ptr{UInt128}), sockaddr, ip6addr) push!(addrs, IPv6(ntoh(ip6addr[]))) end - addrinfo = ccall(:jl_next_from_addrinfo, Ptr{Void}, (Ptr{Void},), addrinfo) + addrinfo = ccall(:jl_next_from_addrinfo, Ptr{Cvoid}, (Ptr{Cvoid},), addrinfo) end - ccall(:uv_freeaddrinfo, Void, (Ptr{Void},), freeaddrinfo) + ccall(:uv_freeaddrinfo, Cvoid, (Ptr{Cvoid},), freeaddrinfo) schedule(t, addrs) end else @@ -639,8 +639,8 @@ function getalladdrinfo(host::String) isascii(host) || error("non-ASCII hostname: $host") req = Libc.malloc(_sizeof_uv_getaddrinfo) uv_req_set_data(req, C_NULL) # in case we get interrupted before arriving at the wait call - status = ccall(:jl_getaddrinfo, Int32, (Ptr{Void}, Ptr{Void}, Cstring, Ptr{Void}, Ptr{Void}), - eventloop(), req, host, #=service=#C_NULL, uv_jl_getaddrinfocb::Ptr{Void}) + status = ccall(:jl_getaddrinfo, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Ptr{Cvoid}, Ptr{Cvoid}), + eventloop(), req, host, #=service=#C_NULL, uv_jl_getaddrinfocb::Ptr{Cvoid}) if status < 0 Libc.free(req) if status == UV_EINVAL @@ -660,7 +660,7 @@ function getalladdrinfo(host::String) # req is still alive, # so make sure we don't get spurious notifications later uv_req_set_data(req, C_NULL) - ccall(:uv_cancel, Int32, (Ptr{Void},), req) # try to let libuv know we don't care anymore + ccall(:uv_cancel, Int32, (Ptr{Cvoid},), req) # try to let libuv know we don't care anymore else # done with req Libc.free(req) @@ -703,7 +703,7 @@ end getaddrinfo(host::AbstractString, T::Type{<:IPAddr}) = getaddrinfo(String(host), T) getaddrinfo(host::AbstractString) = getaddrinfo(String(host), IPv4) -function uv_getnameinfocb(req::Ptr{Void}, status::Cint, hostname::Cstring, service::Cstring) +function uv_getnameinfocb(req::Ptr{Cvoid}, status::Cint, hostname::Cstring, service::Cstring) data = uv_req_data(req) if data != C_NULL t = unsafe_pointer_to_objref(data)::Task @@ -732,13 +732,13 @@ function getnameinfo(address::Union{IPv4, IPv6}) ev = eventloop() port = hton(UInt16(0)) flags = 0 - uvcb = uv_jl_getnameinfocb::Ptr{Void} + uvcb = uv_jl_getnameinfocb::Ptr{Cvoid} status = UV_EINVAL if address isa IPv4 - status = ccall(:jl_getnameinfo, Int32, (Ptr{Void}, Ptr{Void}, UInt32, UInt16, Cint, Ptr{Void}), + status = ccall(:jl_getnameinfo, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, UInt32, UInt16, Cint, Ptr{Cvoid}), ev, req, hton(address.host), port, flags, uvcb) elseif address isa IPv6 - status = ccall(:jl_getnameinfo6, Int32, (Ptr{Void}, Ptr{Void}, Ref{UInt128}, UInt16, Cint, Ptr{Void}), + status = ccall(:jl_getnameinfo6, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Ref{UInt128}, UInt16, Cint, Ptr{Cvoid}), ev, req, hton(address.host), port, flags, uvcb) end if status < 0 @@ -760,7 +760,7 @@ function getnameinfo(address::Union{IPv4, IPv6}) # req is still alive, # so make sure we don't get spurious notifications later uv_req_set_data(req, C_NULL) - ccall(:uv_cancel, Int32, (Ptr{Void},), req) # try to let libuv know we don't care anymore + ccall(:uv_cancel, Int32, (Ptr{Cvoid},), req) # try to let libuv know we don't care anymore else # done with req Libc.free(req) @@ -805,19 +805,19 @@ function getipaddr() lo_present = true continue end - sockaddr = ccall(:jl_uv_interface_address_sockaddr, Ptr{Void}, (Ptr{UInt8},), current_addr) - if ccall(:jl_sockaddr_in_is_ip4, Int32, (Ptr{Void},), sockaddr) == 1 - rv = IPv4(ntoh(ccall(:jl_sockaddr_host4, UInt32, (Ptr{Void},), sockaddr))) - ccall(:uv_free_interface_addresses, Void, (Ptr{UInt8}, Int32), addr, count) + sockaddr = ccall(:jl_uv_interface_address_sockaddr, Ptr{Cvoid}, (Ptr{UInt8},), current_addr) + if ccall(:jl_sockaddr_in_is_ip4, Int32, (Ptr{Cvoid},), sockaddr) == 1 + rv = IPv4(ntoh(ccall(:jl_sockaddr_host4, UInt32, (Ptr{Cvoid},), sockaddr))) + ccall(:uv_free_interface_addresses, Cvoid, (Ptr{UInt8}, Int32), addr, count) return rv # Uncomment to enbable IPv6 - #elseif ccall(:jl_sockaddr_in_is_ip6, Int32, (Ptr{Void},), sockaddr) == 1 + #elseif ccall(:jl_sockaddr_in_is_ip6, Int32, (Ptr{Cvoid},), sockaddr) == 1 # host = Vector{UInt128}(uninitialized, 1) - # ccall(:jl_sockaddr_host6, UInt32, (Ptr{Void}, Ptr{UInt128}), sockaddrr, host) + # ccall(:jl_sockaddr_host6, UInt32, (Ptr{Cvoid}, Ptr{UInt128}), sockaddrr, host) # return IPv6(ntoh(host[1])) end end - ccall(:uv_free_interface_addresses, Void, (Ptr{UInt8}, Int32), addr, count) + ccall(:uv_free_interface_addresses, Cvoid, (Ptr{UInt8}, Int32), addr, count) return lo_present ? localhost : error("No networking interface available") end @@ -830,8 +830,8 @@ function connect!(sock::TCPSocket, host::IPv4, port::Integer) if !(0 <= port <= typemax(UInt16)) throw(ArgumentError("port out of range, must be 0 ≤ port ≤ 65535, got $port")) end - uv_error("connect", ccall(:jl_tcp4_connect, Int32, (Ptr{Void}, UInt32, UInt16, Ptr{Void}), - sock.handle, hton(host.host), hton(UInt16(port)), uv_jl_connectcb::Ptr{Void})) + uv_error("connect", ccall(:jl_tcp4_connect, Int32, (Ptr{Cvoid}, UInt32, UInt16, Ptr{Cvoid}), + sock.handle, hton(host.host), hton(UInt16(port)), uv_jl_connectcb::Ptr{Cvoid})) sock.status = StatusConnecting nothing end @@ -843,8 +843,8 @@ function connect!(sock::TCPSocket, host::IPv6, port::Integer) if !(0 <= port <= typemax(UInt16)) throw(ArgumentError("port out of range, must be 0 ≤ port ≤ 65535, got $port")) end - uv_error("connect", ccall(:jl_tcp6_connect, Int32, (Ptr{Void}, Ref{UInt128}, UInt16, Ptr{Void}), - sock.handle, hton(host.host), hton(UInt16(port)), uv_jl_connectcb::Ptr{Void})) + uv_error("connect", ccall(:jl_tcp6_connect, Int32, (Ptr{Cvoid}, Ref{UInt128}, UInt16, Ptr{Cvoid}), + sock.handle, hton(host.host), hton(UInt16(port)), uv_jl_connectcb::Ptr{Cvoid})) sock.status = StatusConnecting nothing end @@ -924,7 +924,7 @@ function accept_nonblock(server::TCPServer, client::TCPSocket) if client.status != StatusInit error("client TCPSocket is not in initialization state") end - err = ccall(:uv_accept, Int32, (Ptr{Void}, Ptr{Void}), server.handle, client.handle) + err = ccall(:uv_accept, Int32, (Ptr{Cvoid}, Ptr{Cvoid}), server.handle, client.handle) if err == 0 client.status = StatusOpen end @@ -991,11 +991,11 @@ function _sockname(sock, self=true) if self r = ccall(:jl_tcp_getsockname, Int32, - (Ptr{Void}, Ref{Cushort}, Ptr{Void}, Ref{Cuint}), + (Ptr{Cvoid}, Ref{Cushort}, Ptr{Cvoid}, Ref{Cuint}), sock.handle, rport, raddress, rfamily) else r = ccall(:jl_tcp_getpeername, Int32, - (Ptr{Void}, Ref{Cushort}, Ptr{Void}, Ref{Cuint}), + (Ptr{Cvoid}, Ref{Cushort}, Ptr{Cvoid}, Ref{Cuint}), sock.handle, rport, raddress, rfamily) end uv_error("cannot obtain socket name", r) diff --git a/base/some.jl b/base/some.jl index 3229283e66e18..1c066bc5f0768 100644 --- a/base/some.jl +++ b/base/some.jl @@ -3,7 +3,7 @@ """ Some{T} -A wrapper type used in `Union{Some{T}, Void}` to distinguish between the absence +A wrapper type used in `Union{Some{T}, Nothing}` to distinguish between the absence of a value ([`nothing`](@ref)) and the presence of a `nothing` value (i.e. `Some(nothing)`). Use [`coalesce`](@ref) to access the value wrapped by a `Some` object. @@ -13,14 +13,14 @@ struct Some{T} end promote_rule(::Type{Some{S}}, ::Type{Some{T}}) where {S,T} = Some{promote_type(S, T)} -promote_rule(::Type{Some{T}}, ::Type{Void}) where {T} = Union{Some{T}, Void} +promote_rule(::Type{Some{T}}, ::Type{Nothing}) where {T} = Union{Some{T}, Nothing} convert(::Type{Some{T}}, x::Some) where {T} = Some{T}(convert(T, x.value)) -convert(::Type{Union{Some{T}, Void}}, x::Some) where {T} = convert(Some{T}, x) +convert(::Type{Union{Some{T}, Nothing}}, x::Some) where {T} = convert(Some{T}, x) -convert(::Type{Union{T, Void}}, x::Any) where {T} = convert(T, x) -convert(::Type{Void}, x::Any) = throw(MethodError(convert, (Void, x))) -convert(::Type{Void}, x::Void) = nothing +convert(::Type{Union{T, Nothing}}, x::Any) where {T} = convert(T, x) +convert(::Type{Nothing}, x::Any) = throw(MethodError(convert, (Nothing, x))) +convert(::Type{Nothing}, x::Nothing) = nothing function show(io::IO, x::Some) if get(io, :typeinfo, Any) == typeof(x) @@ -65,11 +65,11 @@ function coalesce end coalesce(x::Any) = x coalesce(x::Some) = x.value -coalesce(x::Void) = nothing +coalesce(x::Nothing) = nothing coalesce(x::Missing) = missing coalesce(x::Any, y...) = x coalesce(x::Some, y...) = x.value -coalesce(x::Union{Void, Missing}, y...) = coalesce(y...) +coalesce(x::Union{Nothing, Missing}, y...) = coalesce(y...) """ notnothing(x) @@ -77,4 +77,4 @@ coalesce(x::Union{Void, Missing}, y...) = coalesce(y...) Throw an error if `x == nothing`, and return `x` if not. """ notnothing(x::Any) = x -notnothing(::Void) = throw(ArgumentError("nothing passed to notnothing")) \ No newline at end of file +notnothing(::Nothing) = throw(ArgumentError("nothing passed to notnothing")) diff --git a/base/sort.jl b/base/sort.jl index f2cff89c34e82..7fbd5a876ba8a 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -79,7 +79,7 @@ true ``` """ issorted(itr; - lt=isless, by=identity, rev::Union{Bool,Void}=nothing, order::Ordering=Forward) = + lt=isless, by=identity, rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward) = issorted(itr, ord(lt,by,rev,order)) function partialsort!(v::AbstractVector, k::Union{Int,OrdinalRange}, o::Ordering) @@ -140,7 +140,7 @@ julia> a ``` """ partialsort!(v::AbstractVector, k::Union{Int,OrdinalRange}; - lt=isless, by=identity, rev::Union{Bool,Void}=nothing, order::Ordering=Forward) = + lt=isless, by=identity, rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward) = partialsort!(v, k, ord(lt,by,rev,order)) """ @@ -272,7 +272,7 @@ for s in [:searchsortedfirst, :searchsortedlast, :searchsorted] @eval begin $s(v::AbstractVector, x, o::Ordering) = (inds = axes(v, 1); $s(v,x,first(inds),last(inds),o)) $s(v::AbstractVector, x; - lt=isless, by=identity, rev::Union{Bool,Void}=nothing, order::Ordering=Forward) = + lt=isless, by=identity, rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward) = $s(v,x,ord(lt,by,rev,order)) end end @@ -603,7 +603,7 @@ function sort!(v::AbstractVector; alg::Algorithm=defalg(v), lt=isless, by=identity, - rev::Union{Bool,Void}=nothing, + rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward) ordr = ord(lt,by,rev,order) if ordr === Forward && isa(v,Vector) && eltype(v)<:Integer @@ -694,7 +694,7 @@ function partialsortperm!(ix::AbstractVector{<:Integer}, v::AbstractVector, k::Union{Int, OrdinalRange}; lt::Function=isless, by::Function=identity, - rev::Union{Bool,Void}=nothing, + rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward, initialized::Bool=false) if !initialized @@ -745,7 +745,7 @@ function sortperm(v::AbstractVector; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, - rev::Union{Bool,Void}=nothing, + rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward) ordr = ord(lt,by,rev,order) if ordr === Forward && isa(v,Vector) && eltype(v)<:Integer @@ -794,7 +794,7 @@ function sortperm!(x::AbstractVector{<:Integer}, v::AbstractVector; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, - rev::Union{Bool,Void}=nothing, + rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward, initialized::Bool=false) if axes(x,1) != axes(v,1) @@ -861,9 +861,9 @@ function sort(A::AbstractArray, dim::Integer; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, - rev::Union{Bool,Void}=nothing, + rev::Union{Bool,Nothing}=nothing, order::Ordering=Forward, - initialized::Union{Bool,Void}=nothing) + initialized::Union{Bool,Nothing}=nothing) if initialized !== nothing Base.depwarn("`initialized` keyword argument is deprecated", :sort) end diff --git a/base/sparse/higherorderfns.jl b/base/sparse/higherorderfns.jl index 4f90b7bc6a430..37d6b5c3f2ccf 100644 --- a/base/sparse/higherorderfns.jl +++ b/base/sparse/higherorderfns.jl @@ -924,7 +924,7 @@ Broadcast.BroadcastStyle(::SparseVecStyle, ::Broadcast.Style{Tuple}) = Broadcast Broadcast.BroadcastStyle(::SparseMatStyle, ::Broadcast.Style{Tuple}) = Broadcast.DefaultArrayStyle{2}() # broadcast entry points for combinations of sparse arrays and other (scalar) types -function broadcast(f, ::SPVM, ::Void, ::Void, mixedargs::Vararg{Any,N}) where N +function broadcast(f, ::SPVM, ::Nothing, ::Nothing, mixedargs::Vararg{Any,N}) where N parevalf, passedargstup = capturescalars(f, mixedargs) return broadcast(parevalf, passedargstup...) end @@ -1003,7 +1003,7 @@ Broadcast.BroadcastStyle(::SparseMatStyle, ::Broadcast.DefaultArrayStyle{N}) whe Broadcast.DefaultArrayStyle(Broadcast._max(Val(N), Val(2))) # end FIXME -broadcast(f, ::PromoteToSparse, ::Void, ::Void, As::Vararg{Any,N}) where {N} = +broadcast(f, ::PromoteToSparse, ::Nothing, ::Nothing, As::Vararg{Any,N}) where {N} = broadcast(f, map(_sparsifystructured, As)...) # ambiguity resolution diff --git a/base/stacktraces.jl b/base/stacktraces.jl index 9d057c63f5c02..7ff0f9823d6a5 100644 --- a/base/stacktraces.jl +++ b/base/stacktraces.jl @@ -21,7 +21,7 @@ Stack information representing execution context, with the following fields: The name of the function containing the execution context. -- `linfo::Union{Core.MethodInstance, CodeInfo, Void}` +- `linfo::Union{Core.MethodInstance, CodeInfo, Nothing}` The MethodInstance containing the execution context (if it could be found). @@ -54,7 +54,7 @@ struct StackFrame # this type should be kept platform-agnostic so that profiles "the line number in the file containing the execution context" line::Int "the MethodInstance or CodeInfo containing the execution context (if it could be found)" - linfo::Union{Core.MethodInstance, CodeInfo, Void} + linfo::Union{Core.MethodInstance, CodeInfo, Nothing} "true if the code is from C" from_c::Bool "true if the code is from an inlined frame" @@ -120,14 +120,14 @@ end """ - lookup(pointer::Union{Ptr{Void}, UInt}) -> Vector{StackFrame} + lookup(pointer::Union{Ptr{Cvoid}, UInt}) -> Vector{StackFrame} Given a pointer to an execution context (usually generated by a call to `backtrace`), looks up stack frame context information. Returns an array of frame information for all functions inlined at that point, innermost function first. """ -function lookup(pointer::Ptr{Void}) - infos = ccall(:jl_lookup_code_address, Any, (Ptr{Void}, Cint), pointer - 1, false) +function lookup(pointer::Ptr{Cvoid}) + infos = ccall(:jl_lookup_code_address, Any, (Ptr{Cvoid}, Cint), pointer - 1, false) isempty(infos) && return [StackFrame(empty_sym, empty_sym, -1, nothing, true, false, convert(UInt64, pointer))] res = Vector{StackFrame}(uninitialized, length(infos)) for i in 1:length(infos) @@ -138,7 +138,7 @@ function lookup(pointer::Ptr{Void}) return res end -lookup(pointer::UInt) = lookup(convert(Ptr{Void}, pointer)) +lookup(pointer::UInt) = lookup(convert(Ptr{Cvoid}, pointer)) const top_level_scope_sym = Symbol("top-level scope") @@ -212,7 +212,7 @@ function Base.backtrace() bt, bt2 = ccall(:jl_backtrace_from_here, Any, (Int32,), false) if length(bt) > 2 # remove frames for jl_backtrace_from_here and backtrace() - if bt[2] == Ptr{Void}(-1%UInt) + if bt[2] == Ptr{Cvoid}(-1%UInt) # backtrace() is interpreted # Note: win32 is missing the top frame (see https://bugs.chromium.org/p/crashpad/issues/detail?id=53) @static if Base.Sys.iswindows() && Int === Int32 @@ -233,13 +233,13 @@ function Base.backtrace() end """ - stacktrace([trace::Vector{Ptr{Void}},] [c_funcs::Bool=false]) -> StackTrace + stacktrace([trace::Vector{Ptr{Cvoid}},] [c_funcs::Bool=false]) -> StackTrace Returns a stack trace in the form of a vector of `StackFrame`s. (By default stacktrace doesn't return C functions, but this can be enabled.) When called without specifying a trace, `stacktrace` first calls `backtrace`. """ -function stacktrace(trace::Vector{<:Union{Base.InterpreterIP,Ptr{Void}}}, c_funcs::Bool=false) +function stacktrace(trace::Vector{<:Union{Base.InterpreterIP,Ptr{Cvoid}}}, c_funcs::Bool=false) stack = vcat(StackTrace(), map(lookup, trace)...)::StackTrace # Remove frames that come from C calls. diff --git a/base/stream.jl b/base/stream.jl index 6838d7070bcfb..661875168a6da 100644 --- a/base/stream.jl +++ b/base/stream.jl @@ -98,18 +98,18 @@ function uv_status_string(x) end mutable struct PipeEndpoint <: LibuvStream - handle::Ptr{Void} + handle::Ptr{Cvoid} status::Int buffer::IOBuffer readnotify::Condition connectnotify::Condition closenotify::Condition - sendbuf::Union{IOBuffer, Void} + sendbuf::Union{IOBuffer, Nothing} lock::ReentrantLock throttle::Int PipeEndpoint() = PipeEndpoint(Libc.malloc(_sizeof_uv_named_pipe), StatusUninit) - function PipeEndpoint(handle::Ptr{Void}, status) + function PipeEndpoint(handle::Ptr{Cvoid}, status) p = new(handle, status, PipeBuffer(), @@ -126,11 +126,11 @@ mutable struct PipeEndpoint <: LibuvStream end mutable struct PipeServer <: LibuvServer - handle::Ptr{Void} + handle::Ptr{Cvoid} status::Int connectnotify::Condition closenotify::Condition - function PipeServer(handle::Ptr{Void}, status) + function PipeServer(handle::Ptr{Cvoid}, status) p = new(handle, status, Condition(), @@ -149,17 +149,17 @@ function PipeServer() end mutable struct TTY <: LibuvStream - handle::Ptr{Void} + handle::Ptr{Cvoid} status::Int buffer::IOBuffer readnotify::Condition closenotify::Condition - sendbuf::Union{IOBuffer, Void} + sendbuf::Union{IOBuffer, Nothing} lock::ReentrantLock throttle::Int @static if Sys.iswindows(); ispty::Bool; end TTY() = TTY(Libc.malloc(_sizeof_uv_tty), StatusUninit) - function TTY(handle::Ptr{Void}, status) + function TTY(handle::Ptr{Cvoid}, status) tty = new( handle, status, @@ -172,7 +172,7 @@ mutable struct TTY <: LibuvStream associate_julia_struct(handle, tty) finalizer(uvfinalize, tty) @static if Sys.iswindows() - tty.ispty = ccall(:jl_ispty, Cint, (Ptr{Void},), handle) != 0 + tty.ispty = ccall(:jl_ispty, Cint, (Ptr{Cvoid},), handle) != 0 end return tty end @@ -182,7 +182,7 @@ function TTY(fd::RawFD; readable::Bool = false) tty = TTY() # This needs to go after associate_julia_struct so that there # is no garbage in the ->data field - err = ccall(:uv_tty_init, Int32, (Ptr{Void}, Ptr{Void}, Int32, Int32), + err = ccall(:uv_tty_init, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Int32, Int32), eventloop(), tty.handle, fd.fd, readable) uv_error("TTY", err) tty.status = StatusOpen @@ -202,13 +202,13 @@ show(io::IO, stream::LibuvStream) = print(io, typeof(stream), "(", function isreadable(io::LibuvStream) nb_available(io) > 0 && return true isopen(io) || return false - return ccall(:uv_is_readable, Cint, (Ptr{Void},), io.handle) != 0 + return ccall(:uv_is_readable, Cint, (Ptr{Cvoid},), io.handle) != 0 end function iswritable(io::LibuvStream) isopen(io) || return false io.status == StatusClosing && return false - return ccall(:uv_is_writable, Cint, (Ptr{Void},), io.handle) != 0 + return ccall(:uv_is_writable, Cint, (Ptr{Cvoid},), io.handle) != 0 end lock(s::LibuvStream) = lock(s.lock) @@ -216,14 +216,14 @@ unlock(s::LibuvStream) = unlock(s.lock) uvtype(::LibuvStream) = UV_STREAM uvhandle(stream::LibuvStream) = stream.handle -unsafe_convert(::Type{Ptr{Void}}, s::Union{LibuvStream, LibuvServer}) = s.handle +unsafe_convert(::Type{Ptr{Cvoid}}, s::Union{LibuvStream, LibuvServer}) = s.handle -function init_stdio(handle::Ptr{Void}) - t = ccall(:jl_uv_handle_type, Int32, (Ptr{Void},), handle) +function init_stdio(handle::Ptr{Cvoid}) + t = ccall(:jl_uv_handle_type, Int32, (Ptr{Cvoid},), handle) if t == UV_FILE - return fdio(ccall(:jl_uv_file_handle, Int32, (Ptr{Void},), handle)) + return fdio(ccall(:jl_uv_file_handle, Int32, (Ptr{Cvoid},), handle)) # Replace ios.c file with libuv file? -# return File(RawFD(ccall(:jl_uv_file_handle,Int32,(Ptr{Void},),handle))) +# return File(RawFD(ccall(:jl_uv_file_handle,Int32,(Ptr{Cvoid},),handle))) else if t == UV_TTY ret = TTY(handle, StatusOpen) @@ -315,10 +315,10 @@ end function close(stream::Union{LibuvStream, LibuvServer}) if stream.status == StatusInit - ccall(:jl_forceclose_uv, Void, (Ptr{Void},), stream.handle) + ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), stream.handle) elseif isopen(stream) if stream.status != StatusClosing - ccall(:jl_close_uv, Void, (Ptr{Void},), stream.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), stream.handle) stream.status = StatusClosing end if uv_handle_data(stream) != C_NULL @@ -395,7 +395,7 @@ function displaysize(io::TTY) s1 = Ref{Int32}(0) s2 = Ref{Int32}(0) Base.uv_error("size (TTY)", ccall(:uv_tty_get_winsize, - Int32, (Ptr{Void}, Ptr{Int32}, Ptr{Int32}), + Int32, (Ptr{Cvoid}, Ptr{Int32}, Ptr{Int32}), io, s1, s2) != 0) w, h = s1[], s2[] h > 0 || (h = default_size[1]) @@ -408,8 +408,8 @@ get(::TTY, k::Symbol, default) = k === :color ? have_color : default ### Libuv callbacks ### #from `connect` -function uv_connectcb(conn::Ptr{Void}, status::Cint) - hand = ccall(:jl_uv_connect_handle, Ptr{Void}, (Ptr{Void},), conn) +function uv_connectcb(conn::Ptr{Cvoid}, status::Cint) + hand = ccall(:jl_uv_connect_handle, Ptr{Cvoid}, (Ptr{Cvoid},), conn) sock = @handle_as hand LibuvStream @assert sock.status == StatusConnecting if status >= 0 @@ -425,7 +425,7 @@ function uv_connectcb(conn::Ptr{Void}, status::Cint) end # from `listen` -function uv_connectioncb(stream::Ptr{Void}, status::Cint) +function uv_connectioncb(stream::Ptr{Cvoid}, status::Cint) sock = @handle_as stream LibuvServer if status >= 0 notify(sock.connectnotify) @@ -445,7 +445,7 @@ function alloc_request(buffer::IOBuffer, recommended_size::UInt) return (pointer(buffer.data, ptr), nb) end -notify_filled(buffer::IOBuffer, nread::Int, base::Ptr{Void}, len::UInt) = notify_filled(buffer, nread) +notify_filled(buffer::IOBuffer, nread::Int, base::Ptr{Cvoid}, len::UInt) = notify_filled(buffer, nread) function notify_filled(buffer::IOBuffer, nread::Int) if buffer.append @@ -457,15 +457,15 @@ end alloc_buf_hook(stream::LibuvStream, size::UInt) = alloc_request(stream.buffer, UInt(size)) -function uv_alloc_buf(handle::Ptr{Void}, size::Csize_t, buf::Ptr{Void}) +function uv_alloc_buf(handle::Ptr{Cvoid}, size::Csize_t, buf::Ptr{Cvoid}) hd = uv_handle_data(handle) if hd == C_NULL - ccall(:jl_uv_buf_set_len, Void, (Ptr{Void}, Csize_t), buf, 0) + ccall(:jl_uv_buf_set_len, Cvoid, (Ptr{Cvoid}, Csize_t), buf, 0) return nothing end stream = unsafe_pointer_to_objref(hd)::LibuvStream - local data::Ptr{Void}, newsize::Csize_t + local data::Ptr{Cvoid}, newsize::Csize_t if stream.status != StatusActive data = C_NULL newsize = 0 @@ -476,14 +476,14 @@ function uv_alloc_buf(handle::Ptr{Void}, size::Csize_t, buf::Ptr{Void}) end end - ccall(:jl_uv_buf_set_base, Void, (Ptr{Void}, Ptr{Void}), buf, data) - ccall(:jl_uv_buf_set_len, Void, (Ptr{Void}, Csize_t), buf, newsize) + ccall(:jl_uv_buf_set_base, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), buf, data) + ccall(:jl_uv_buf_set_len, Cvoid, (Ptr{Cvoid}, Csize_t), buf, newsize) nothing end -function uv_readcb(handle::Ptr{Void}, nread::Cssize_t, buf::Ptr{Void}) +function uv_readcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid}) stream_unknown_type = @handle_as handle LibuvStream - nrequested = ccall(:jl_uv_buf_len, Csize_t, (Ptr{Void},), buf) + nrequested = ccall(:jl_uv_buf_len, Csize_t, (Ptr{Cvoid},), buf) function readcb_specialized(stream::LibuvStream, nread::Int, nrequested::UInt) if nread < 0 if nread == UV_ENOBUFS && nrequested == 0 @@ -496,13 +496,13 @@ function uv_readcb(handle::Ptr{Void}, nread::Cssize_t, buf::Ptr{Void}) notify(stream.closenotify) elseif stream.status != StatusClosing # begin shutdown of the stream - ccall(:jl_close_uv, Void, (Ptr{Void},), stream.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), stream.handle) stream.status = StatusClosing end else # This is a fatal connection error. Shutdown requests as per the usual # close function won't work and libuv will fail with an assertion failure - ccall(:jl_forceclose_uv, Void, (Ptr{Void},), stream) + ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), stream) notify_error(stream.readnotify, UVError("read", nread)) end else @@ -519,7 +519,7 @@ function uv_readcb(handle::Ptr{Void}, nread::Cssize_t, buf::Ptr{Void}) ((nb_available(stream.buffer) >= stream.throttle) || (nb_available(stream.buffer) >= stream.buffer.maxsize))) # save cycles by stopping kernel notifications from arriving - ccall(:uv_read_stop, Cint, (Ptr{Void},), stream) + ccall(:uv_read_stop, Cint, (Ptr{Cvoid},), stream) stream.status = StatusOpen end nothing @@ -583,7 +583,7 @@ function init_pipe!(pipe::LibuvPipe; error("pipe is already initialized") end err = ccall(:jl_init_pipe, Cint, - (Ptr{Void}, Int32, Int32, Int32), + (Ptr{Cvoid}, Int32, Int32, Int32), pipe.handle, writable, readable, julia_only) uv_error( if readable && writable @@ -599,50 +599,50 @@ function init_pipe!(pipe::LibuvPipe; return pipe end -function _link_pipe(read_end::Ptr{Void}, write_end::Ptr{Void}) +function _link_pipe(read_end::Ptr{Cvoid}, write_end::Ptr{Cvoid}) uv_error("pipe_link", - ccall(:uv_pipe_link, Int32, (Ptr{Void}, Ptr{Void}), read_end, write_end)) + ccall(:uv_pipe_link, Int32, (Ptr{Cvoid}, Ptr{Cvoid}), read_end, write_end)) nothing end -function link_pipe(read_end::Ptr{Void}, readable_julia_only::Bool, - write_end::Ptr{Void}, writable_julia_only::Bool, +function link_pipe(read_end::Ptr{Cvoid}, readable_julia_only::Bool, + write_end::Ptr{Cvoid}, writable_julia_only::Bool, readpipe::PipeEndpoint, writepipe::PipeEndpoint) #make the pipe an unbuffered stream for now #TODO: this is probably not freeing memory properly after errors uv_error("init_pipe(read)", - ccall(:jl_init_pipe, Cint, (Ptr{Void},Int32,Int32,Int32), read_end, 0, 1, readable_julia_only)) + ccall(:jl_init_pipe, Cint, (Ptr{Cvoid},Int32,Int32,Int32), read_end, 0, 1, readable_julia_only)) uv_error("init_pipe(write)", - ccall(:jl_init_pipe, Cint, (Ptr{Void},Int32,Int32,Int32), write_end, 1, 0, writable_julia_only)) + ccall(:jl_init_pipe, Cint, (Ptr{Cvoid},Int32,Int32,Int32), write_end, 1, 0, writable_julia_only)) _link_pipe(read_end, write_end) nothing end -function link_pipe(read_end::Ptr{Void}, readable_julia_only::Bool, - write_end::Ptr{Void}, writable_julia_only::Bool) +function link_pipe(read_end::Ptr{Cvoid}, readable_julia_only::Bool, + write_end::Ptr{Cvoid}, writable_julia_only::Bool) uv_error("init_pipe(read)", - ccall(:jl_init_pipe, Cint, (Ptr{Void},Int32,Int32,Int32), read_end, 0, 1, readable_julia_only)) + ccall(:jl_init_pipe, Cint, (Ptr{Cvoid},Int32,Int32,Int32), read_end, 0, 1, readable_julia_only)) uv_error("init_pipe(write)", - ccall(:jl_init_pipe, Cint, (Ptr{Void},Int32,Int32,Int32), write_end, 1, 0, writable_julia_only)) + ccall(:jl_init_pipe, Cint, (Ptr{Cvoid},Int32,Int32,Int32), write_end, 1, 0, writable_julia_only)) _link_pipe(read_end,write_end) nothing end function link_pipe(read_end::PipeEndpoint, readable_julia_only::Bool, - write_end::Ptr{Void}, writable_julia_only::Bool) + write_end::Ptr{Cvoid}, writable_julia_only::Bool) init_pipe!(read_end; readable = true, writable = false, julia_only = readable_julia_only) uv_error("init_pipe", - ccall(:jl_init_pipe, Cint, (Ptr{Void},Int32,Int32,Int32), write_end, 1, 0, writable_julia_only)) + ccall(:jl_init_pipe, Cint, (Ptr{Cvoid},Int32,Int32,Int32), write_end, 1, 0, writable_julia_only)) _link_pipe(read_end.handle, write_end) read_end.status = StatusOpen nothing end -function link_pipe(read_end::Ptr{Void}, readable_julia_only::Bool, +function link_pipe(read_end::Ptr{Cvoid}, readable_julia_only::Bool, write_end::PipeEndpoint, writable_julia_only::Bool) uv_error("init_pipe", - ccall(:jl_init_pipe, Cint, (Ptr{Void},Int32,Int32,Int32), read_end, 0, 1, readable_julia_only)) + ccall(:jl_init_pipe, Cint, (Ptr{Cvoid},Int32,Int32,Int32), read_end, 0, 1, readable_julia_only)) init_pipe!(write_end; readable = false, writable = true, julia_only = writable_julia_only) _link_pipe(read_end, write_end.handle) @@ -663,13 +663,13 @@ function link_pipe(read_end::PipeEndpoint, readable_julia_only::Bool, end function close_pipe_sync(p::PipeEndpoint) - ccall(:uv_pipe_close_sync, Void, (Ptr{Void},), p.handle) + ccall(:uv_pipe_close_sync, Cvoid, (Ptr{Cvoid},), p.handle) p.status = StatusClosed nothing end -function close_pipe_sync(handle::Ptr{Void}) - return ccall(:uv_pipe_close_sync, Void, (Ptr{Void},), handle) +function close_pipe_sync(handle::Ptr{Cvoid}) + return ccall(:uv_pipe_close_sync, Cvoid, (Ptr{Cvoid},), handle) end ## Functions for any LibuvStream ## @@ -684,8 +684,8 @@ function start_reading(stream::LibuvStream) # libuv may call the alloc callback immediately # for a TTY on Windows, so ensure the status is set first stream.status = StatusActive - ret = ccall(:uv_read_start, Cint, (Ptr{Void}, Ptr{Void}, Ptr{Void}), - stream, uv_jl_alloc_buf::Ptr{Void}, uv_jl_readcb::Ptr{Void}) + ret = ccall(:uv_read_start, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), + stream, uv_jl_alloc_buf::Ptr{Cvoid}, uv_jl_readcb::Ptr{Cvoid}) return ret elseif stream.status == StatusPaused stream.status = StatusActive @@ -706,7 +706,7 @@ if Sys.iswindows() function stop_reading(stream::LibuvStream) if stream.status == StatusActive stream.status = StatusOpen - ccall(:uv_read_stop, Cint, (Ptr{Void},), stream) + ccall(:uv_read_stop, Cint, (Ptr{Cvoid},), stream) end nothing end @@ -818,9 +818,9 @@ function uv_write(s::LibuvStream, p::Ptr{UInt8}, n::UInt) uv_req_set_data(uvw, C_NULL) # in case we get interrupted before arriving at the wait call err = ccall(:jl_uv_write, Int32, - (Ptr{Void}, Ptr{Void}, UInt, Ptr{Void}, Ptr{Void}), + (Ptr{Cvoid}, Ptr{Cvoid}, UInt, Ptr{Cvoid}, Ptr{Cvoid}), s, p, n, uvw, - uv_jl_writecb_task::Ptr{Void}) + uv_jl_writecb_task::Ptr{Cvoid}) if err < 0 Libc.free(uvw) uv_error("write", err) @@ -894,7 +894,7 @@ function write(s::LibuvStream, b::UInt8) return write(s, Ref{UInt8}(b)) end -function uv_writecb_task(req::Ptr{Void}, status::Cint) +function uv_writecb_task(req::Ptr{Cvoid}, status::Cint) d = uv_req_data(req) if d != C_NULL uv_req_set_data(req, C_NULL) @@ -919,7 +919,7 @@ function accept_nonblock(server::PipeServer,client::PipeEndpoint) "client is not initialized" : "client is already in use or has been closed") end - err = ccall(:uv_accept, Int32, (Ptr{Void}, Ptr{Void}), server.handle, client.handle) + err = ccall(:uv_accept, Int32, (Ptr{Cvoid}, Ptr{Cvoid}), server.handle, client.handle) if err == 0 client.status = StatusOpen end @@ -957,15 +957,15 @@ end function trylisten(sock::LibuvServer; backlog::Integer=BACKLOG_DEFAULT) check_open(sock) - err = ccall(:uv_listen, Cint, (Ptr{Void}, Cint, Ptr{Void}), - sock, backlog, uv_jl_connectioncb::Ptr{Void}) + err = ccall(:uv_listen, Cint, (Ptr{Cvoid}, Cint, Ptr{Cvoid}), + sock, backlog, uv_jl_connectioncb::Ptr{Cvoid}) sock.status = StatusActive return err end function bind(server::PipeServer, name::AbstractString) @assert server.status == StatusInit - err = ccall(:uv_pipe_bind, Int32, (Ptr{Void}, Cstring), + err = ccall(:uv_pipe_bind, Int32, (Ptr{Cvoid}, Cstring), server, name) if err != 0 if err != UV_EADDRINUSE && err != UV_EACCES @@ -994,7 +994,7 @@ function connect!(sock::PipeEndpoint, path::AbstractString) @assert sock.status == StatusInit req = Libc.malloc(_sizeof_uv_connect) uv_req_set_data(req, C_NULL) - ccall(:uv_pipe_connect, Void, (Ptr{Void}, Ptr{Void}, Cstring, Ptr{Void}), req, sock.handle, path, uv_jl_connectcb::Ptr{Void}) + ccall(:uv_pipe_connect, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Ptr{Cvoid}), req, sock.handle, path, uv_jl_connectcb::Ptr{Cvoid}) sock.status = StatusConnecting return sock end @@ -1016,12 +1016,12 @@ Connect to the named pipe / UNIX domain socket at `path`. connect(path::AbstractString) = connect(init_pipe!(PipeEndpoint(); readable=false, writable=false, julia_only=true),path) const OS_HANDLE = Sys.iswindows() ? WindowsRawSocket : RawFD -const INVALID_OS_HANDLE = Sys.iswindows() ? WindowsRawSocket(Ptr{Void}(-1)) : RawFD(-1) +const INVALID_OS_HANDLE = Sys.iswindows() ? WindowsRawSocket(Ptr{Cvoid}(-1)) : RawFD(-1) _fd(x::IOStream) = RawFD(fd(x)) function _fd(x::Union{LibuvStream, LibuvServer}) fd = Ref{OS_HANDLE}(INVALID_OS_HANDLE) if x.status != StatusUninit && x.status != StatusClosed - err = ccall(:uv_fileno, Int32, (Ptr{Void}, Ptr{OS_HANDLE}), x.handle, fd) + err = ccall(:uv_fileno, Int32, (Ptr{Cvoid}, Ptr{OS_HANDLE}), x.handle, fd) # handle errors by returning INVALID_OS_HANDLE end return fd[] @@ -1038,7 +1038,7 @@ for (x, writable, unix_fd, c_symbol) in global $x posix_fd = _fd(stream) @static if Sys.iswindows() - ccall(:SetStdHandle, stdcall, Int32, (Int32, Ptr{Void}), + ccall(:SetStdHandle, stdcall, Int32, (Int32, Ptr{Cvoid}), $(-10 - unix_fd), Libc._get_osfhandle(posix_fd).handle) end dup(posix_fd, RawFD($unix_fd)) @@ -1047,7 +1047,7 @@ for (x, writable, unix_fd, c_symbol) in end function ($f)(handle::Union{LibuvStream,IOStream}) $(_f)(handle) - unsafe_store!(cglobal($(Expr(:quote,c_symbol)),Ptr{Void}), + unsafe_store!(cglobal($(Expr(:quote,c_symbol)),Ptr{Cvoid}), handle.handle) return handle end diff --git a/base/strings/io.jl b/base/strings/io.jl index 13dc2f49d6752..06912b6c37578 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -261,7 +261,7 @@ escape_string(s::AbstractString, esc::AbstractString) = sprint(escape_string, s, escape_string(s::AbstractString) = sprint(escape_string, s, "\"", sizehint=endof(s)) """ - escape_string(io, str::AbstractString[, esc::AbstractString]) -> Void + escape_string(io, str::AbstractString[, esc::AbstractString]) -> Nothing Escape sequences in `str` and print result to `io`. See also [`unescape_string`](@ref). """ @@ -314,7 +314,7 @@ General unescaping of traditional C and Unicode escape sequences. Reverse of unescape_string(s::AbstractString) = sprint(unescape_string, s, sizehint=endof(s)) """ - unescape_string(io, str::AbstractString) -> Void + unescape_string(io, str::AbstractString) -> Nothing Unescapes sequences and prints result to `io`. See also [`escape_string`](@ref). """ diff --git a/base/strings/string.jl b/base/strings/string.jl index 121679ab78522..67ebf94d0d890 100644 --- a/base/strings/string.jl +++ b/base/strings/string.jl @@ -314,7 +314,7 @@ function repeat(s::String, r::Integer) out = _string_n(n*r) if n == 1 # common case: repeating a single-byte string @inbounds b = codeunit(s, 1) - ccall(:memset, Ptr{Void}, (Ptr{UInt8}, Cint, Csize_t), out, b, r) + ccall(:memset, Ptr{Cvoid}, (Ptr{UInt8}, Cint, Csize_t), out, b, r) else for i = 0:r-1 unsafe_copyto!(pointer(out, i*n+1), pointer(s), n) @@ -342,7 +342,7 @@ function repeat(c::Char, r::Integer) s = _string_n(n*r) p = pointer(s) if n == 1 - ccall(:memset, Ptr{Void}, (Ptr{UInt8}, Cint, Csize_t), p, u % UInt8, r) + ccall(:memset, Ptr{Cvoid}, (Ptr{UInt8}, Cint, Csize_t), p, u % UInt8, r) elseif n == 2 p16 = reinterpret(Ptr{UInt16}, p) for i = 1:r diff --git a/base/sysimg.jl b/base/sysimg.jl index bacf1535e939f..b10f6f1ebc1b3 100644 --- a/base/sysimg.jl +++ b/base/sysimg.jl @@ -3,7 +3,7 @@ baremodule Base using Core.Intrinsics -ccall(:jl_set_istopmod, Void, (Any, Bool), Base, true) +ccall(:jl_set_istopmod, Cvoid, (Any, Bool), Base, true) getproperty(x, f::Symbol) = getfield(x, f) setproperty!(x, f::Symbol, v) = setfield!(x, f, convert(fieldtype(typeof(x), f), v)) @@ -158,10 +158,10 @@ Vector() = Vector{Any}(uninitialized, 0) # Array constructors for nothing and missing # type and dimensionality specified -Array{T,N}(::Void, d...) where {T,N} = fill!(Array{T,N}(uninitialized, d...), nothing) +Array{T,N}(::Nothing, d...) where {T,N} = fill!(Array{T,N}(uninitialized, d...), nothing) Array{T,N}(::Missing, d...) where {T,N} = fill!(Array{T,N}(uninitialized, d...), missing) # type but not dimensionality specified -Array{T}(::Void, d...) where {T} = fill!(Array{T}(uninitialized, d...), nothing) +Array{T}(::Nothing, d...) where {T} = fill!(Array{T}(uninitialized, d...), nothing) Array{T}(::Missing, d...) where {T} = fill!(Array{T}(uninitialized, d...), missing) include("abstractdict.jl") diff --git a/base/sysinfo.jl b/base/sysinfo.jl index c7f151b4f4c9b..0c1f40420f472 100644 --- a/base/sysinfo.jl +++ b/base/sysinfo.jl @@ -156,7 +156,7 @@ function cpu_info() for i = 1:length(cpus) cpus[i] = CPUinfo(unsafe_load(UVcpus[], i)) end - ccall(:uv_free_cpu_info, Void, (Ptr{UV_cpu_info_t}, Int32), UVcpus[], count[]) + ccall(:uv_free_cpu_info, Cvoid, (Ptr{UV_cpu_info_t}, Int32), UVcpus[], count[]) return cpus end @@ -178,7 +178,7 @@ Get the load average. See: https://en.wikipedia.org/wiki/Load_(computing). """ function loadavg() loadavg_ = Vector{Float64}(uninitialized, 3) - ccall(:uv_loadavg, Void, (Ptr{Float64},), loadavg_) + ccall(:uv_loadavg, Cvoid, (Ptr{Float64},), loadavg_) return loadavg_ end diff --git a/base/threadcall.jl b/base/threadcall.jl index fcf258df0f4e9..151e1153ee406 100644 --- a/base/threadcall.jl +++ b/base/threadcall.jl @@ -1,7 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license const max_ccall_threads = parse(Int, get(ENV, "UV_THREADPOOL_SIZE", "4")) -const thread_notifiers = Union{Condition, Void}[nothing for i in 1:max_ccall_threads] +const thread_notifiers = Union{Condition, Nothing}[nothing for i in 1:max_ccall_threads] const threadcall_restrictor = Semaphore(max_ccall_threads) function notify_fun(idx) @@ -11,7 +11,7 @@ function notify_fun(idx) end function init_threadcall() - global c_notify_fun = cfunction(notify_fun, Void, Tuple{Cint}) + global c_notify_fun = cfunction(notify_fun, Cvoid, Tuple{Cint}) end """ @@ -40,7 +40,7 @@ macro threadcall(f, rettype, argtypes, argvals...) argvals = map(esc, argvals) # construct non-allocating wrapper to call C function - wrapper = :(function wrapper(args_ptr::Ptr{Void}, retval_ptr::Ptr{Void}) + wrapper = :(function wrapper(args_ptr::Ptr{Cvoid}, retval_ptr::Ptr{Cvoid}) p = args_ptr end) body = wrapper.args[2].args @@ -64,7 +64,7 @@ end function do_threadcall(wrapper::Function, rettype::Type, argtypes::Vector, argvals::Vector) # generate function pointer - fun_ptr = cfunction(wrapper, Int, Tuple{Ptr{Void}, Ptr{Void}}) + fun_ptr = cfunction(wrapper, Int, Tuple{Ptr{Cvoid}, Ptr{Cvoid}}) # cconvert, root and unsafe_convert arguments roots = Any[] @@ -87,8 +87,8 @@ function do_threadcall(wrapper::Function, rettype::Type, argtypes::Vector, argva thread_notifiers[idx] = Condition() # queue up the work to be done - ccall(:jl_queue_work, Void, - (Ptr{Void}, Ptr{UInt8}, Ptr{UInt8}, Ptr{Void}, Cint), + ccall(:jl_queue_work, Cvoid, + (Ptr{Cvoid}, Ptr{UInt8}, Ptr{UInt8}, Ptr{Cvoid}, Cint), fun_ptr, args_arr, ret_arr, c_notify_fun, idx) # wait for a result & return it diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 7052ac41fc8f1..61a1f598546a6 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -72,7 +72,7 @@ function _threadsfor(iter,lbody) else in_threaded_loop[] = true # the ccall is not expected to throw - ccall(:jl_threading_run, Ref{Void}, (Any,), threadsfor_fun) + ccall(:jl_threading_run, Ref{Cvoid}, (Any,), threadsfor_fun) in_threaded_loop[] = false end nothing diff --git a/base/util.jl b/base/util.jl index ac8413c2c02c9..a9ee3754f751d 100644 --- a/base/util.jl +++ b/base/util.jl @@ -392,7 +392,7 @@ function securezero! end securezero!(s::String) = unsafe_securezero!(pointer(s), sizeof(s)) @noinline unsafe_securezero!(p::Ptr{T}, len::Integer=1) where {T} = ccall(:memset, Ptr{T}, (Ptr{T}, Cint, Csize_t), p, 0, len*sizeof(T)) -unsafe_securezero!(p::Ptr{Void}, len::Integer=1) = Ptr{Void}(unsafe_securezero!(Ptr{UInt8}(p), len)) +unsafe_securezero!(p::Ptr{Cvoid}, len::Integer=1) = Ptr{Cvoid}(unsafe_securezero!(Ptr{UInt8}(p), len)) if Sys.iswindows() function getpass(prompt::AbstractString) @@ -427,7 +427,7 @@ getpass(prompt::AbstractString) = unsafe_string(ccall(:getpass, Cstring, (Cstrin end """ - prompt(message; default="", password=false) -> Union{String, Void} + prompt(message; default="", password=false) -> Union{String, Nothing} Displays the `message` then waits for user input. Input is terminated when a newline (\\n) is encountered or EOF (^D) character is entered on a blank line. If a `default` is provided @@ -456,10 +456,10 @@ end if Sys.iswindows() struct CREDUI_INFO cbSize::UInt32 - parent::Ptr{Void} + parent::Ptr{Cvoid} pszMessageText::Ptr{UInt16} pszCaptionText::Ptr{UInt16} - banner::Ptr{Void} + banner::Ptr{Cvoid} end const CREDUIWIN_GENERIC = 0x0001 @@ -493,12 +493,12 @@ if Sys.iswindows() dwflags |= CREDUIWIN_IN_CRED_ONLY end authPackage = Ref{Culong}(0) - outbuf_data = Ref{Ptr{Void}}(C_NULL) + outbuf_data = Ref{Ptr{Cvoid}}(C_NULL) outbuf_size = Ref{Culong}(0) # 2.2: Do the actual request code = ccall((:CredUIPromptForWindowsCredentialsW, "credui.dll"), stdcall, UInt32, (Ptr{CREDUI_INFO}, UInt32, Ptr{Culong}, - Ptr{Void}, Culong, Ptr{Ptr{Void}}, Ptr{Culong}, Ptr{Bool}, UInt32), cred, 0, authPackage, credbuf, credbufsize[], + Ptr{Cvoid}, Culong, Ptr{Ptr{Cvoid}}, Ptr{Culong}, Ptr{Bool}, UInt32), cred, 0, authPackage, credbuf, credbufsize[], outbuf_data, outbuf_size, pfSave, dwflags) # 2.3: If that failed for any reason other than the user canceling, error out. @@ -517,16 +517,16 @@ if Sys.iswindows() # Need valid buffers for domain, even though we don't care dummybuf = Vector{UInt16}(uninitialized, 1024) succeeded = ccall((:CredUnPackAuthenticationBufferW, "credui.dll"), Bool, - (UInt32, Ptr{Void}, UInt32, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}), + (UInt32, Ptr{Cvoid}, UInt32, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}), 0, outbuf_data[], outbuf_size[], usernamebuf, usernamelen, dummybuf, Ref{UInt32}(1024), passbuf, passlen) if !succeeded error(Base.Libc.FormatMessage()) end # Step 4: Free the encrypted buffer - # ccall(:SecureZeroMemory, Ptr{Void}, (Ptr{Void}, Csize_t), outbuf_data[], outbuf_size[]) - not an actual function + # ccall(:SecureZeroMemory, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), outbuf_data[], outbuf_size[]) - not an actual function unsafe_securezero!(outbuf_data[], outbuf_size[]) - ccall((:CoTaskMemFree, "ole32.dll"), Void, (Ptr{Void},), outbuf_data[]) + ccall((:CoTaskMemFree, "ole32.dll"), Cvoid, (Ptr{Cvoid},), outbuf_data[]) # Done. passbuf_ = passbuf[1:passlen[]-1] diff --git a/doc/images/jltypes.ai b/doc/images/jltypes.ai index a6cc3076759e1..912cb25622f19 100644 --- a/doc/images/jltypes.ai +++ b/doc/images/jltypes.ai @@ -3452,4 +3452,4 @@ aa 0000160667 00000 n 0000226257 00000 n 0000250787 00000 n -trailer <]>> startxref 250971 %%EOF \ No newline at end of file +trailer <]>> startxref 250971 %%EOF diff --git a/doc/src/assets/logo.png b/doc/src/assets/logo.png index 7e80e7372713cae4b181c17a6ab628f93eae0228..b18f64c712821783ddf9e325ff45184fab1ac888 100644 GIT binary patch delta 11 ScmZ42&$zyyal<-yMlJvylmspS delta 9 QcmZ4A&$zCial<-y02M_9BLDyZ diff --git a/doc/src/devdocs/debuggingtips.md b/doc/src/devdocs/debuggingtips.md index fcc7ea99e159b..f00666c5fa09f 100644 --- a/doc/src/devdocs/debuggingtips.md +++ b/doc/src/devdocs/debuggingtips.md @@ -15,7 +15,7 @@ Similarly, if you're debugging some of Julia's internals (e.g., `inference.jl`), `obj` using ```julia -ccall(:jl_, Void, (Any,), obj) +ccall(:jl_, Cvoid, (Any,), obj) ``` This is a good way to circumvent problems that arise from the order in which julia's output streams @@ -64,7 +64,7 @@ In your `gdb` session, set a breakpoint in `jl_breakpoint` like so: Then within your Julia code, insert a call to `jl_breakpoint` by adding ```julia -ccall(:jl_breakpoint, Void, (Any,), obj) +ccall(:jl_breakpoint, Cvoid, (Any,), obj) ``` where `obj` can be any variable or tuple you want to be accessible in the breakpoint. diff --git a/doc/src/devdocs/llvm.md b/doc/src/devdocs/llvm.md index 030037312a6d1..b47df84a159a9 100644 --- a/doc/src/devdocs/llvm.md +++ b/doc/src/devdocs/llvm.md @@ -259,14 +259,14 @@ One important aspect missing from the discussion so far is the handling of do not coincide. As an example consider: ```julia A = randn(1024) -ccall(:foo, Void, (Ptr{Float64},), A) +ccall(:foo, Cvoid, (Ptr{Float64},), A) ``` In lowering, the compiler will insert a conversion from the array to the pointer which drops the reference to the array value. However, we of course need to make sure that the array does stay alive while we're doing the `ccall`. To understand how this is done, first recall the lowering of the above code: ```julia -return $(Expr(:foreigncall, :(:foo), Void, svec(Ptr{Float64}), :(:ccall), 1, :($(Expr(:foreigncall, :(:jl_array_ptr), Ptr{Float64}, svec(Any), :(:ccall), 1, :(A)))), :(A))) +return $(Expr(:foreigncall, :(:foo), Cvoid, svec(Ptr{Float64}), :(:ccall), 1, :($(Expr(:foreigncall, :(:jl_array_ptr), Ptr{Float64}, svec(Any), :(:ccall), 1, :(A)))), :(A))) ``` The last `:(A)`, is an extra argument list inserted during lowering that informs the code generator which Julia level values need to be kept alive for the diff --git a/doc/src/devdocs/object.md b/doc/src/devdocs/object.md index bfb096fbf980c..cf9223f768d96 100644 --- a/doc/src/devdocs/object.md +++ b/doc/src/devdocs/object.md @@ -197,7 +197,7 @@ objects. !!! sidebar "Singleton Types" Singleton types have only one instance and no data fields. Singleton instances have a size of - 0 bytes, and consist only of their metadata. e.g. `nothing::Void`. + 0 bytes, and consist only of their metadata. e.g. `nothing::Nothing`. See [Singleton Types](@ref man-singleton-types) and [Nothingness and missing values](@ref) diff --git a/doc/src/devdocs/types.md b/doc/src/devdocs/types.md index 6161cda3ce062..0505521e013ca 100644 --- a/doc/src/devdocs/types.md +++ b/doc/src/devdocs/types.md @@ -195,8 +195,8 @@ TypeName hash: Int64 -7900426068641098781 mt: MethodTable name: Symbol Array - defs: Void nothing - cache: Void nothing + defs: Nothing nothing + cache: Nothing nothing max_args: Int64 0 kwsorter: #undef module: Module Core @@ -209,16 +209,16 @@ to make new `Array` types. ```julia-repl julia> pointer_from_objref(Array) -Ptr{Void} @0x00007fcc7de64850 +Ptr{Cvoid} @0x00007fcc7de64850 julia> pointer_from_objref(Array.body.body.name.wrapper) -Ptr{Void} @0x00007fcc7de64850 +Ptr{Cvoid} @0x00007fcc7de64850 julia> pointer_from_objref(Array{TV,NV}) -Ptr{Void} @0x00007fcc80c4d930 +Ptr{Cvoid} @0x00007fcc80c4d930 julia> pointer_from_objref(Array{TV,NV}.name.wrapper) -Ptr{Void} @0x00007fcc7de64850 +Ptr{Cvoid} @0x00007fcc7de64850 ``` The `wrapper` field of [`Array`](@ref) points to itself, but for `Array{TV,NV}` it points back @@ -301,16 +301,16 @@ What is the "primary" tuple-type? ```julia-repl julia> pointer_from_objref(Tuple) -Ptr{Void} @0x00007f5998a04370 +Ptr{Cvoid} @0x00007f5998a04370 julia> pointer_from_objref(Tuple{}) -Ptr{Void} @0x00007f5998a570d0 +Ptr{Cvoid} @0x00007f5998a570d0 julia> pointer_from_objref(Tuple.name.wrapper) -Ptr{Void} @0x00007f5998a04370 +Ptr{Cvoid} @0x00007f5998a04370 julia> pointer_from_objref(Tuple{}.name.wrapper) -Ptr{Void} @0x00007f5998a04370 +Ptr{Cvoid} @0x00007f5998a04370 ``` so `Tuple == Tuple{Vararg{Any}}` is indeed the primary type. @@ -384,11 +384,11 @@ the type of `y` if `x` and `y` can have different types. The next complication is the interaction of unions and diagonal variables, e.g. ```julia -f(x::Union{Void,T}, y::T) where {T} = ... +f(x::Union{Nothing,T}, y::T) where {T} = ... ``` Consider what this declaration means. -`y` has type `T`. `x` then can have either the same type `T`, or else be of type `Void`. +`y` has type `T`. `x` then can have either the same type `T`, or else be of type `Nothing`. So all of the following calls should match: ```julia @@ -400,18 +400,18 @@ f(nothing, "") f(nothing, 2.0) ``` -These examples are telling us something: when `x` is `nothing::Void`, there are no +These examples are telling us something: when `x` is `nothing::Nothing`, there are no extra constraints on `y`. It is as if the method signature had `y::Any`. This means that whether a variable is diagonal is not a static property based on where it appears in a type. Rather, it depends on where a variable appears when the subtyping algorithm *uses* it. -When `x` has type `Void`, we don't need to use the `T` in `Union{Void,T}`, so `T` +When `x` has type `Nothing`, we don't need to use the `T` in `Union{Nothing,T}`, so `T` does not "occur". Indeed, we have the following type equivalence: ```julia -(Tuple{Union{Void,T},T} where T) == Union{Tuple{Void,Any}, Tuple{T,T} where T} +(Tuple{Union{Nothing,T},T} where T) == Union{Tuple{Nothing,Any}, Tuple{T,T} where T} ``` ## Subtyping diagonal variables @@ -463,7 +463,7 @@ code get triggered often--it will be easiest if you make the following definitio ```julia-repl julia> function mysubtype(a,b) - ccall(:jl_breakpoint, Void, (Any,), nothing) + ccall(:jl_breakpoint, Cvoid, (Any,), nothing) a <: b end ``` diff --git a/doc/src/manual/calling-c-and-fortran-code.md b/doc/src/manual/calling-c-and-fortran-code.md index ce7bbb2889b06..c7c89d62a9eb5 100644 --- a/doc/src/manual/calling-c-and-fortran-code.md +++ b/doc/src/manual/calling-c-and-fortran-code.md @@ -209,7 +209,7 @@ julia> A = [1.3, -2.7, 4.4, 3.1] 4.4 3.1 -julia> ccall(:qsort, Void, (Ptr{Cdouble}, Csize_t, Csize_t, Ptr{Void}), +julia> ccall(:qsort, Cvoid, (Ptr{Cdouble}, Csize_t, Csize_t, Ptr{Cvoid}), A, length(A), sizeof(eltype(A)), mycompare_c) julia> A @@ -243,13 +243,13 @@ Julia automatically inserts calls to the [`Base.cconvert`](@ref) function to con to the specified type. For example, the following call: ```julia -ccall((:foo, "libfoo"), Void, (Int32, Float64), x, y) +ccall((:foo, "libfoo"), Cvoid, (Int32, Float64), x, y) ``` will behave as if the following were written: ```julia -ccall((:foo, "libfoo"), Void, (Int32, Float64), +ccall((:foo, "libfoo"), Cvoid, (Int32, Float64), Base.unsafe_convert(Int32, Base.cconvert(Int32, x)), Base.unsafe_convert(Float64, Base.cconvert(Float64, y))) ``` @@ -321,7 +321,7 @@ same: To pass an array `A` as a pointer of a different type *without* converting the data beforehand (for example, to pass a `Float64` array to a function that operates on uninterpreted bytes), you - can declare the argument as `Ptr{Void}`. + can declare the argument as `Ptr{Cvoid}`. If an array of eltype `Ptr{T}` is passed as a `Ptr{Ptr{T}}` argument, [`Base.cconvert`](@ref) will attempt to first make a null-terminated copy of the array with each element replaced by its @@ -355,9 +355,9 @@ an `Int` in Julia). | `ptrdiff_t` |   | `Cptrdiff_t` | `Int` | | `ssize_t` |   | `Cssize_t` | `Int` | | `size_t` |   | `Csize_t` | `UInt` | -| `void` |   |   | `Void` | +| `void` |   |   | `Cvoid` | | `void` and `[[noreturn]]` or `_Noreturn` |   |   | `Union{}` | -| `void*` |   |   | `Ptr{Void}` | +| `void*` |   |   | `Ptr{Cvoid}` | | `T*` (where T represents an appropriately defined type) |   |   | `Ref{T}` | | `char*` (or `char[]`, e.g. a string) | `CHARACTER*N` |   | `Cstring` if NUL-terminated, or `Ptr{UInt8}` if not | | `char**` (or `*char[]`) |   |   | `Ptr{Ptr{UInt8}}` | @@ -401,7 +401,7 @@ checks and is only meant to improve readability of the call. !!! warning A return type of `Union{}` means the function will not return i.e. C++11 `[[noreturn]]` or C11 `_Noreturn` (e.g. `jl_throw` or `longjmp`). Do not use this for functions that return no value - (`void`) but do return, use `Void` instead. + (`void`) but do return, use `Cvoid` instead. !!! note For `wchar_t*` arguments, the Julia type should be `Cwstring` (if the C routine expects a NUL-terminated @@ -426,7 +426,7 @@ checks and is only meant to improve readability of the call. ``` !!! note - A C function declared to return `Void` will return the value `nothing` in Julia. + A C function declared to return `Cvoid` will return the value `nothing` in Julia. ### Struct Type correspondences @@ -476,7 +476,7 @@ struct String { In Julia, we can access the parts independently to make a copy of that string: ```julia -str = from_c::Ptr{Void} +str = from_c::Ptr{Cvoid} len = unsafe_load(Ptr{Cint}(str)) unsafe_string(str + Core.sizeof(Cint), len) ``` @@ -563,7 +563,7 @@ types designed to mimic the internal structure of corresponding C structs. In Julia code wrapping calls to external Fortran routines, all input arguments should be declared as of type `Ref{T}`, as Fortran passes all variables by reference. The return type should either -be `Void` for Fortran subroutines, or a `T` for Fortran functions returning the type `T`. +be `Cvoid` for Fortran subroutines, or a `T` for Fortran functions returning the type `T`. ## Mapping C Functions to Julia @@ -585,7 +585,7 @@ For translating a C argument list to Julia: * depends on how this parameter is used, first translate this to the intended pointer type, then determine the Julia equivalent using the remaining rules in this list - * this argument may be declared as `Ptr{Void}`, if it really is just an unknown pointer + * this argument may be declared as `Ptr{Cvoid}`, if it really is just an unknown pointer * `jl_value_t*` * `Any` @@ -603,7 +603,7 @@ For translating a C argument list to Julia: object * `(T*)(...)` (e.g. a pointer to a function) - * `Ptr{Void}` (you may need to use [`cfunction`](@ref) explicitly to create this pointer) + * `Ptr{Cvoid}` (you may need to use [`cfunction`](@ref) explicitly to create this pointer) * `...` (e.g. a vararg) * `T...`, where `T` is the Julia type @@ -617,7 +617,7 @@ For translating a C return type to Julia: * `void` - * `Void` (this will return the singleton instance `nothing::Void`) + * `Cvoid` (this will return the singleton instance `nothing::Cvoid`) * `T`, where `T` is one of the primitive types: `char`, `int`, `long`, `short`, `float`, `double`, `complex`, `enum` or any of their `typedef` equivalents @@ -632,7 +632,7 @@ For translating a C return type to Julia: * depends on how this parameter is used, first translate this to the intended pointer type, then determine the Julia equivalent using the remaining rules in this list - * this argument may be declared as `Ptr{Void}`, if it really is just an unknown pointer + * this argument may be declared as `Ptr{Cvoid}`, if it really is just an unknown pointer * `jl_value_t*` * `Any` @@ -654,7 +654,7 @@ For translating a C return type to Julia: * `Ptr{T}`, where `T` is the Julia type corresponding to `T` * `(T*)(...)` (e.g. a pointer to a function) - * `Ptr{Void}` (you may need to use [`cfunction`](@ref) explicitly to create this pointer) + * `Ptr{Cvoid}` (you may need to use [`cfunction`](@ref) explicitly to create this pointer) ### Passing Pointers for Modifying Inputs @@ -666,7 +666,7 @@ as an argument, Julia will automatically pass a C pointer to the encapsulated da ```julia width = Ref{Cint}(0) range = Ref{Cfloat}(0) -ccall(:foo, Void, (Ref{Cint}, Ref{Cfloat}), width, range) +ccall(:foo, Cvoid, (Ref{Cint}, Ref{Cfloat}), width, range) ``` Upon return, the contents of `width` and `range` can be retrieved (if they were changed by `foo`) @@ -748,7 +748,7 @@ Here is a second example wrapping the corresponding destructor: function permutation_free(p::Ref{gsl_permutation}) ccall( (:gsl_permutation_free, :libgsl), # name of C function and library - Void, # output type + Cvoid, # output type (Ref{gsl_permutation},), # tuple of input types p # name of Julia variable to pass in ) @@ -857,11 +857,11 @@ then cache it in a shared reference for that session. For example: ```julia macro dlsym(func, lib) - z = Ref{Ptr{Void}}(C_NULL) + z = Ref{Ptr{Cvoid}}(C_NULL) quote let zlocal = $z[] if zlocal == C_NULL - zlocal = dlsym($(esc(lib))::Ptr{Void}, $(esc(func)))::Ptr{Void} + zlocal = dlsym($(esc(lib))::Ptr{Cvoid}, $(esc(func)))::Ptr{Cvoid} $z[] = $zlocal end zlocal @@ -870,7 +870,7 @@ macro dlsym(func, lib) end mylibvar = Libdl.dlopen("mylib") -ccall(@dlsym("myfunc", mylibvar), Void, ()) +ccall(@dlsym("myfunc", mylibvar), Cvoid, ()) ``` ## Closing a Library @@ -955,7 +955,7 @@ do not count, but the new reference does) to ensure the memory is not prematurel that if the object was not originally allocated by Julia, the new object will never be finalized by Julia's garbage collector. If the `Ptr` itself is actually a `jl_value_t*`, it can be converted back to a Julia object reference by [`unsafe_pointer_to_objref(ptr)`](@ref). (Julia values `v` -can be converted to `jl_value_t*` pointers, as `Ptr{Void}`, by calling [`pointer_from_objref(v)`](@ref).) +can be converted to `jl_value_t*` pointers, as `Ptr{Cvoid}`, by calling [`pointer_from_objref(v)`](@ref).) The reverse operation (writing data to a `Ptr{T}`), can be performed using [`unsafe_store!(ptr, value, [index])`](@ref). Currently, this is only supported for primitive types or other pointer-free (`isbits`) immutable struct types. diff --git a/doc/src/manual/faq.md b/doc/src/manual/faq.md index 937d037cd450c..6a24562d18e13 100644 --- a/doc/src/manual/faq.md +++ b/doc/src/manual/faq.md @@ -10,7 +10,7 @@ session (technically, in module `Main`), it is always present. If memory usage is your concern, you can always replace objects with ones that consume less memory. For example, if `A` is a gigabyte-sized array that you no longer need, you can free the memory with `A = nothing`. The memory will be released the next time the garbage collector runs; you can force -this to happen with [`gc()`](@ref). Moreover, an attempt to use `A` will likely result in an error, because most methods are not defined on type `Void`. +this to happen with [`gc()`](@ref). Moreover, an attempt to use `A` will likely result in an error, because most methods are not defined on type `Nothing`. ### How can I modify the declaration of a type in my session? @@ -622,13 +622,13 @@ will immediately throw an error. This situation can be detected using the Some functions are used only for their side effects, and do not need to return a value. In these cases, the convention is to return the value `nothing`, which is just a singleton object of type -`Void`. This is an ordinary type with no fields; there is nothing special about it except for +`Nothing`. This is an ordinary type with no fields; there is nothing special about it except for this convention, and that the REPL does not print anything for it. Some language constructs that would not otherwise have a value also yield `nothing`, for example `if false; end`. -For situations where a value `x` of type `T` exists only sometimes, the `Union{T, Void}` +For situations where a value `x` of type `T` exists only sometimes, the `Union{T, Nothing}` type can be used. If the value itself can be `nothing` (notably, when `T` is `Any`), -the `Union{Some{T}, Void}` type is more appropriate since `x == nothing` then indicates +the `Union{Some{T}, Nothing}` type is more appropriate since `x == nothing` then indicates the absence of a value, and `x == Some(nothing)` indicates the presence of a value equal to `nothing`. diff --git a/doc/src/manual/interfaces.md b/doc/src/manual/interfaces.md index e8498d31a8e97..a2a753e6ea50e 100644 --- a/doc/src/manual/interfaces.md +++ b/doc/src/manual/interfaces.md @@ -402,7 +402,7 @@ perhaps range-types `Ind` of your own design. For more information, see [Arrays | `Base.broadcast_indices(::StyleA, A)` | Declaration of the indices of `A` for broadcasting purposes (for AbstractArrays, defaults to `axes(A)`) | | **Bypassing default machinery** | | | `broadcast(f, As...)` | Complete bypass of broadcasting machinery | -| `broadcast(f, ::DestStyle, ::Void, ::Void, As...)` | Bypass after container type is computed | +| `broadcast(f, ::DestStyle, ::Nothing, ::Nothing, As...)` | Bypass after container type is computed | | `broadcast(f, ::DestStyle, ::Type{ElType}, inds::Tuple, As...)` | Bypass after container type, eltype, and indices are computed | [Broadcasting](@ref) is triggered by an explicit call to `broadcast` or `broadcast!`, or implicitly by diff --git a/doc/src/manual/modules.md b/doc/src/manual/modules.md index f1c8c9f780d89..5953a567e63d9 100644 --- a/doc/src/manual/modules.md +++ b/doc/src/manual/modules.md @@ -272,10 +272,10 @@ be initialized at runtime (not at compile time) because the pointer address will to run. You could accomplish this by defining the following `__init__` function in your module: ```julia -const foo_data_ptr = Ref{Ptr{Void}}(0) +const foo_data_ptr = Ref{Ptr{Cvoid}}(0) function __init__() - ccall((:foo_init, :libfoo), Void, ()) - foo_data_ptr[] = ccall((:foo_data, :libfoo), Ptr{Void}, ()) + ccall((:foo_init, :libfoo), Cvoid, ()) + foo_data_ptr[] = ccall((:foo_data, :libfoo), Ptr{Cvoid}, ()) nothing end ``` diff --git a/doc/src/manual/parallel-computing.md b/doc/src/manual/parallel-computing.md index fe06876515861..620580e63bf91 100644 --- a/doc/src/manual/parallel-computing.md +++ b/doc/src/manual/parallel-computing.md @@ -1164,24 +1164,24 @@ appropriate fields initialized) to `launched` ```julia mutable struct WorkerConfig # Common fields relevant to all cluster managers - io::Union{IO, Void} - host::Union{AbstractString, Void} - port::Union{Integer, Void} + io::Union{IO, Nothing} + host::Union{AbstractString, Nothing} + port::Union{Integer, Nothing} # Used when launching additional workers at a host - count::Union{Int, Symbol, Void} - exename::Union{AbstractString, Cmd, Void} - exeflags::Union{Cmd, Void} + count::Union{Int, Symbol, Nothing} + exename::Union{AbstractString, Cmd, Nothing} + exeflags::Union{Cmd, Nothing} # External cluster managers can use this to store information at a per-worker level # Can be a dict if multiple fields need to be stored. userdata::Any # SSHManager / SSH tunnel connections to workers - tunnel::Union{Bool, Void} - bind_addr::Union{AbstractString, Void} - sshflags::Union{Cmd, Void} - max_parallel::Union{Integer, Void} + tunnel::Union{Bool, Nothing} + bind_addr::Union{AbstractString, Nothing} + sshflags::Union{Cmd, Nothing} + max_parallel::Union{Integer, Nothing} # Used by Local/SSH managers connect_at::Any diff --git a/doc/src/manual/stacktraces.md b/doc/src/manual/stacktraces.md index bffbfdc20e6c6..5b7a5714e91db 100644 --- a/doc/src/manual/stacktraces.md +++ b/doc/src/manual/stacktraces.md @@ -183,33 +183,33 @@ ERROR: Whoops! ## Comparison with [`backtrace`](@ref) -A call to [`backtrace`](@ref) returns a vector of `Ptr{Void}`, which may then be passed into +A call to [`backtrace`](@ref) returns a vector of `Ptr{Cvoid}`, which may then be passed into [`stacktrace`](@ref) for translation: ```julia-repl julia> trace = backtrace() -21-element Array{Ptr{Void},1}: - Ptr{Void} @0x00007f10049d5b2f - Ptr{Void} @0x00007f0ffeb4d29c - Ptr{Void} @0x00007f0ffeb4d2a9 - Ptr{Void} @0x00007f1004993fe7 - Ptr{Void} @0x00007f10049a92be - Ptr{Void} @0x00007f10049a823a - Ptr{Void} @0x00007f10049a9fb0 - Ptr{Void} @0x00007f10049aa718 - Ptr{Void} @0x00007f10049c0d5e - Ptr{Void} @0x00007f10049a3286 - Ptr{Void} @0x00007f0ffe9ba3ba - Ptr{Void} @0x00007f0ffe9ba3d0 - Ptr{Void} @0x00007f1004993fe7 - Ptr{Void} @0x00007f0ded34583d - Ptr{Void} @0x00007f0ded345a87 - Ptr{Void} @0x00007f1004993fe7 - Ptr{Void} @0x00007f0ded34308f - Ptr{Void} @0x00007f0ded343320 - Ptr{Void} @0x00007f1004993fe7 - Ptr{Void} @0x00007f10049aeb67 - Ptr{Void} @0x0000000000000000 +21-element Array{Ptr{Cvoid},1}: + Ptr{Cvoid} @0x00007f10049d5b2f + Ptr{Cvoid} @0x00007f0ffeb4d29c + Ptr{Cvoid} @0x00007f0ffeb4d2a9 + Ptr{Cvoid} @0x00007f1004993fe7 + Ptr{Cvoid} @0x00007f10049a92be + Ptr{Cvoid} @0x00007f10049a823a + Ptr{Cvoid} @0x00007f10049a9fb0 + Ptr{Cvoid} @0x00007f10049aa718 + Ptr{Cvoid} @0x00007f10049c0d5e + Ptr{Cvoid} @0x00007f10049a3286 + Ptr{Cvoid} @0x00007f0ffe9ba3ba + Ptr{Cvoid} @0x00007f0ffe9ba3d0 + Ptr{Cvoid} @0x00007f1004993fe7 + Ptr{Cvoid} @0x00007f0ded34583d + Ptr{Cvoid} @0x00007f0ded345a87 + Ptr{Cvoid} @0x00007f1004993fe7 + Ptr{Cvoid} @0x00007f0ded34308f + Ptr{Cvoid} @0x00007f0ded343320 + Ptr{Cvoid} @0x00007f1004993fe7 + Ptr{Cvoid} @0x00007f10049aeb67 + Ptr{Cvoid} @0x0000000000000000 julia> stacktrace(trace) 5-element Array{StackFrame,1}: diff --git a/doc/src/manual/strings.md b/doc/src/manual/strings.md index 3178c638a84ca..2f8f89110436a 100644 --- a/doc/src/manual/strings.md +++ b/doc/src/manual/strings.md @@ -682,7 +682,7 @@ julia> m.match "acd" julia> m.captures -3-element Array{Union{Void, SubString{String}},1}: +3-element Array{Union{Nothing, SubString{String}},1}: "a" "c" "d" @@ -703,7 +703,7 @@ julia> m.match "ad" julia> m.captures -3-element Array{Union{Void, SubString{String}},1}: +3-element Array{Union{Nothing, SubString{String}},1}: "a" nothing "d" diff --git a/doc/src/manual/style-guide.md b/doc/src/manual/style-guide.md index 9108bf3ef4d30..6f0438e3b51c5 100644 --- a/doc/src/manual/style-guide.md +++ b/doc/src/manual/style-guide.md @@ -126,11 +126,11 @@ When creating a type such as: ```julia mutable struct MyType ... - x::Union{Void,T} + x::Union{Nothing,T} end ``` -ask whether the option for `x` to be `nothing` (of type `Void`) is really necessary. Here are +ask whether the option for `x` to be `nothing` (of type `Nothing`) is really necessary. Here are some alternatives to consider: * Find a safe default value to initialize `x` with diff --git a/doc/src/stdlib/arrays.md b/doc/src/stdlib/arrays.md index aa78bf301e1b9..da0618ec6a67c 100644 --- a/doc/src/stdlib/arrays.md +++ b/doc/src/stdlib/arrays.md @@ -8,17 +8,17 @@ Base.AbstractVector Base.AbstractMatrix Core.Array Core.Array(::Uninitialized, ::Any) -Core.Array(::Void, ::Any) +Core.Array(::Nothing, ::Any) Core.Array(::Missing, ::Any) Core.Uninitialized Core.uninitialized Base.Vector Base.Vector(::Uninitialized, ::Any) -Base.Vector(::Void, ::Any) +Base.Vector(::Nothing, ::Any) Base.Vector(::Missing, ::Any) Base.Matrix Base.Matrix(::Uninitialized, ::Any, ::Any) -Base.Matrix(::Void, ::Any, ::Any) +Base.Matrix(::Nothing, ::Any, ::Any) Base.Matrix(::Missing, ::Any, ::Any) Base.getindex(::Type, ::Any...) Base.zeros diff --git a/doc/src/stdlib/base.md b/doc/src/stdlib/base.md index 9f0f37427ae55..99bc516ad20a1 100644 --- a/doc/src/stdlib/base.md +++ b/doc/src/stdlib/base.md @@ -175,7 +175,7 @@ Core.UnionAll Core.Tuple Base.Val Core.Vararg -Core.Void +Core.Nothing Base.Some Base.Enums.@enum ``` diff --git a/examples/clustermanager/0mq/ZMQCM.jl b/examples/clustermanager/0mq/ZMQCM.jl index 69ceb5e0d462a..1a049161fec35 100644 --- a/examples/clustermanager/0mq/ZMQCM.jl +++ b/examples/clustermanager/0mq/ZMQCM.jl @@ -127,7 +127,7 @@ function start_broker() ZMQ.bind(xsub, "tcp://127.0.0.1:$(BROKER_SUB_PORT)") ZMQ.bind(xpub, "tcp://127.0.0.1:$(BROKER_PUB_PORT)") - ccall((:zmq_proxy, :libzmq), Cint, (Ptr{Void}, Ptr{Void}, Ptr{Void}), xsub.data, xpub.data, C_NULL) + ccall((:zmq_proxy, :libzmq), Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), xsub.data, xpub.data, C_NULL) # proxy(xsub, xpub) # control never comes here diff --git a/examples/embedding/embedding.c b/examples/embedding/embedding.c index a1fc6c676620b..e9ca6b79add76 100644 --- a/examples/embedding/embedding.c +++ b/examples/embedding/embedding.c @@ -142,7 +142,7 @@ int main() " nothing\n" "end"); typedef void (*Func_VOID__VOID)(void); - jl_value_t *pbar = jl_eval_string("cfunction(bar_from_c, Void, Tuple{})"); + jl_value_t *pbar = jl_eval_string("cfunction(bar_from_c, Cvoid, Tuple{})"); Func_VOID__VOID bar = (Func_VOID__VOID)jl_unbox_voidpointer(pbar); bar(); checked_eval_string("bar() = println(\"calling new bar\")"); diff --git a/src/abi_aarch64.cpp b/src/abi_aarch64.cpp index 346dbf1ec5276..475fe3ba4596c 100644 --- a/src/abi_aarch64.cpp +++ b/src/abi_aarch64.cpp @@ -318,7 +318,7 @@ Type *classify_arg(jl_datatype_t *dt, bool *fpreg, bool *onstack, // with weird size as a black box composite type. // The type can fit in 8 x 8 bytes since it is handled by // need_pass_by_ref otherwise. - // 0-size types (Void) won't be rewritten and that is what we want + // 0-size types (Nothing) won't be rewritten and that is what we want assert(jl_datatype_size(dt) <= 16); // Should be pass by reference otherwise *rewrite_len = (jl_datatype_size(dt) + 7) >> 3; // Rewrite to [n x Int64] where n is the **size in dword** diff --git a/src/builtins.c b/src/builtins.c index 44cf30e1f18e0..d5b980ac24d03 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -1253,7 +1253,7 @@ void jl_init_primitives(void) // builtin types add_builtin("Any", (jl_value_t*)jl_any_type); add_builtin("Type", (jl_value_t*)jl_type_type); - add_builtin("Void", (jl_value_t*)jl_void_type); + add_builtin("Nothing", (jl_value_t*)jl_void_type); add_builtin("nothing", (jl_value_t*)jl_nothing); add_builtin("TypeName", (jl_value_t*)jl_typename_type); add_builtin("DataType", (jl_value_t*)jl_datatype_type); diff --git a/src/ccall.cpp b/src/ccall.cpp index 8bd49c5d769eb..7290b42b453e6 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -554,7 +554,7 @@ static Value *julia_to_address( // no copy, just reference the data field return ctx.builder.CreateBitCast(emit_pointer_from_objref(ctx, data_pointer(ctx, jvinfo)), to); } - else if (jl_is_immutable_datatype(ety) && jlto != (jl_value_t*)jl_voidpointer_type) { // anything declared `struct`, except Ptr{Void} + else if (jl_is_immutable_datatype(ety) && jlto != (jl_value_t*)jl_voidpointer_type) { // anything declared `struct`, except Ptr{Cvoid} // yes copy Value *nbytes; AllocaInst *ai; diff --git a/src/common_symbols2.inc b/src/common_symbols2.inc index 50f9c0fe4ed65..e41e64d8d73c3 100644 --- a/src/common_symbols2.inc +++ b/src/common_symbols2.inc @@ -5,7 +5,7 @@ jl_symbol("write"), jl_symbol("Array"), jl_symbol("neg_int"), jl_symbol("len"), -jl_symbol("Void"), +jl_symbol("Nothing"), jl_symbol("ArgumentError"), jl_symbol("indices1"), jl_symbol("<"), diff --git a/src/jltypes.c b/src/jltypes.c index 09d44e8f9dc8a..be7728eb89bd1 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -1835,7 +1835,7 @@ void jl_init_types(void) jl_simplevector_type->ninitialized = 0; // now they can be used to create the remaining base kinds and types - jl_void_type = jl_new_datatype(jl_symbol("Void"), core, jl_any_type, jl_emptysvec, + jl_void_type = jl_new_datatype(jl_symbol("Nothing"), core, jl_any_type, jl_emptysvec, jl_emptysvec, jl_emptysvec, 0, 0, 0); jl_astaggedvalue(jl_nothing)->header = ((uintptr_t)jl_void_type) | GC_OLD_MARKED; jl_void_type->instance = jl_nothing; @@ -1956,7 +1956,7 @@ void jl_init_types(void) "issimplesig", "va"), jl_svec(10, - jl_any_type, // Union{TypeMapEntry, Void} + jl_any_type, // Union{TypeMapEntry, Nothing} jl_type_type, // TupleType jl_any_type, // TupleType jl_any_type, // SimpleVector{TupleType} @@ -2096,7 +2096,7 @@ void jl_init_types(void) jl_int32_type, jl_type_type, jl_long_type, - jl_any_type, // Union{Array, Void} + jl_any_type, // Union{Array, Nothing} jl_any_type, // TypeMap jl_simplevector_type, jl_any_type, diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index f7c1d051f5422..1dbd50c752d17 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3817,7 +3817,7 @@ f(x) = yt(x) (emit `(leave 1)) (if finally (begin (emit `(= ,finally-exception (the_exception))) - (leave-finally-block `(foreigncall 'jl_rethrow_other (core Void) (call (core svec) Any) + (leave-finally-block `(foreigncall 'jl_rethrow_other (core Nothing) (call (core svec) Any) 'ccall 1 ,finally-exception) #f)) (let ((v2 (compile (caddr e) break-labels value tail))) diff --git a/src/julia.h b/src/julia.h index bf55abd6c9e07..465c82fc17987 100644 --- a/src/julia.h +++ b/src/julia.h @@ -182,7 +182,7 @@ struct _jl_method_instance_t; // TypeMap is an implicitly defined type // that can consist of any of the following nodes: -// typedef TypeMap Union{TypeMapLevel, TypeMapEntry, Void} +// typedef TypeMap Union{TypeMapLevel, TypeMapEntry, Nothing} // it forms a roughly tree-shaped structure, consisting of nodes of TypeMapLevels // which split the tree when possible, for example based on the key into the tuple type at `offs` // when key is a leaftype, (but only when the tree has enough entries for this to be @@ -1841,17 +1841,17 @@ typedef struct { // hooks // module setup: prepare a module for code emission (data layout, DWARF version, ...) - // parameters: LLVMModuleRef as Ptr{Void} + // parameters: LLVMModuleRef as Ptr{Cvoid} // return value: none jl_value_t *module_setup; // module activation: registers debug info, adds module to JIT - // parameters: LLVMModuleRef as Ptr{Void} + // parameters: LLVMModuleRef as Ptr{Cvoid} // return value: none jl_value_t *module_activation; // exception raising: emit LLVM instructions to raise an exception - // parameters: LLVMBasicBlockRef as Ptr{Void}, LLVMValueRef as Ptr{Void} + // parameters: LLVMBasicBlockRef as Ptr{Cvoid}, LLVMValueRef as Ptr{Cvoid} // return value: none jl_value_t *raise_exception; } jl_cgparams_t; diff --git a/stdlib/Dates/src/parse.jl b/stdlib/Dates/src/parse.jl index 8c59189b5687c..5f8698291ca36 100644 --- a/stdlib/Dates/src/parse.jl +++ b/stdlib/Dates/src/parse.jl @@ -27,7 +27,7 @@ the end of the string, `len`. When a directive cannot be parsed the returned val will be `nothing` if `raise` is false otherwise an exception will be thrown. Return a 3-element tuple `(values, pos, num_parsed)`: -* `values::Union{Tuple, Void}`: Either `nothing`, or a tuple which contains a value +* `values::Union{Tuple, Nothing}`: Either `nothing`, or a tuple which contains a value for each `DatePart` within the `DateFormat` in the order in which they occur. If the string ends before we finish parsing all the directives the missing values will be filled in with default values. @@ -120,7 +120,7 @@ parsed the returned value tuple will be `nothing` if `raise` is false otherwise be thrown. Return a 2-element tuple `(values, pos)`: -* `values::Union{Tuple, Void}`: Either `nothing`, or a tuple which contains a value +* `values::Union{Tuple, Nothing}`: Either `nothing`, or a tuple which contains a value for each token as specified by the passed in type. * `pos::Int`: The character index at which parsing stopped. """ diff --git a/stdlib/Dates/src/types.jl b/stdlib/Dates/src/types.jl index 008d6e37afe9e..99b9a74464346 100644 --- a/stdlib/Dates/src/types.jl +++ b/stdlib/Dates/src/types.jl @@ -152,7 +152,7 @@ daysinmonth(y,m) = DAYSINMONTH[m] + (m == 2 && isleapyear(y)) # we can validate arguments in tryparse. """ - validargs(::Type{<:TimeType}, args...) -> Union{ArgumentError, Void} + validargs(::Type{<:TimeType}, args...) -> Union{ArgumentError, Nothing} Determine whether the given arguments consitute valid inputs for the given type. Returns either an `ArgumentError`, or [`nothing`](@ref) in case of success. @@ -160,7 +160,7 @@ Returns either an `ArgumentError`, or [`nothing`](@ref) in case of success. function validargs end """ - argerror([msg]) -> Union{ArgumentError, Void} + argerror([msg]) -> Union{ArgumentError, Nothing} Return an `ArgumentError` object with the given message, or [`nothing`](@ref) if no message is provided. For use by `validargs`. diff --git a/stdlib/Distributed/src/cluster.jl b/stdlib/Distributed/src/cluster.jl index 5b43f0e4903b7..5034e02d517c2 100644 --- a/stdlib/Distributed/src/cluster.jl +++ b/stdlib/Distributed/src/cluster.jl @@ -4,41 +4,41 @@ abstract type ClusterManager end mutable struct WorkerConfig # Common fields relevant to all cluster managers - io::Union{IO, Void} - host::Union{AbstractString, Void} - port::Union{Integer, Void} + io::Union{IO, Nothing} + host::Union{AbstractString, Nothing} + port::Union{Integer, Nothing} # Used when launching additional workers at a host - count::Union{Int, Symbol, Void} - exename::Union{AbstractString, Cmd, Void} - exeflags::Union{Cmd, Void} + count::Union{Int, Symbol, Nothing} + exename::Union{AbstractString, Cmd, Nothing} + exeflags::Union{Cmd, Nothing} # External cluster managers can use this to store information at a per-worker level # Can be a dict if multiple fields need to be stored. userdata::Any # SSHManager / SSH tunnel connections to workers - tunnel::Union{Bool, Void} - bind_addr::Union{AbstractString, Void} - sshflags::Union{Cmd, Void} - max_parallel::Union{Integer, Void} + tunnel::Union{Bool, Nothing} + bind_addr::Union{AbstractString, Nothing} + sshflags::Union{Cmd, Nothing} + max_parallel::Union{Integer, Nothing} # Used by Local/SSH managers connect_at::Any - process::Union{Process, Void} - ospid::Union{Integer, Void} + process::Union{Process, Nothing} + ospid::Union{Integer, Nothing} # Private dictionary used to store temporary information by Local/SSH managers. - environ::Union{Dict, Void} + environ::Union{Dict, Nothing} # Connections to be setup depending on the network topology requested ident::Any # Worker as identified by the Cluster Manager. # List of other worker idents this worker must connect with. Used with topology T_CUSTOM. - connect_idents::Union{Array, Void} + connect_idents::Union{Array, Nothing} # Run multithreaded blas on worker - enable_threaded_blas::Union{Bool, Void} + enable_threaded_blas::Union{Bool, Nothing} function WorkerConfig() wc = new() @@ -67,10 +67,10 @@ mutable struct Worker # serializer as part of the Worker object manager::ClusterManager config::WorkerConfig - version::Union{VersionNumber, Void} # Julia version of the remote process + version::Union{VersionNumber, Nothing} # Julia version of the remote process function Worker(id::Int, r_stream::IO, w_stream::IO, manager::ClusterManager; - version::Union{VersionNumber, Void}=nothing, + version::Union{VersionNumber, Nothing}=nothing, config::WorkerConfig=WorkerConfig()) w = Worker(id) w.r_stream = r_stream @@ -673,7 +673,7 @@ mutable struct ProcessGroup workers::Array{Any,1} refs::Dict # global references topology::Symbol - lazy::Union{Bool, Void} + lazy::Union{Bool, Nothing} ProcessGroup(w::Array{Any,1}) = new("pg-default", w, Dict(), :all_to_all, nothing) end @@ -1036,10 +1036,10 @@ end function disable_nagle(sock) # disable nagle on all OSes - ccall(:uv_tcp_nodelay, Cint, (Ptr{Void}, Cint), sock.handle, 1) + ccall(:uv_tcp_nodelay, Cint, (Ptr{Cvoid}, Cint), sock.handle, 1) @static if Sys.islinux() # tcp_quickack is a linux only option - if ccall(:jl_tcp_quickack, Cint, (Ptr{Void}, Cint), sock.handle, 1) < 0 + if ccall(:jl_tcp_quickack, Cint, (Ptr{Cvoid}, Cint), sock.handle, 1) < 0 @warn "Networking unoptimized ( Error enabling TCP_QUICKACK : $(Libc.strerror(Libc.errno())) )" maxlog=1 end end diff --git a/stdlib/Distributed/src/managers.jl b/stdlib/Distributed/src/managers.jl index a90c9775f75d7..97669bd455308 100644 --- a/stdlib/Distributed/src/managers.jl +++ b/stdlib/Distributed/src/managers.jl @@ -469,7 +469,7 @@ function socket_reuse_port() bind_early = Sys.islinux() bind_early && bind_client_port(s) - rc = ccall(:jl_tcp_reuseport, Int32, (Ptr{Void},), s.handle) + rc = ccall(:jl_tcp_reuseport, Int32, (Ptr{Cvoid},), s.handle) if rc < 0 # This is an issue only on systems with lots of client connections, hence delay the warning nworkers() > 128 && @warn "Error trying to reuse client port number, falling back to regular socket" maxlog=1 @@ -485,7 +485,7 @@ function socket_reuse_port() end function bind_client_port(s) - err = ccall(:jl_tcp_bind, Int32, (Ptr{Void}, UInt16, UInt32, Cuint), + err = ccall(:jl_tcp_bind, Int32, (Ptr{Cvoid}, UInt16, UInt32, Cuint), s.handle, hton(client_port[]), hton(UInt32(0)), 0) uv_error("bind() failed", err) diff --git a/stdlib/Distributed/src/messages.jl b/stdlib/Distributed/src/messages.jl index aec20d1f4bb2b..0dd70baff6d77 100644 --- a/stdlib/Distributed/src/messages.jl +++ b/stdlib/Distributed/src/messages.jl @@ -32,7 +32,7 @@ struct MsgHeader end # Special oid (0,0) uses to indicate a null ID. -# Used instead of Union{Int, Void} to decrease wire size of header. +# Used instead of Union{Int, Nothing} to decrease wire size of header. null_id(id) = id == RRID(0, 0) struct CallMsg{Mode} <: AbstractMsg diff --git a/stdlib/Distributed/src/precompile.jl b/stdlib/Distributed/src/precompile.jl index bb5ea5a3d0f90..4a9b0b5a25b4c 100644 --- a/stdlib/Distributed/src/precompile.jl +++ b/stdlib/Distributed/src/precompile.jl @@ -109,7 +109,7 @@ precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Distributed.RR precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Distributed.RemoteValue, Distributed.RRID, Int64}) precompile(Tuple{typeof(Base.notify), Base.Condition, Distributed.ProcessExitedException, Bool, Bool}) precompile(Tuple{typeof(Distributed.process_messages), Base.TCPSocket, Base.TCPSocket, Bool}) -precompile(Tuple{typeof(Base.pop!), Base.Dict{Int64, Union{Distributed.Worker, Distributed.LocalProcess}}, Int64, Void}) +precompile(Tuple{typeof(Base.pop!), Base.Dict{Int64, Union{Distributed.Worker, Distributed.LocalProcess}}, Int64, Nothing}) precompile(Tuple{typeof(Distributed.send_connection_hdr), Distributed.Worker, Bool}) precompile(Tuple{typeof(Distributed.deregister_worker), Distributed.ProcessGroup, Int64}) precompile(Tuple{typeof(Distributed.process_hdr), Base.TCPSocket, Bool}) @@ -190,7 +190,7 @@ precompile(Tuple{Type{Distributed.ResultMsg}, Distributed.RemoteException}) precompile(Tuple{Type{Distributed.ResultMsg}, Symbol}) precompile(Tuple{typeof(Distributed.send_msg_now), Base.TCPSocket, Distributed.MsgHeader, Distributed.ResultMsg}) precompile(Tuple{typeof(Base.notify), Base.Condition, Distributed.ProcessExitedException, Bool, Bool}) -precompile(Tuple{typeof(Base.pop!), Base.Dict{Int64, Union{Distributed.Worker, Distributed.LocalProcess}}, Int64, Void}) +precompile(Tuple{typeof(Base.pop!), Base.Dict{Int64, Union{Distributed.Worker, Distributed.LocalProcess}}, Int64, Nothing}) precompile(Tuple{typeof(Distributed.deregister_worker), Distributed.ProcessGroup, Int64}) precompile(Tuple{typeof(Distributed.process_hdr), Base.TCPSocket, Bool}) precompile(Tuple{typeof(Distributed.null_id), Distributed.RRID}) @@ -226,7 +226,7 @@ precompile(Tuple{typeof(Base.Serializer.deserialize), Distributed.ClusterSeriali precompile(Tuple{Type{Distributed.JoinCompleteMsg}, Int64, Int64}) precompile(Tuple{typeof(Distributed.handle_msg), Distributed.JoinCompleteMsg, Distributed.MsgHeader, Base.TCPSocket, Base.TCPSocket, Base.VersionNumber}) precompile(Tuple{typeof(Base.hash), Distributed.RemoteChannel{Base.Channel{Any}}, UInt64}) -precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Void}, Distributed.RemoteChannel{Base.Channel{Any}}}) +precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Nothing}, Distributed.RemoteChannel{Base.Channel{Any}}}) precompile(Tuple{typeof(Distributed.remotecall_fetch), typeof(Distributed.put_ref), Distributed.Worker, Distributed.RRID, Distributed.WorkerPool}) precompile(Tuple{typeof(Distributed.remotecall_fetch), typeof(Distributed.put_ref), Distributed.LocalProcess, Distributed.RRID, Distributed.WorkerPool}) precompile(Tuple{getfield(Distributed, Symbol("#kw##remotecall_fetch")), Array{Any, 1}, typeof(Distributed.remotecall_fetch), typeof(Distributed.put_ref), Distributed.Worker, Distributed.RRID, Distributed.WorkerPool}) @@ -276,6 +276,6 @@ precompile(Tuple{typeof(Distributed.terminate_all_workers)}) precompile(Tuple{typeof(Distributed.test_existing_ref), Distributed.Future}) precompile(Tuple{typeof(Base.finalizer), Distributed.Future, typeof(Distributed.finalize_ref)}) precompile(Tuple{typeof(Base.hash), Distributed.Future, UInt64}) -precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Void}, Distributed.Future}) +precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Nothing}, Distributed.Future}) precompile(Tuple{typeof(Base.sync_add), Distributed.Future}) precompile(Tuple{Type{Union{}}, Distributed.RRID}) diff --git a/stdlib/Distributed/src/remotecall.jl b/stdlib/Distributed/src/remotecall.jl index 522fecdd57862..940bf7c7cef30 100644 --- a/stdlib/Distributed/src/remotecall.jl +++ b/stdlib/Distributed/src/remotecall.jl @@ -8,7 +8,7 @@ Tracks whether a particular `AbstractRemoteRef` The `client_refs` lock is also used to synchronize access to `.refs` and associated `clientset` state. """ -const client_refs = WeakKeyDict{Any, Void}() # used as a WeakKeySet +const client_refs = WeakKeyDict{Any, Nothing}() # used as a WeakKeySet abstract type AbstractRemoteRef end @@ -22,9 +22,9 @@ mutable struct Future <: AbstractRemoteRef where::Int whence::Int id::Int - v::Union{Some{Any}, Void} + v::Union{Some{Any}, Nothing} - Future(w::Int, rrid::RRID, v::Union{Some, Void}=nothing) = + Future(w::Int, rrid::RRID, v::Union{Some, Nothing}=nothing) = (r = new(w,rrid.whence,rrid.id,v); return test_existing_ref(r)) Future(t::NTuple{4, Any}) = new(t[1],t[2],t[3],t[4]) # Useful for creating dummy, zeroed-out instances diff --git a/stdlib/Distributed/src/workerpool.jl b/stdlib/Distributed/src/workerpool.jl index a5fba93f2623e..f3ce4e8c3ae48 100644 --- a/stdlib/Distributed/src/workerpool.jl +++ b/stdlib/Distributed/src/workerpool.jl @@ -185,7 +185,7 @@ performs a `remote_do` on it. """ remote_do(f, pool::AbstractWorkerPool, args...; kwargs...) = remotecall_pool(remote_do, f, pool, args...; kwargs...) -const _default_worker_pool = Ref{Union{WorkerPool, Void}}(nothing) +const _default_worker_pool = Ref{Union{WorkerPool, Nothing}}(nothing) """ default_worker_pool() diff --git a/stdlib/FileWatching/src/FileWatching.jl b/stdlib/FileWatching/src/FileWatching.jl index 8512cae6b9e2b..81bef41dd5d4b 100644 --- a/stdlib/FileWatching/src/FileWatching.jl +++ b/stdlib/FileWatching/src/FileWatching.jl @@ -64,7 +64,7 @@ fdtimeout() = FDEvent(false, false, false, true) a.timedout | b.timedout) mutable struct FileMonitor - handle::Ptr{Void} + handle::Ptr{Cvoid} file::String notify::Condition active::Bool @@ -72,7 +72,7 @@ mutable struct FileMonitor handle = Libc.malloc(_sizeof_uv_fs_event) this = new(handle, file, Condition(), false) associate_julia_struct(handle, this) - err = ccall(:uv_fs_event_init, Cint, (Ptr{Void}, Ptr{Void}), eventloop(), handle) + err = ccall(:uv_fs_event_init, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), eventloop(), handle) if err != 0 Libc.free(handle) throw(UVError("FileMonitor", err)) @@ -83,7 +83,7 @@ mutable struct FileMonitor end mutable struct PollingFileWatcher - handle::Ptr{Void} + handle::Ptr{Cvoid} file::String interval::UInt32 notify::Condition @@ -93,7 +93,7 @@ mutable struct PollingFileWatcher handle = Libc.malloc(_sizeof_uv_fs_poll) this = new(handle, file, round(UInt32, interval * 1000), Condition(), false, 0) associate_julia_struct(handle, this) - err = ccall(:uv_fs_poll_init, Int32, (Ptr{Void}, Ptr{Void}), eventloop(), handle) + err = ccall(:uv_fs_poll_init, Int32, (Ptr{Cvoid}, Ptr{Cvoid}), eventloop(), handle) if err != 0 Libc.free(handle) throw(UVError("PollingFileWatcher", err)) @@ -104,7 +104,7 @@ mutable struct PollingFileWatcher end mutable struct _FDWatcher - handle::Ptr{Void} + handle::Ptr{Cvoid} fdnum::Int # this is NOT the file descriptor refcount::Tuple{Int, Int} notify::Condition @@ -128,7 +128,7 @@ mutable struct _FDWatcher this.refcount = (this.refcount[1] + Int(readable), this.refcount[2] + Int(writable)) return this end - if ccall(:jl_uv_unix_fd_is_watched, Int32, (Int32, Ptr{Void}, Ptr{Void}), fd.fd, C_NULL, eventloop()) == 1 + if ccall(:jl_uv_unix_fd_is_watched, Int32, (Int32, Ptr{Cvoid}, Ptr{Cvoid}), fd.fd, C_NULL, eventloop()) == 1 throw(ArgumentError("file descriptor $(fd.fd) is already being watched by libuv")) end @@ -141,7 +141,7 @@ mutable struct _FDWatcher (false, false), 0) associate_julia_struct(handle, this) - err = ccall(:uv_poll_init, Int32, (Ptr{Void}, Ptr{Void}, Int32), eventloop(), handle, fd.fd) + err = ccall(:uv_poll_init, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Int32), eventloop(), handle, fd.fd) if err != 0 Libc.free(handle) throw(UVError("FDWatcher", err)) @@ -155,7 +155,7 @@ mutable struct _FDWatcher function Base.uvfinalize(t::_FDWatcher) if t.handle != C_NULL disassociate_julia_struct(t) - ccall(:jl_close_uv, Void, (Ptr{Void},), t.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t.handle) t.handle = C_NULL end t.refcount = (0, 0) @@ -189,7 +189,7 @@ mutable struct _FDWatcher (false, false), 0) associate_julia_struct(handle, this) - err = ccall(:uv_poll_init_socket, Int32, (Ptr{Void}, Ptr{Void}, Ptr{Void}), + err = ccall(:uv_poll_init_socket, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), eventloop(), handle, fd.handle) if err != 0 Libc.free(handle) @@ -243,7 +243,7 @@ end function close(t::Union{FileMonitor, PollingFileWatcher}) if t.handle != C_NULL - ccall(:jl_close_uv, Void, (Ptr{Void},), t.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t.handle) end end @@ -269,12 +269,12 @@ function _uv_hook_close(uv::FileMonitor) end function __init__() - global uv_jl_pollcb = cfunction(uv_pollcb, Void, Tuple{Ptr{Void}, Cint, Cint}) - global uv_jl_fspollcb = cfunction(uv_fspollcb, Void, Tuple{Ptr{Void}, Cint, Ptr{Void}, Ptr{Void}}) - global uv_jl_fseventscb = cfunction(uv_fseventscb, Void, Tuple{Ptr{Void}, Ptr{Int8}, Int32, Int32}) + global uv_jl_pollcb = cfunction(uv_pollcb, Cvoid, Tuple{Ptr{Cvoid}, Cint, Cint}) + global uv_jl_fspollcb = cfunction(uv_fspollcb, Cvoid, Tuple{Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}}) + global uv_jl_fseventscb = cfunction(uv_fseventscb, Cvoid, Tuple{Ptr{Cvoid}, Ptr{Int8}, Int32, Int32}) end -function uv_fseventscb(handle::Ptr{Void}, filename::Ptr, events::Int32, status::Int32) +function uv_fseventscb(handle::Ptr{Cvoid}, filename::Ptr, events::Int32, status::Int32) t = @handle_as handle FileMonitor fname = filename == C_NULL ? "" : unsafe_string(convert(Ptr{UInt8}, filename)) if status != 0 @@ -285,7 +285,7 @@ function uv_fseventscb(handle::Ptr{Void}, filename::Ptr, events::Int32, status:: nothing end -function uv_pollcb(handle::Ptr{Void}, status::Int32, events::Int32) +function uv_pollcb(handle::Ptr{Cvoid}, status::Int32, events::Int32) t = @handle_as handle _FDWatcher if status != 0 notify_error(t.notify, UVError("FDWatcher", status)) @@ -296,7 +296,7 @@ function uv_pollcb(handle::Ptr{Void}, status::Int32, events::Int32) # if we keep hearing about events when nobody appears to be listening, # stop the poll to save cycles t.active = (false, false) - ccall(:uv_poll_stop, Int32, (Ptr{Void},), t.handle) + ccall(:uv_poll_stop, Int32, (Ptr{Cvoid},), t.handle) end end notify(t.notify, FDEvent(events)) @@ -304,7 +304,7 @@ function uv_pollcb(handle::Ptr{Void}, status::Int32, events::Int32) nothing end -function uv_fspollcb(handle::Ptr{Void}, status::Int32, prev::Ptr, curr::Ptr) +function uv_fspollcb(handle::Ptr{Cvoid}, status::Int32, prev::Ptr, curr::Ptr) t = @handle_as handle PollingFileWatcher if status == 0 || status != t.busy_polling t.busy_polling = status @@ -322,10 +322,10 @@ function start_watching(t::_FDWatcher) if t.active[1] != readable || t.active[2] != writable # make sure the READABLE / WRITEABLE state is updated uv_error("start_watching (File Handle)", - ccall(:uv_poll_start, Int32, (Ptr{Void}, Int32, Ptr{Void}), + ccall(:uv_poll_start, Int32, (Ptr{Cvoid}, Int32, Ptr{Cvoid}), t.handle, (readable ? UV_READABLE : 0) | (writable ? UV_WRITABLE : 0), - uv_jl_pollcb::Ptr{Void})) + uv_jl_pollcb::Ptr{Cvoid})) t.active = (readable, writable) end nothing @@ -334,8 +334,8 @@ end function start_watching(t::PollingFileWatcher) if !t.active uv_error("start_watching (File Path)", - ccall(:uv_fs_poll_start, Int32, (Ptr{Void}, Ptr{Void}, Cstring, UInt32), - t.handle, uv_jl_fspollcb::Ptr{Void}, t.file, t.interval)) + ccall(:uv_fs_poll_start, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, UInt32), + t.handle, uv_jl_fspollcb::Ptr{Cvoid}, t.file, t.interval)) t.active = true end nothing @@ -345,7 +345,7 @@ function stop_watching(t::PollingFileWatcher) if t.active && isempty(t.notify.waitq) t.active = false uv_error("stop_watching (File Path)", - ccall(:uv_fs_poll_stop, Int32, (Ptr{Void},), t.handle)) + ccall(:uv_fs_poll_stop, Int32, (Ptr{Cvoid},), t.handle)) end nothing end @@ -353,8 +353,8 @@ end function start_watching(t::FileMonitor) if !t.active uv_error("start_watching (File Monitor)", - ccall(:uv_fs_event_start, Int32, (Ptr{Void}, Ptr{Void}, Cstring, Int32), - t.handle, uv_jl_fseventscb::Ptr{Void}, t.file, 0)) + ccall(:uv_fs_event_start, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Int32), + t.handle, uv_jl_fseventscb::Ptr{Cvoid}, t.file, 0)) t.active = true end nothing @@ -364,7 +364,7 @@ function stop_watching(t::FileMonitor) if t.active && isempty(t.notify.waitq) t.active = false uv_error("stop_watching (File Monitor)", - ccall(:uv_fs_event_stop, Int32, (Ptr{Void},), t.handle)) + ccall(:uv_fs_event_stop, Int32, (Ptr{Cvoid},), t.handle)) end nothing end diff --git a/stdlib/FileWatching/test/runtests.jl b/stdlib/FileWatching/test/runtests.jl index e2dde2eac3be6..ce90324aa0652 100644 --- a/stdlib/FileWatching/test/runtests.jl +++ b/stdlib/FileWatching/test/runtests.jl @@ -44,7 +44,7 @@ function pfd_tst_reads(idx, intvl) dout = Vector{UInt8}(uninitialized, 1) @static if Sys.iswindows() - 1 == ccall(:recv, stdcall, Cint, (Ptr{Void}, Ptr{UInt8}, Cint, Cint), pipe_fds[idx][1], dout, 1, 0) || error(Libc.FormatMessage()) + 1 == ccall(:recv, stdcall, Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint, Cint), pipe_fds[idx][1], dout, 1, 0) || error(Libc.FormatMessage()) else @test 1 == ccall(:read, Csize_t, (Cint, Ptr{UInt8}, Csize_t), pipe_fds[idx][1], dout, 1) end @@ -99,7 +99,7 @@ for (i, intvl) in enumerate(intvls) if isodd(idx) @static if Sys.iswindows() - 1 == ccall(:send, stdcall, Cint, (Ptr{Void}, Ptr{UInt8}, Cint, Cint), pipe_fds[idx][2], "A", 1, 0) || error(Libc.FormatMessage()) + 1 == ccall(:send, stdcall, Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint, Cint), pipe_fds[idx][2], "A", 1, 0) || error(Libc.FormatMessage()) else @test 1 == ccall(:write, Csize_t, (Cint, Ptr{UInt8}, Csize_t), pipe_fds[idx][2], "A", 1) end @@ -115,7 +115,7 @@ end for i in 1:n for j = 1:2 @static if Sys.iswindows() - 0 == ccall(:closesocket, stdcall, Cint, (Ptr{Void},), pipe_fds[i][j]) || error(Libc.FormatMessage()) + 0 == ccall(:closesocket, stdcall, Cint, (Ptr{Cvoid},), pipe_fds[i][j]) || error(Libc.FormatMessage()) else @test 0 == ccall(:close, Cint, (Cint,), pipe_fds[i][j]) end diff --git a/stdlib/IterativeEigensolvers/src/arpack.jl b/stdlib/IterativeEigensolvers/src/arpack.jl index 33e3686806ec3..ced0680b8d199 100644 --- a/stdlib/IterativeEigensolvers/src/arpack.jl +++ b/stdlib/IterativeEigensolvers/src/arpack.jl @@ -204,7 +204,7 @@ for (T, saupd_name, seupd_name, naupd_name, neupd_name) in @eval begin function naupd(ido, bmat, n, evtype, nev, TOL::Ref{$T}, resid::Vector{$T}, ncv, v::Matrix{$T}, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, info) - ccall(($(string(naupd_name)), :libarpack), Void, + ccall(($(string(naupd_name)), :libarpack), Cvoid, (Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ref{BlasInt}, Clong, Clong), @@ -216,7 +216,7 @@ for (T, saupd_name, seupd_name, naupd_name, neupd_name) in function neupd(rvec, howmny, select, dr, di, z, ldz, sigmar, sigmai, workev::Vector{$T}, bmat, n, evtype, nev, TOL::Ref{$T}, resid::Vector{$T}, ncv, v, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, info) - ccall(($(string(neupd_name)), :libarpack), Void, + ccall(($(string(neupd_name)), :libarpack), Cvoid, (Ref{BlasInt}, Ptr{UInt8}, Ptr{BlasInt}, Ptr{$T}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ref{$T}, Ref{$T}, Ptr{$T}, Ptr{UInt8}, Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ref{BlasInt}, @@ -229,7 +229,7 @@ for (T, saupd_name, seupd_name, naupd_name, neupd_name) in function saupd(ido, bmat, n, which, nev, TOL::Ref{$T}, resid::Vector{$T}, ncv, v::Matrix{$T}, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, info) - ccall(($(string(saupd_name)), :libarpack), Void, + ccall(($(string(saupd_name)), :libarpack), Cvoid, (Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ref{BlasInt}, Clong, Clong), @@ -241,7 +241,7 @@ for (T, saupd_name, seupd_name, naupd_name, neupd_name) in function seupd(rvec, howmny, select, d, z, ldz, sigma, bmat, n, evtype, nev, TOL::Ref{$T}, resid::Vector{$T}, ncv, v::Matrix{$T}, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, info) - ccall(($(string(seupd_name)), :libarpack), Void, + ccall(($(string(seupd_name)), :libarpack), Cvoid, (Ref{BlasInt}, Ptr{UInt8}, Ptr{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ptr{UInt8}, Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ref{BlasInt}, @@ -261,7 +261,7 @@ for (T, TR, naupd_name, neupd_name) in function naupd(ido, bmat, n, evtype, nev, TOL::Ref{$TR}, resid::Vector{$T}, ncv, v::Matrix{$T}, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, rwork::Vector{$TR}, info) - ccall(($(string(naupd_name)), :libarpack), Void, + ccall(($(string(naupd_name)), :libarpack), Cvoid, (Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{$TR}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$TR}, Ref{BlasInt}), @@ -274,7 +274,7 @@ for (T, TR, naupd_name, neupd_name) in bmat, n, evtype, nev, TOL::Ref{$TR}, resid::Vector{$T}, ncv, v::Matrix{$T}, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, rwork::Vector{$TR}, info) - ccall(($(string(neupd_name)), :libarpack), Void, + ccall(($(string(neupd_name)), :libarpack), Cvoid, (Ref{BlasInt}, Ptr{UInt8}, Ptr{BlasInt}, Ptr{$T}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ptr{$T}, Ptr{UInt8}, Ref{BlasInt}, Ptr{UInt8}, Ref{BlasInt}, Ptr{$TR}, Ptr{$T}, Ref{BlasInt}, Ptr{$T}, Ref{BlasInt}, diff --git a/stdlib/Mmap/src/Mmap.jl b/stdlib/Mmap/src/Mmap.jl index c4c8d6208b1a1..1b3576e3aebdb 100644 --- a/stdlib/Mmap/src/Mmap.jl +++ b/stdlib/Mmap/src/Mmap.jl @@ -207,18 +207,18 @@ function mmap(io::IO, prot, flags, iswrite = settings(file_desc, shared) iswrite && grow && grow!(io, offset, len) # mmap the file - ptr = ccall(:jl_mmap, Ptr{Void}, (Ptr{Void}, Csize_t, Cint, Cint, Cint, Int64), C_NULL, mmaplen, prot, flags, file_desc, offset_page) + ptr = ccall(:jl_mmap, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Cint, Cint, Cint, Int64), C_NULL, mmaplen, prot, flags, file_desc, offset_page) systemerror("memory mapping failed", reinterpret(Int,ptr) == -1) else name, readonly, create = settings(io) szfile = convert(Csize_t, len + offset) readonly && szfile > filesize(io) && throw(ArgumentError("unable to increase file size to $szfile due to read-only permissions")) - handle = create ? ccall(:CreateFileMappingW, stdcall, Ptr{Void}, (Cptrdiff_t, Ptr{Void}, DWORD, DWORD, DWORD, Cwstring), + handle = create ? ccall(:CreateFileMappingW, stdcall, Ptr{Cvoid}, (Cptrdiff_t, Ptr{Cvoid}, DWORD, DWORD, DWORD, Cwstring), file_desc, C_NULL, readonly ? PAGE_READONLY : PAGE_READWRITE, szfile >> 32, szfile & typemax(UInt32), name) : - ccall(:OpenFileMappingW, stdcall, Ptr{Void}, (DWORD, Cint, Cwstring), + ccall(:OpenFileMappingW, stdcall, Ptr{Cvoid}, (DWORD, Cint, Cwstring), readonly ? FILE_MAP_READ : FILE_MAP_WRITE, true, name) handle == C_NULL && error("could not create file mapping: $(Libc.FormatMessage())") - ptr = ccall(:MapViewOfFile, stdcall, Ptr{Void}, (Ptr{Void}, DWORD, DWORD, DWORD, Csize_t), + ptr = ccall(:MapViewOfFile, stdcall, Ptr{Cvoid}, (Ptr{Cvoid}, DWORD, DWORD, DWORD, Csize_t), handle, readonly ? FILE_MAP_READ : FILE_MAP_WRITE, offset_page >> 32, offset_page & typemax(UInt32), (offset - offset_page) + len) ptr == C_NULL && error("could not create mapping view: $(Libc.FormatMessage())") end # os-test @@ -226,10 +226,10 @@ function mmap(io::IO, A = unsafe_wrap(Array, convert(Ptr{T}, UInt(ptr) + UInt(offset - offset_page)), dims) finalizer(A) do x @static if Sys.isunix() - systemerror("munmap", ccall(:munmap, Cint, (Ptr{Void}, Int), ptr, mmaplen) != 0) + systemerror("munmap", ccall(:munmap, Cint, (Ptr{Cvoid}, Int), ptr, mmaplen) != 0) else - status = ccall(:UnmapViewOfFile, stdcall, Cint, (Ptr{Void},), ptr)!=0 - status |= ccall(:CloseHandle, stdcall, Cint, (Ptr{Void},), handle)!=0 + status = ccall(:UnmapViewOfFile, stdcall, Cint, (Ptr{Cvoid},), ptr)!=0 + status |= ccall(:CloseHandle, stdcall, Cint, (Ptr{Cvoid},), handle)!=0 status || error("could not unmap view: $(Libc.FormatMessage())") end end @@ -339,10 +339,10 @@ function sync!(m::Array{T}, flags::Integer=MS_SYNC) where T ptr = pointer(m) - offset Base.@gc_preserve m @static if Sys.isunix() systemerror("msync", - ccall(:msync, Cint, (Ptr{Void}, Csize_t, Cint), ptr, length(m) * sizeof(T), flags) != 0) + ccall(:msync, Cint, (Ptr{Cvoid}, Csize_t, Cint), ptr, length(m) * sizeof(T), flags) != 0) else systemerror("could not FlushViewOfFile: $(Libc.FormatMessage())", - ccall(:FlushViewOfFile, stdcall, Cint, (Ptr{Void}, Csize_t), ptr, length(m)) == 0) + ccall(:FlushViewOfFile, stdcall, Cint, (Ptr{Cvoid}, Csize_t), ptr, length(m)) == 0) end end sync!(B::BitArray, flags::Integer=MS_SYNC) = sync!(B.chunks, flags) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 0d08942974fb6..0aafb1c0443d5 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -46,7 +46,7 @@ line of code; backtraces generally consist of a long list of instruction pointer settings can be obtained by calling this function with no arguments, and each can be set independently using keywords or in the order `(n, delay)`. """ -function init(; n::Union{Void,Integer} = nothing, delay::Union{Void,Float64} = nothing) +function init(; n::Union{Nothing,Integer} = nothing, delay::Union{Nothing,Float64} = nothing) n_cur = ccall(:jl_profile_maxlen_data, Csize_t, ()) delay_cur = ccall(:jl_profile_delay_nsec, UInt64, ())/10^9 if n === nothing && delay === nothing @@ -77,7 +77,7 @@ end Clear any existing backtraces from the internal buffer. """ -clear() = ccall(:jl_profile_clear_data, Void, ()) +clear() = ccall(:jl_profile_clear_data, Cvoid, ()) const LineInfoDict = Dict{UInt64, Vector{StackFrame}} const LineInfoFlatDict = Dict{UInt64, StackFrame} @@ -273,12 +273,12 @@ Execute the command(s) you want to test (to force JIT-compilation), then call [`clear_malloc_data`](@ref). Then execute your command(s) again, quit Julia, and examine the resulting `*.mem` files. """ -clear_malloc_data() = ccall(:jl_clear_malloc_data, Void, ()) +clear_malloc_data() = ccall(:jl_clear_malloc_data, Cvoid, ()) # C wrappers start_timer() = ccall(:jl_profile_start_timer, Cint, ()) -stop_timer() = ccall(:jl_profile_stop_timer, Void, ()) +stop_timer() = ccall(:jl_profile_stop_timer, Cvoid, ()) is_running() = ccall(:jl_profile_is_running, Cint, ())!=0 @@ -489,7 +489,7 @@ function tree_format(lilist::Vector{StackFrame}, counts::Vector{Int}, level::Int rpad(string(counts[i]), ndigcounts, " "), " ", "unknown function (pointer: 0x", - hex(li.pointer,2*sizeof(Ptr{Void})), + hex(li.pointer,2*sizeof(Ptr{Cvoid})), ")") else fname = string(li.func) diff --git a/stdlib/SharedArrays/test/runtests.jl b/stdlib/SharedArrays/test/runtests.jl index f2ec02a6c65d0..d216e084c0fca 100644 --- a/stdlib/SharedArrays/test/runtests.jl +++ b/stdlib/SharedArrays/test/runtests.jl @@ -235,7 +235,7 @@ map!(x->1, d, d) # Shared arrays of singleton immutables @everywhere struct ShmemFoo end -for T in [Void, ShmemFoo] +for T in [Nothing, ShmemFoo] local s = @inferred(SharedArray{T}(10)) @test T() === remotecall_fetch(x->x[3], workers()[1], s) end diff --git a/stdlib/SuiteSparse/src/cholmod.jl b/stdlib/SuiteSparse/src/cholmod.jl index cef9a4dc21a5d..2c4a7ba535ebd 100644 --- a/stdlib/SuiteSparse/src/cholmod.jl +++ b/stdlib/SuiteSparse/src/cholmod.jl @@ -45,7 +45,7 @@ const common_size = ccall((:jl_cholmod_common_size,:libsuitesparse_wrapper),Int, const cholmod_com_offsets = Vector{Csize_t}(uninitialized, 19) ccall((:jl_cholmod_common_offsets, :libsuitesparse_wrapper), - Void, (Ptr{Csize_t},), cholmod_com_offsets) + Nothing, (Ptr{Csize_t},), cholmod_com_offsets) ## macro to generate the name of the C function according to the integer type macro cholmod_name(nm, typ) @@ -156,11 +156,11 @@ function __init__() # Register gc tracked allocator if CHOLMOD is new enough if current_version >= v"3.0.0" - cnfg = cglobal((:SuiteSparse_config, :libsuitesparseconfig), Ptr{Void}) - unsafe_store!(cnfg, cglobal(:jl_malloc, Ptr{Void}), 1) - unsafe_store!(cnfg, cglobal(:jl_calloc, Ptr{Void}), 2) - unsafe_store!(cnfg, cglobal(:jl_realloc, Ptr{Void}), 3) - unsafe_store!(cnfg, cglobal(:jl_free, Ptr{Void}), 4) + cnfg = cglobal((:SuiteSparse_config, :libsuitesparseconfig), Ptr{Cvoid}) + unsafe_store!(cnfg, cglobal(:jl_malloc, Ptr{Cvoid}), 1) + unsafe_store!(cnfg, cglobal(:jl_calloc, Ptr{Cvoid}), 2) + unsafe_store!(cnfg, cglobal(:jl_realloc, Ptr{Cvoid}), 3) + unsafe_store!(cnfg, cglobal(:jl_free, Ptr{Cvoid}), 4) end catch ex @@ -190,7 +190,7 @@ struct C_Dense{T<:VTypes} <: SuiteSparseStruct nzmax::Csize_t d::Csize_t x::Ptr{T} - z::Ptr{Void} + z::Ptr{Cvoid} xtype::Cint dtype::Cint end @@ -218,7 +218,7 @@ struct C_Sparse{Tv<:VTypes} <: SuiteSparseStruct i::Ptr{SuiteSparse_long} nz::Ptr{SuiteSparse_long} x::Ptr{Tv} - z::Ptr{Void} + z::Ptr{Cvoid} stype::Cint itype::Cint xtype::Cint @@ -234,11 +234,11 @@ struct C_SparseVoid <: SuiteSparseStruct nrow::Csize_t ncol::Csize_t nzmax::Csize_t - p::Ptr{Void} - i::Ptr{Void} - nz::Ptr{Void} - x::Ptr{Void} - z::Ptr{Void} + p::Ptr{Cvoid} + i::Ptr{Cvoid} + nz::Ptr{Cvoid} + x::Ptr{Cvoid} + z::Ptr{Cvoid} stype::Cint itype::Cint xtype::Cint @@ -276,7 +276,7 @@ if build_version >= v"2.1.0" # CHOLMOD version 2.1.0 or later p::Ptr{SuiteSparse_long} i::Ptr{SuiteSparse_long} x::Ptr{Tv} - z::Ptr{Void} + z::Ptr{Cvoid} nz::Ptr{SuiteSparse_long} next::Ptr{SuiteSparse_long} prev::Ptr{SuiteSparse_long} @@ -307,7 +307,7 @@ else p::Ptr{SuiteSparse_long} i::Ptr{SuiteSparse_long} x::Ptr{Tv} - z::Ptr{Void} + z::Ptr{Cvoid} nz::Ptr{SuiteSparse_long} next::Ptr{SuiteSparse_long} prev::Ptr{SuiteSparse_long} @@ -397,17 +397,17 @@ Factor(FC::FactorComponent) = Factor(FC.F) ### cholmod_core_h ### function allocate_dense(nrow::Integer, ncol::Integer, d::Integer, ::Type{Float64}) Dense(ccall((:cholmod_l_allocate_dense, :libcholmod), Ptr{C_Dense{Float64}}, - (Csize_t, Csize_t, Csize_t, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Ptr{Cvoid}), nrow, ncol, d, REAL, common_struct)) end function allocate_dense(nrow::Integer, ncol::Integer, d::Integer, ::Type{Complex{Float64}}) Dense(ccall((:cholmod_l_allocate_dense, :libcholmod), Ptr{C_Dense{Complex{Float64}}}, - (Csize_t, Csize_t, Csize_t, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Ptr{Cvoid}), nrow, ncol, d, COMPLEX, common_struct)) end free_dense!(p::Ptr{C_Dense{T}}) where {T} = ccall((:cholmod_l_free_dense, :libcholmod), - Cint, (Ref{Ptr{C_Dense{T}}}, Ptr{Void}), p, common_struct) + Cint, (Ref{Ptr{C_Dense{T}}}, Ptr{Cvoid}), p, common_struct) function zeros(m::Integer, n::Integer, ::Type{T}) where T<:VTypes Dense(ccall((:cholmod_l_zeros, :libcholmod), Ptr{C_Dense{T}}, @@ -473,7 +473,7 @@ function allocate_sparse(nrow::Integer, ncol::Integer, nzmax::Integer, Sparse(ccall((@cholmod_name("allocate_sparse", SuiteSparse_long), :libcholmod), Ptr{C_Sparse{Float64}}, (Csize_t, Csize_t, Csize_t, Cint, - Cint, Cint, Cint, Ptr{Void}), + Cint, Cint, Cint, Ptr{Cvoid}), nrow, ncol, nzmax, sorted, packed, stype, REAL, common_struct)) end @@ -482,7 +482,7 @@ function allocate_sparse(nrow::Integer, ncol::Integer, nzmax::Integer, Sparse(ccall((@cholmod_name("allocate_sparse", SuiteSparse_long), :libcholmod), Ptr{C_Sparse{Complex{Float64}}}, (Csize_t, Csize_t, Csize_t, Cint, - Cint, Cint, Cint, Ptr{Void}), + Cint, Cint, Cint, Ptr{Cvoid}), nrow, ncol, nzmax, sorted, packed, stype, COMPLEX, common_struct)) end @@ -501,7 +501,7 @@ end function free_factor!(ptr::Ptr{C_Factor{Tv}}) where Tv<:VTypes # Warning! Important that finalizer doesn't modify the global Common struct. @isok ccall((@cholmod_name("free_factor", SuiteSparse_long), :libcholmod), Cint, - (Ref{Ptr{C_Factor{Tv}}}, Ptr{Void}), + (Ref{Ptr{C_Factor{Tv}}}, Ptr{Cvoid}), ptr, common_struct) end @@ -792,7 +792,7 @@ end function read_sparse(file::Libc.FILE, ::Type{SuiteSparse_long}) ptr = ccall((@cholmod_name("read_sparse", SuiteSparse_long), :libcholmod), Ptr{C_SparseVoid}, - (Ptr{Void}, Ptr{UInt8}), + (Ptr{Cvoid}, Ptr{UInt8}), file.ptr, common_struct) if ptr == C_NULL throw(ArgumentError("sparse matrix construction failed. Check that input file is valid.")) @@ -1558,7 +1558,7 @@ function lowrankupdowndate!(F::Factor{Tv}, C::Sparse{Tv}, update::Cint) where Tv throw(DimensionMismatch("matrix dimensions do not fit")) end @isok ccall((:cholmod_l_updown, :libcholmod), Cint, - (Cint, Ptr{C_Sparse{Tv}}, Ptr{C_Factor{Tv}}, Ptr{Void}), + (Cint, Ptr{C_Sparse{Tv}}, Ptr{C_Factor{Tv}}, Ptr{Cvoid}), update, C, F, common_struct) F end diff --git a/stdlib/SuiteSparse/src/spqr.jl b/stdlib/SuiteSparse/src/spqr.jl index c675839baef6d..91af7eacc3eff 100644 --- a/stdlib/SuiteSparse/src/spqr.jl +++ b/stdlib/SuiteSparse/src/spqr.jl @@ -28,15 +28,15 @@ using ..SuiteSparse.CHOLMOD: change_stype!, free! function _qr!(ordering::Integer, tol::Real, econ::Integer, getCTX::Integer, A::Sparse{Tv}, - Bsparse::Union{Sparse{Tv} , Ptr{Void}} = C_NULL, - Bdense::Union{Dense{Tv} , Ptr{Void}} = C_NULL, - Zsparse::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Void}} = C_NULL, - Zdense::Union{Ref{Ptr{CHOLMOD.C_Dense{Tv}}} , Ptr{Void}} = C_NULL, - R::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Void}} = C_NULL, - E::Union{Ref{Ptr{CHOLMOD.SuiteSparse_long}} , Ptr{Void}} = C_NULL, - H::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Void}} = C_NULL, - HPinv::Union{Ref{Ptr{CHOLMOD.SuiteSparse_long}}, Ptr{Void}} = C_NULL, - HTau::Union{Ref{Ptr{CHOLMOD.C_Dense{Tv}}} , Ptr{Void}} = C_NULL) where {Tv<:CHOLMOD.VTypes} + Bsparse::Union{Sparse{Tv} , Ptr{Cvoid}} = C_NULL, + Bdense::Union{Dense{Tv} , Ptr{Cvoid}} = C_NULL, + Zsparse::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Cvoid}} = C_NULL, + Zdense::Union{Ref{Ptr{CHOLMOD.C_Dense{Tv}}} , Ptr{Cvoid}} = C_NULL, + R::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Cvoid}} = C_NULL, + E::Union{Ref{Ptr{CHOLMOD.SuiteSparse_long}} , Ptr{Cvoid}} = C_NULL, + H::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Cvoid}} = C_NULL, + HPinv::Union{Ref{Ptr{CHOLMOD.SuiteSparse_long}}, Ptr{Cvoid}} = C_NULL, + HTau::Union{Ref{Ptr{CHOLMOD.C_Dense{Tv}}} , Ptr{Cvoid}} = C_NULL) where {Tv<:CHOLMOD.VTypes} AA = unsafe_load(pointer(A)) m, n = AA.nrow, AA.ncol @@ -45,7 +45,7 @@ function _qr!(ordering::Integer, tol::Real, econ::Integer, getCTX::Integer, Ptr{CHOLMOD.C_Sparse{Tv}}, Ptr{CHOLMOD.C_Sparse{Tv}}, Ptr{CHOLMOD.C_Dense{Tv}}, Ptr{Ptr{CHOLMOD.C_Sparse{Tv}}}, Ptr{Ptr{CHOLMOD.C_Dense{Tv}}}, Ptr{Ptr{CHOLMOD.C_Sparse{Tv}}}, Ptr{Ptr{CHOLMOD.SuiteSparse_long}}, Ptr{Ptr{CHOLMOD.C_Sparse{Tv}}}, Ptr{Ptr{CHOLMOD.SuiteSparse_long}}, - Ptr{Ptr{CHOLMOD.C_Dense{Tv}}}, Ptr{Void}), + Ptr{Ptr{CHOLMOD.C_Dense{Tv}}}, Ptr{Cvoid}), ordering, # all, except 3:given treated as 0:fixed tol, # columns with 2-norm <= tol treated as 0 econ, # e = max(min(m,econ),rank(A)) @@ -78,8 +78,8 @@ function _qr!(ordering::Integer, tol::Real, econ::Integer, getCTX::Integer, # Free memory allocated by SPQR. This call will make sure that the # correct deallocator function is called and that the memory count in # the common struct is updated - ccall((:cholmod_l_free, :libcholmod), Void, - (Csize_t, Cint, Ptr{CHOLMOD.SuiteSparse_long}, Ptr{Void}), + ccall((:cholmod_l_free, :libcholmod), Cvoid, + (Csize_t, Cint, Ptr{CHOLMOD.SuiteSparse_long}, Ptr{Cvoid}), n, sizeof(CHOLMOD.SuiteSparse_long), e, CHOLMOD.common_struct) end hpinv = HPinv[] @@ -93,8 +93,8 @@ function _qr!(ordering::Integer, tol::Real, econ::Integer, getCTX::Integer, # Free memory allocated by SPQR. This call will make sure that the # correct deallocator function is called and that the memory count in # the common struct is updated - ccall((:cholmod_l_free, :libcholmod), Void, - (Csize_t, Cint, Ptr{CHOLMOD.SuiteSparse_long}, Ptr{Void}), + ccall((:cholmod_l_free, :libcholmod), Cvoid, + (Csize_t, Cint, Ptr{CHOLMOD.SuiteSparse_long}, Ptr{Cvoid}), m, sizeof(CHOLMOD.SuiteSparse_long), hpinv, CHOLMOD.common_struct) end diff --git a/stdlib/SuiteSparse/src/umfpack.jl b/stdlib/SuiteSparse/src/umfpack.jl index cd54d8ff6be75..4ccaa0c412228 100644 --- a/stdlib/SuiteSparse/src/umfpack.jl +++ b/stdlib/SuiteSparse/src/umfpack.jl @@ -75,28 +75,28 @@ const UMFVTypes = Union{Float64,ComplexF64} # the control and info arrays const umf_ctrl = Vector{Float64}(uninitialized, UMFPACK_CONTROL) -ccall((:umfpack_dl_defaults,:libumfpack), Void, (Ptr{Float64},), umf_ctrl) +ccall((:umfpack_dl_defaults,:libumfpack), Cvoid, (Ptr{Float64},), umf_ctrl) const umf_info = Vector{Float64}(uninitialized, UMFPACK_INFO) function show_umf_ctrl(level::Real = 2.0) old_prt::Float64 = umf_ctrl[1] umf_ctrl[1] = Float64(level) - ccall((:umfpack_dl_report_control, :libumfpack), Void, (Ptr{Float64},), umf_ctrl) + ccall((:umfpack_dl_report_control, :libumfpack), Cvoid, (Ptr{Float64},), umf_ctrl) umf_ctrl[1] = old_prt end function show_umf_info(level::Real = 2.0) old_prt::Float64 = umf_ctrl[1] umf_ctrl[1] = Float64(level) - ccall((:umfpack_dl_report_info, :libumfpack), Void, + ccall((:umfpack_dl_report_info, :libumfpack), Cvoid, (Ptr{Float64}, Ptr{Float64}), umf_ctrl, umf_info) umf_ctrl[1] = old_prt end ## Should this type be immutable? mutable struct UmfpackLU{Tv<:UMFVTypes,Ti<:UMFITypes} <: Factorization{Tv} - symbolic::Ptr{Void} - numeric::Ptr{Void} + symbolic::Ptr{Cvoid} + numeric::Ptr{Cvoid} m::Int n::Int colptr::Vector{Ti} # 0-based column pointers @@ -200,9 +200,9 @@ for itype in UmfpackIndexTypes @eval begin function umfpack_symbolic!(U::UmfpackLU{Float64,$itype}) if U.symbolic != C_NULL return U end - tmp = Vector{Ptr{Void}}(uninitialized, 1) + tmp = Vector{Ptr{Cvoid}}(uninitialized, 1) @isok ccall(($sym_r, :libumfpack), $itype, - ($itype, $itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Void}, + ($itype, $itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), U.m, U.n, U.colptr, U.rowval, U.nzval, tmp, umf_ctrl, umf_info) @@ -211,9 +211,9 @@ for itype in UmfpackIndexTypes end function umfpack_symbolic!(U::UmfpackLU{ComplexF64,$itype}) if U.symbolic != C_NULL return U end - tmp = Vector{Ptr{Void}}(uninitialized, 1) + tmp = Vector{Ptr{Cvoid}}(uninitialized, 1) @isok ccall(($sym_c, :libumfpack), $itype, - ($itype, $itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Void}, + ($itype, $itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), U.m, U.n, U.colptr, U.rowval, real(U.nzval), imag(U.nzval), tmp, umf_ctrl, umf_info) @@ -223,9 +223,9 @@ for itype in UmfpackIndexTypes function umfpack_numeric!(U::UmfpackLU{Float64,$itype}) if U.numeric != C_NULL return U end if U.symbolic == C_NULL umfpack_symbolic!(U) end - tmp = Vector{Ptr{Void}}(uninitialized, 1) + tmp = Vector{Ptr{Cvoid}}(uninitialized, 1) status = ccall(($num_r, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Void}, Ptr{Void}, + (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), U.colptr, U.rowval, U.nzval, U.symbolic, tmp, umf_ctrl, umf_info) @@ -238,9 +238,9 @@ for itype in UmfpackIndexTypes function umfpack_numeric!(U::UmfpackLU{ComplexF64,$itype}) if U.numeric != C_NULL return U end if U.symbolic == C_NULL umfpack_symbolic!(U) end - tmp = Vector{Ptr{Void}}(uninitialized, 1) + tmp = Vector{Ptr{Cvoid}}(uninitialized, 1) status = ccall(($num_c, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Void}, Ptr{Void}, + (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), U.colptr, U.rowval, real(U.nzval), imag(U.nzval), U.symbolic, tmp, umf_ctrl, umf_info) @@ -261,7 +261,7 @@ for itype in UmfpackIndexTypes (size(b,1) == lu.m) && (size(b) == size(x)) || throw(DimensionMismatch()) @isok ccall(($sol_r, :libumfpack), $itype, ($itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{Float64}, Ptr{Float64}, Ptr{Void}, Ptr{Float64}, + Ptr{Float64}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), typ, lu.colptr, lu.rowval, lu.nzval, x, b, lu.numeric, umf_ctrl, @@ -281,7 +281,7 @@ for itype in UmfpackIndexTypes @isok ccall(($sol_c, :libumfpack), $itype, ($itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, - Ptr{Float64}, Ptr{Void}, Ptr{Float64}, Ptr{Float64}), + Ptr{Float64}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), typ, lu.colptr, lu.rowval, lu.nzval, C_NULL, x, C_NULL, b, C_NULL, lu.numeric, umf_ctrl, umf_info) @@ -290,7 +290,7 @@ for itype in UmfpackIndexTypes function det(lu::UmfpackLU{Float64,$itype}) mx = Ref{Float64}() @isok ccall(($det_r,:libumfpack), $itype, - (Ptr{Float64},Ptr{Float64},Ptr{Void},Ptr{Float64}), + (Ptr{Float64},Ptr{Float64},Ptr{Cvoid},Ptr{Float64}), mx, C_NULL, lu.numeric, umf_info) mx[] end @@ -298,7 +298,7 @@ for itype in UmfpackIndexTypes mx = Ref{Float64}() mz = Ref{Float64}() @isok ccall(($det_z,:libumfpack), $itype, - (Ptr{Float64},Ptr{Float64},Ptr{Float64},Ptr{Void},Ptr{Float64}), + (Ptr{Float64},Ptr{Float64},Ptr{Float64},Ptr{Cvoid},Ptr{Float64}), mx, mz, C_NULL, lu.numeric, umf_info) complex(mx[], mz[]) end @@ -309,7 +309,7 @@ for itype in UmfpackIndexTypes n_col = Ref{$itype}() nz_diag = Ref{$itype}() @isok ccall(($lunz_r,:libumfpack), $itype, - (Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{Void}), + (Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{Cvoid}), lnz, unz, n_row, n_col, nz_diag, lu.numeric) (lnz[], unz[], n_row[], n_col[], nz_diag[]) end @@ -320,7 +320,7 @@ for itype in UmfpackIndexTypes n_col = Ref{$itype}() nz_diag = Ref{$itype}() @isok ccall(($lunz_z,:libumfpack), $itype, - (Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{Void}), + (Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{Cvoid}), lnz, unz, n_row, n_col, nz_diag, lu.numeric) (lnz[], unz[], n_row[], n_col[], nz_diag[]) end @@ -339,8 +339,8 @@ for itype in UmfpackIndexTypes @isok ccall(($get_num_r,:libumfpack), $itype, (Ptr{$itype},Ptr{$itype},Ptr{Float64}, Ptr{$itype},Ptr{$itype},Ptr{Float64}, - Ptr{$itype},Ptr{$itype},Ptr{Void}, - Ref{$itype},Ptr{Float64},Ptr{Void}), + Ptr{$itype},Ptr{$itype},Ptr{Cvoid}, + Ref{$itype},Ptr{Float64},Ptr{Cvoid}), Lp,Lj,Lx, Up,Ui,Ux, P, Q, C_NULL, @@ -366,8 +366,8 @@ for itype in UmfpackIndexTypes @isok ccall(($get_num_z,:libumfpack), $itype, (Ptr{$itype},Ptr{$itype},Ptr{Float64},Ptr{Float64}, Ptr{$itype},Ptr{$itype},Ptr{Float64},Ptr{Float64}, - Ptr{$itype},Ptr{$itype},Ptr{Void}, Ptr{Void}, - Ref{$itype},Ptr{Float64},Ptr{Void}), + Ptr{$itype},Ptr{$itype},Ptr{Cvoid}, Ptr{Cvoid}, + Ref{$itype},Ptr{Float64},Ptr{Cvoid}), Lp,Lj,Lx,Lz, Up,Ui,Ux,Uz, P, Q, C_NULL, C_NULL, @@ -469,9 +469,9 @@ end for Tv in (:Float64, :ComplexF64), Ti in UmfpackIndexTypes f = Symbol(umf_nm("free_symbolic", Tv, Ti)) @eval begin - function ($f)(symb::Ptr{Void}) + function ($f)(symb::Ptr{Cvoid}) tmp = [symb] - ccall(($(string(f)), :libumfpack), Void, (Ptr{Void},), tmp) + ccall(($(string(f)), :libumfpack), Cvoid, (Ptr{Cvoid},), tmp) end function umfpack_free_symbolic(lu::UmfpackLU{$Tv,$Ti}) @@ -485,9 +485,9 @@ for Tv in (:Float64, :ComplexF64), Ti in UmfpackIndexTypes f = Symbol(umf_nm("free_numeric", Tv, Ti)) @eval begin - function ($f)(num::Ptr{Void}) + function ($f)(num::Ptr{Cvoid}) tmp = [num] - ccall(($(string(f)), :libumfpack), Void, (Ptr{Void},), tmp) + ccall(($(string(f)), :libumfpack), Cvoid, (Ptr{Cvoid},), tmp) end function umfpack_free_numeric(lu::UmfpackLU{$Tv,$Ti}) if lu.numeric == C_NULL return lu end @@ -498,30 +498,30 @@ for Tv in (:Float64, :ComplexF64), Ti in UmfpackIndexTypes end end -function umfpack_report_symbolic(symb::Ptr{Void}, level::Real) +function umfpack_report_symbolic(symb::Ptr{Cvoid}, level::Real) old_prl::Float64 = umf_ctrl[UMFPACK_PRL] umf_ctrl[UMFPACK_PRL] = Float64(level) @isok ccall((:umfpack_dl_report_symbolic, :libumfpack), Int, - (Ptr{Void}, Ptr{Float64}), symb, umf_ctrl) + (Ptr{Cvoid}, Ptr{Float64}), symb, umf_ctrl) umf_ctrl[UMFPACK_PRL] = old_prl end -umfpack_report_symbolic(symb::Ptr{Void}) = umfpack_report_symbolic(symb, 4.) +umfpack_report_symbolic(symb::Ptr{Cvoid}) = umfpack_report_symbolic(symb, 4.) function umfpack_report_symbolic(lu::UmfpackLU, level::Real) umfpack_report_symbolic(umfpack_symbolic!(lu).symbolic, level) end umfpack_report_symbolic(lu::UmfpackLU) = umfpack_report_symbolic(lu.symbolic,4.) -function umfpack_report_numeric(num::Ptr{Void}, level::Real) +function umfpack_report_numeric(num::Ptr{Cvoid}, level::Real) old_prl::Float64 = umf_ctrl[UMFPACK_PRL] umf_ctrl[UMFPACK_PRL] = Float64(level) @isok ccall((:umfpack_dl_report_numeric, :libumfpack), Int, - (Ptr{Void}, Ptr{Float64}), num, umf_ctrl) + (Ptr{Cvoid}, Ptr{Float64}), num, umf_ctrl) umf_ctrl[UMFPACK_PRL] = old_prl end -umfpack_report_numeric(num::Ptr{Void}) = umfpack_report_numeric(num, 4.) +umfpack_report_numeric(num::Ptr{Cvoid}) = umfpack_report_numeric(num, 4.) function umfpack_report_numeric(lu::UmfpackLU, level::Real) umfpack_report_numeric(umfpack_numeric!(lu).numeric, level) end diff --git a/stdlib/SuiteSparse/test/cholmod.jl b/stdlib/SuiteSparse/test/cholmod.jl index 9ebaf1c2c8963..46f7a6ae33b22 100644 --- a/stdlib/SuiteSparse/test/cholmod.jl +++ b/stdlib/SuiteSparse/test/cholmod.jl @@ -227,46 +227,46 @@ end ## The struct pointer must be constructed by the library constructor and then modified afterwards to checks that the method throws @testset "illegal dtype (for now but should be supported at some point)" begin p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_SparseVoid}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Cvoid}), 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common_struct) puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, CHOLMOD.SINGLE, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Void}), 4) + 4) + unsafe_store!(puint, CHOLMOD.SINGLE, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 4) @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) end @testset "illegal dtype" begin p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_SparseVoid}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Cvoid}), 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common_struct) puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, 5, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Void}), 4) + 4) + unsafe_store!(puint, 5, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 4) @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) end @testset "illegal xtype" begin p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_SparseVoid}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Cvoid}), 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common_struct) puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, 3, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Void}), 4) + 3) + unsafe_store!(puint, 3, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 3) @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) end @testset "illegal itype I" begin p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_SparseVoid}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Cvoid}), 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common_struct) puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, CHOLMOD.INTLONG, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Void}), 4) + 2) + unsafe_store!(puint, CHOLMOD.INTLONG, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 2) @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) end @testset "illegal itype II" begin p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_SparseVoid}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Cvoid}), 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common_struct) puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, 5, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Void}), 4) + 2) + unsafe_store!(puint, 5, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 2) @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) end @@ -314,7 +314,7 @@ end # Test Sparse and Factor @testset "test free_sparse!" begin p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Float64}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Void}), + (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{Cvoid}), 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common_struct) @test CHOLMOD.free_sparse!(p) end diff --git a/stdlib/Test/src/Test.jl b/stdlib/Test/src/Test.jl index c7babe9bd5b70..e3383937910d5 100644 --- a/stdlib/Test/src/Test.jl +++ b/stdlib/Test/src/Test.jl @@ -1268,7 +1268,7 @@ function detect_ambiguities(mods...; imported::Bool = false, recursive::Bool = false, ambiguous_bottom::Bool = false, - allow_bottom::Union{Bool,Void} = nothing) + allow_bottom::Union{Bool,Nothing} = nothing) if allow_bottom !== nothing Base.depwarn("the `allow_bottom` keyword to detect_ambiguities has been renamed to `ambiguous_bottom`", :detect_ambiguities) ambiguous_bottom = allow_bottom diff --git a/stdlib/Test/src/logging.jl b/stdlib/Test/src/logging.jl index 232232fbb9a0d..845ca92ff1d39 100644 --- a/stdlib/Test/src/logging.jl +++ b/stdlib/Test/src/logging.jl @@ -57,7 +57,7 @@ end # Failure result type for log testing mutable struct LogTestFailure <: Result orig_expr - source::Union{Void,LineNumberNode} + source::Union{Nothing,LineNumberNode} patterns logs end diff --git a/stdlib/Unicode/test/runtests.jl b/stdlib/Unicode/test/runtests.jl index bcf3943c8b423..dacf266ccbaef 100644 --- a/stdlib/Unicode/test/runtests.jl +++ b/stdlib/Unicode/test/runtests.jl @@ -392,4 +392,4 @@ end @test one(String) == "" @test prod(["*" for i in 1:3]) == "***" @test prod(["*" for i in 1:0]) == "" -end \ No newline at end of file +end diff --git a/test/ambiguous.jl b/test/ambiguous.jl index a1e6f405d8368..b9532891ca558 100644 --- a/test/ambiguous.jl +++ b/test/ambiguous.jl @@ -288,8 +288,8 @@ end pop!(need_to_handle_undef_sparam, which(Base.one, Tuple{Type{Union{Missing, T}} where T})) pop!(need_to_handle_undef_sparam, which(Base.oneunit, Tuple{Type{Union{Missing, T}} where T})) pop!(need_to_handle_undef_sparam, which(Base.nonmissingtype, Tuple{Type{Union{Missing, T}} where T})) - pop!(need_to_handle_undef_sparam, which(Base.convert, (Type{Union{Some{T}, Void}} where T, Some))) - pop!(need_to_handle_undef_sparam, which(Base.convert, (Type{Union{T, Void}} where T, Some))) + pop!(need_to_handle_undef_sparam, which(Base.convert, (Type{Union{Some{T}, Nothing}} where T, Some))) + pop!(need_to_handle_undef_sparam, which(Base.convert, (Type{Union{T, Nothing}} where T, Some))) @test need_to_handle_undef_sparam == Set() end end diff --git a/test/arrayops.jl b/test/arrayops.jl index 6d1920276e0c2..547f7bf2f65b5 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -2094,7 +2094,7 @@ end end @testset "type constructor Array{T, N}(nothing, d...) works (especially for N>3)" for T in (Int, String), - U in (Void, Missing) + U in (Nothing, Missing) a = Array{Union{T, U}}(U(), 10) b = Vector{Union{T, U}}(U(), 10) @test size(a) == size(b) == (10,) diff --git a/test/ccall.jl b/test/ccall.jl index 1ca337c6ec262..b6d30cdae817d 100644 --- a/test/ccall.jl +++ b/test/ccall.jl @@ -5,7 +5,7 @@ import Base.copy, Base.== const libccalltest = "libccalltest" const verbose = false -ccall((:set_verbose, libccalltest), Void, (Int32,), verbose) +ccall((:set_verbose, libccalltest), Cvoid, (Int32,), verbose) # Test for proper argument register truncation @@ -84,7 +84,7 @@ let a, ci_ary, x x = ccall((:cptest_static, libccalltest), Ptr{Complex{Int}}, (Ref{Complex{Int}},), a) @test unsafe_load(x) == a - Libc.free(convert(Ptr{Void}, x)) + Libc.free(convert(Ptr{Cvoid}, x)) end let a, b, x @@ -844,7 +844,7 @@ foo13031p = cfunction(foo13031, Cint, Tuple{Ref{Tuple{}}, Ref{Tuple{}}, Cint}) ccall(foo13031p, Cint, (Ref{Tuple{}},Ref{Tuple{}},Cint), (), (), 8) # issue 17219 -function ccall_reassigned_ptr(ptr::Ptr{Void}) +function ccall_reassigned_ptr(ptr::Ptr{Cvoid}) ptr = Libdl.dlsym(Libdl.dlopen(libccalltest), "test_echo_p") ccall(ptr, Any, (Any,), "foo") end @@ -879,15 +879,15 @@ end # Pointer finalizer (issue #15408) let A = [1] - ccall((:set_c_int, libccalltest), Void, (Cint,), 1) + ccall((:set_c_int, libccalltest), Cvoid, (Cint,), 1) @test ccall((:get_c_int, libccalltest), Cint, ()) == 1 - finalizer(cglobal((:finalizer_cptr, libccalltest), Void), A) + finalizer(cglobal((:finalizer_cptr, libccalltest), Cvoid), A) finalize(A) @test ccall((:get_c_int, libccalltest), Cint, ()) == -1 end # Pointer finalizer at exit (PR #19911) -let result = read(`$(Base.julia_cmd()) --startup-file=no -e "A = Ref{Cint}(42); finalizer(cglobal((:c_exit_finalizer, \"$libccalltest\"), Void), A)"`, String) +let result = read(`$(Base.julia_cmd()) --startup-file=no -e "A = Ref{Cint}(42); finalizer(cglobal((:c_exit_finalizer, \"$libccalltest\"), Cvoid), A)"`, String) @test result == "c_exit_finalizer: 42, 0" end @@ -1150,9 +1150,9 @@ end # Do not put these in a function. @noinline g17413() = rand() @inline f17413() = (g17413(); g17413()) -ccall((:test_echo_p, libccalltest), Ptr{Void}, (Any,), f17413()) +ccall((:test_echo_p, libccalltest), Ptr{Cvoid}, (Any,), f17413()) for i in 1:3 - ccall((:test_echo_p, libccalltest), Ptr{Void}, (Any,), f17413()) + ccall((:test_echo_p, libccalltest), Ptr{Cvoid}, (Any,), f17413()) end struct SpillPint @@ -1238,11 +1238,11 @@ end # issue #20835 @test_throws(ErrorException("could not evaluate ccall argument type (it might depend on a local variable)"), - eval(:(f20835(x) = ccall(:fn, Void, (Ptr{typeof(x)},), x)))) + eval(:(f20835(x) = ccall(:fn, Cvoid, (Ptr{typeof(x)},), x)))) @test_throws(UndefVarError(:Something_not_defined_20835), eval(:(f20835(x) = ccall(:fn, Something_not_defined_20835, (Ptr{typeof(x)},), x)))) -@noinline f21104at(::Type{T}) where {T} = ccall(:fn, Void, (Some{T},), Some(0)) +@noinline f21104at(::Type{T}) where {T} = ccall(:fn, Cvoid, (Some{T},), Some(0)) @noinline f21104rt(::Type{T}) where {T} = ccall(:fn, Some{T}, ()) @test code_llvm(DevNull, f21104at, (Type{Float64},)) === nothing @test code_llvm(DevNull, f21104rt, (Type{Float64},)) === nothing @@ -1291,12 +1291,12 @@ struct Bits22734 <: Abstract22734 x::Int y::Float64 end -function cb22734(ptr::Ptr{Void}) +function cb22734(ptr::Ptr{Cvoid}) gc() obj = unsafe_pointer_to_objref(ptr)::Bits22734 obj.x + obj.y end -ptr22734 = cfunction(cb22734, Float64, Tuple{Ptr{Void}}) +ptr22734 = cfunction(cb22734, Float64, Tuple{Ptr{Cvoid}}) function caller22734(ptr) obj = Bits22734(12, 20) ccall(ptr, Float64, (Ref{Abstract22734},), obj) diff --git a/test/channels.jl b/test/channels.jl index e70fe0b679189..fceab79ead5c1 100644 --- a/test/channels.jl +++ b/test/channels.jl @@ -320,17 +320,17 @@ let tc = Ref(0), tc[] += 1 end @test isopen(async) - ccall(:uv_async_send, Void, (Ptr{Void},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) Base.process_events(false) # schedule event - ccall(:uv_async_send, Void, (Ptr{Void},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) Sys.iswindows() && Base.process_events(false) # schedule event (windows?) @test tc[] == 0 yield() # consume event @test tc[] == 1 sleep(0.1) # no further events @test tc[] == 1 - ccall(:uv_async_send, Void, (Ptr{Void},), async) - ccall(:uv_async_send, Void, (Ptr{Void},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) close(async) @test !isopen(async) @test tc[] == 1 @@ -346,7 +346,7 @@ let tc = Ref(0), tc[] += 1 end @test isopen(async) - ccall(:uv_async_send, Void, (Ptr{Void},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) close(async) @test !isopen(async) Base.process_events(false) # schedule event & then close diff --git a/test/codegen.jl b/test/codegen.jl index 2937e80593118..73ed5ed3d9697 100644 --- a/test/codegen.jl +++ b/test/codegen.jl @@ -58,9 +58,9 @@ function test_jl_dump_compiles() tfile = tempname() io = open(tfile, "w") @eval(test_jl_dump_compiles_internal(x) = x) - ccall(:jl_dump_compiles, Void, (Ptr{Void},), io.handle) + ccall(:jl_dump_compiles, Cvoid, (Ptr{Cvoid},), io.handle) @eval test_jl_dump_compiles_internal(1) - ccall(:jl_dump_compiles, Void, (Ptr{Void},), C_NULL) + ccall(:jl_dump_compiles, Cvoid, (Ptr{Cvoid},), C_NULL) close(io) tstats = stat(tfile) tempty = tstats.size == 0 @@ -74,9 +74,9 @@ function test_jl_dump_compiles_toplevel_thunks() tfile = tempname() io = open(tfile, "w") topthunk = Meta.lower(Main, :(for i in 1:10; end)) - ccall(:jl_dump_compiles, Void, (Ptr{Void},), io.handle) + ccall(:jl_dump_compiles, Cvoid, (Ptr{Cvoid},), io.handle) Core.eval(Main, topthunk) - ccall(:jl_dump_compiles, Void, (Ptr{Void},), C_NULL) + ccall(:jl_dump_compiles, Cvoid, (Ptr{Cvoid},), C_NULL) close(io) tstats = stat(tfile) tempty = tstats.size == 0 @@ -136,7 +136,7 @@ mutable struct MutableStruct MutableStruct() = new() end -breakpoint_mutable(a::MutableStruct) = ccall(:jl_breakpoint, Void, (Ref{MutableStruct},), a) +breakpoint_mutable(a::MutableStruct) = ccall(:jl_breakpoint, Cvoid, (Ref{MutableStruct},), a) # Allocation with uninitialized field as gcroot mutable struct BadRef @@ -147,10 +147,10 @@ end Base.cconvert(::Type{Ptr{BadRef}}, a::MutableStruct) = BadRef(a) Base.unsafe_convert(::Type{Ptr{BadRef}}, ar::BadRef) = Ptr{BadRef}(pointer_from_objref(ar.x)) -breakpoint_badref(a::MutableStruct) = ccall(:jl_breakpoint, Void, (Ptr{BadRef},), a) +breakpoint_badref(a::MutableStruct) = ccall(:jl_breakpoint, Cvoid, (Ptr{BadRef},), a) struct PtrStruct - a::Ptr{Void} + a::Ptr{Cvoid} b::Int end @@ -166,7 +166,7 @@ Base.unsafe_convert(::Type{Ref{PtrStruct}}, at::Tuple) = Base.unsafe_convert(Ref{PtrStruct}, at[2]) breakpoint_ptrstruct(a::RealStruct) = - ccall(:jl_breakpoint, Void, (Ref{PtrStruct},), a) + ccall(:jl_breakpoint, Cvoid, (Ref{PtrStruct},), a) if opt_level > 0 @test !contains(get_llvm(pointer_not_safepoint, Tuple{}), "%gcframe") @@ -189,8 +189,8 @@ if opt_level > 0 end function two_breakpoint(a::Float64) - ccall(:jl_breakpoint, Void, (Ref{Float64},), a) - ccall(:jl_breakpoint, Void, (Ref{Float64},), a) + ccall(:jl_breakpoint, Cvoid, (Ref{Float64},), a) + ccall(:jl_breakpoint, Cvoid, (Ref{Float64},), a) end function load_dummy_ref(x::Int) @@ -201,10 +201,10 @@ function load_dummy_ref(x::Int) end if opt_level > 0 - breakpoint_f64_ir = get_llvm((a)->ccall(:jl_breakpoint, Void, (Ref{Float64},), a), + breakpoint_f64_ir = get_llvm((a)->ccall(:jl_breakpoint, Cvoid, (Ref{Float64},), a), Tuple{Float64}) @test !contains(breakpoint_f64_ir, "jl_gc_pool_alloc") - breakpoint_any_ir = get_llvm((a)->ccall(:jl_breakpoint, Void, (Ref{Any},), a), + breakpoint_any_ir = get_llvm((a)->ccall(:jl_breakpoint, Cvoid, (Ref{Any},), a), Tuple{Float64}) @test contains(breakpoint_any_ir, "jl_gc_pool_alloc") two_breakpoint_ir = get_llvm(two_breakpoint, Tuple{Float64}) @@ -221,7 +221,7 @@ end # Issue 22770 let was_gced = false @noinline make_tuple(x) = tuple(x) - @noinline use(x) = ccall(:jl_breakpoint, Void, ()) + @noinline use(x) = ccall(:jl_breakpoint, Cvoid, ()) @noinline assert_not_gced() = @test !was_gced function foo22770() @@ -254,7 +254,7 @@ end function issue22582!(a::AbstractArray, b) len = length(a) if b - ccall(:jl_array_grow_end, Void, (Any, Csize_t), a, 1) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), a, 1) end return len end diff --git a/test/core.jl b/test/core.jl index 750c577c27eba..77946bfe7f57e 100644 --- a/test/core.jl +++ b/test/core.jl @@ -1133,7 +1133,7 @@ let b = C_NULL + 1 c = C_NULL - 1 d = 1 + C_NULL - @test eltype(a) == Void + @test eltype(a) == Nothing @test a != b != c @test b == d @@ -1162,7 +1162,7 @@ let @test a2 == [101,102,909] end -@test unsafe_pointer_to_objref(ccall(:jl_call1, Ptr{Void}, (Any,Any), +@test unsafe_pointer_to_objref(ccall(:jl_call1, Ptr{Cvoid}, (Any,Any), x -> x+1, 314158)) == 314159 @test unsafe_pointer_to_objref(pointer_from_objref(ℯ+pi)) == ℯ+pi @@ -1327,7 +1327,7 @@ end # issue #2365 mutable struct B2365{T} - v::Union{T, Void} + v::Union{T, Nothing} end @test B2365{Int}(nothing).v === nothing @test B2365{Int}(0).v === 0 @@ -1484,7 +1484,7 @@ let end return ret end - x = Vector{Union{Dict{Int64,AbstractString},Array{Int64,3},Number,AbstractString,Void}}(uninitialized, 3) + x = Vector{Union{Dict{Int64,AbstractString},Array{Int64,3},Number,AbstractString,Nothing}}(uninitialized, 3) x[1] = 1.0 x[2] = 2.0 x[3] = 3.0 @@ -1602,7 +1602,7 @@ try end # issue #4526 -f4526(x) = isa(x.a, Void) +f4526(x) = isa(x.a, Nothing) @test_throws ErrorException f4526(1) @test_throws ErrorException f4526(im) @test_throws ErrorException f4526(1+2im) @@ -1643,7 +1643,7 @@ end # issue #4681 # ccall should error if convert() returns something of the wrong type mutable struct Z4681 - x::Ptr{Void} + x::Ptr{Cvoid} Z4681() = new(C_NULL) end Base.unsafe_convert(::Type{Ptr{Z4681}},b::Z4681) = b.x @@ -1738,7 +1738,7 @@ f5150(T) = Vector{Rational{T}}(uninitialized, 1) # issue #5165 primitive type T5165{S} 64 end -make_t(x::Int64) = Core.Intrinsics.bitcast(T5165{Void}, x) +make_t(x::Int64) = Core.Intrinsics.bitcast(T5165{Nothing}, x) xs5165 = T5165[make_t(Int64(1))] b5165 = IOBuffer() for x in xs5165 @@ -2139,7 +2139,7 @@ f6980(::Union{Int, Float64}, ::B6980) = true @test f6980(1, B6980()) # issue #7049 -Maybe7049{T} = Union{T,Void} +Maybe7049{T} = Union{T,Nothing} function ttt7049(;init::Maybe7049{Union{AbstractString,Tuple{Int,Char}}} = nothing) string("init=", init) end @@ -2240,8 +2240,8 @@ end # issue #8184 struct Foo8184 - x::Void - y::Void + x::Nothing + y::Nothing z::Float64 end let f = Foo8184(nothing,nothing,1.0) @@ -2354,24 +2354,24 @@ call_lambda7() = ((x...)->x)(1,2) # jl_new_bits testing let x = [1,2,3] - @test ccall(:jl_new_bits, Any, (Any,Ptr{Void},), Int, x) === 1 - @test ccall(:jl_new_bits, Any, (Any,Ptr{Void},), Complex{Int}, x) === 1+2im - @test ccall(:jl_new_bits, Any, (Any,Ptr{Void},), NTuple{3,Int}, x) === (1,2,3) - @test ccall(:jl_new_bits, Any, (Any,Ptr{Void},), Tuple{Int,Int,Int}, x) === (1,2,3) - @test (ccall(:jl_new_bits, Any, (Any,Ptr{Void},), Tuple{Int16,Tuple{Void},Int8,Tuple{},Int,Void,Int}, x)::Tuple)[[2,4,5,6,7]] === ((nothing,),(),2,nothing,3) + @test ccall(:jl_new_bits, Any, (Any,Ptr{Cvoid},), Int, x) === 1 + @test ccall(:jl_new_bits, Any, (Any,Ptr{Cvoid},), Complex{Int}, x) === 1+2im + @test ccall(:jl_new_bits, Any, (Any,Ptr{Cvoid},), NTuple{3,Int}, x) === (1,2,3) + @test ccall(:jl_new_bits, Any, (Any,Ptr{Cvoid},), Tuple{Int,Int,Int}, x) === (1,2,3) + @test (ccall(:jl_new_bits, Any, (Any,Ptr{Cvoid},), Tuple{Int16,Tuple{Cvoid},Int8,Tuple{},Int,Cvoid,Int}, x)::Tuple)[[2,4,5,6,7]] === ((nothing,),(),2,nothing,3) end # sig 2 is SIGINT per the POSIX.1-1990 standard if !Sys.iswindows() - ccall(:jl_exit_on_sigint, Void, (Cint,), 0) + ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 0) @test_throws InterruptException begin - ccall(:kill, Void, (Cint, Cint,), getpid(), 2) + ccall(:kill, Cvoid, (Cint, Cint,), getpid(), 2) for i in 1:10 Libc.systemsleep(0.1) - ccall(:jl_gc_safepoint, Void, ()) # wait for SIGINT to arrive + ccall(:jl_gc_safepoint, Cvoid, ()) # wait for SIGINT to arrive end end - ccall(:jl_exit_on_sigint, Void, (Cint,), 1) + ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 1) end let # Exception frame automatically restores sigatomic counter. @@ -3209,7 +3209,7 @@ f11715(x) = (x === Tuple{Any}) # part of #11597 # make sure invalid, partly-constructed types don't end up in the cache -abstract type C11597{T<:Union{Void, Int}} end +abstract type C11597{T<:Union{Nothing, Int}} end mutable struct D11597{T} <: C11597{T} d::T end @test_throws TypeError D11597(1.0) @test_throws TypeError repr(D11597(1.0)) @@ -3389,12 +3389,12 @@ struct Vec8010{T} end Vec8010(a::AbstractVector) = Vec8010(ntuple(x->a[x],2)...) Base.convert(::Type{Vec8010{T}},x::AbstractVector) where {T} = Vec8010(x) -Base.convert(::Type{Void},x::AbstractVector) = Vec8010(x) +Base.convert(::Type{Nothing},x::AbstractVector) = Vec8010(x) struct MyType8010 m::Vec8010{Float32} end struct MyType8010_ghost - m::Void + m::Nothing end @test_throws TypeError MyType8010([3.0;4.0]) @test_throws TypeError MyType8010_ghost([3.0;4.0]) @@ -3516,7 +3516,7 @@ foo12967(x, ::TupleType12967) = 2 @test foo12967(1, Tuple{}) == 2 # issue #13083 -@test Void() === nothing +@test Nothing() === nothing # issue discovered in #11973 for j = 1:1 @@ -3744,11 +3744,11 @@ let nometh = try; @eval @m8846(a, b, c); false; catch ex; ex; end end # a simple case of parametric dispatch with unions -let foo(x::Union{T, Void}, y::Union{T, Void}) where {T} = 1 +let foo(x::Union{T, Nothing}, y::Union{T, Nothing}) where {T} = 1 @test foo(1, nothing) === 1 @test foo(nothing, nothing) === 1 end -let foo(x::Union{T, Void}, y::Union{T, Void}) where {T} = T +let foo(x::Union{T, Nothing}, y::Union{T, Nothing}) where {T} = T @test foo(1, nothing) === Int @test_throws UndefVarError(:T) foo(nothing, nothing) end @@ -3925,33 +3925,33 @@ let ary = Vector{Any}(uninitialized, 10) # to check if these values are not reused later. check_undef_and_fill(ary, 1:10) # Check if the memory grown at the end are zerod - ccall(:jl_array_grow_end, Void, (Any, Csize_t), ary, 10) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), ary, 10) check_undef_and_fill(ary, 11:20) # Make sure the content of the memory deleted at the end are not reused - ccall(:jl_array_del_end, Void, (Any, Csize_t), ary, 5) - ccall(:jl_array_grow_end, Void, (Any, Csize_t), ary, 5) + ccall(:jl_array_del_end, Cvoid, (Any, Csize_t), ary, 5) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), ary, 5) check_undef_and_fill(ary, 16:20) # Now check grow/del_end ary = Vector{Any}(uninitialized, 1010) check_undef_and_fill(ary, 1:1010) # This del_beg should move the buffer - ccall(:jl_array_del_beg, Void, (Any, Csize_t), ary, 1000) - ccall(:jl_array_grow_beg, Void, (Any, Csize_t), ary, 1000) + ccall(:jl_array_del_beg, Cvoid, (Any, Csize_t), ary, 1000) + ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), ary, 1000) check_undef_and_fill(ary, 1:1000) ary = Vector{Any}(uninitialized, 1010) check_undef_and_fill(ary, 1:1010) # This del_beg should not move the buffer - ccall(:jl_array_del_beg, Void, (Any, Csize_t), ary, 10) - ccall(:jl_array_grow_beg, Void, (Any, Csize_t), ary, 10) + ccall(:jl_array_del_beg, Cvoid, (Any, Csize_t), ary, 10) + ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), ary, 10) check_undef_and_fill(ary, 1:10) ary = Vector{Any}(uninitialized, 1010) check_undef_and_fill(ary, 1:1010) - ccall(:jl_array_grow_end, Void, (Any, Csize_t), ary, 10) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), ary, 10) check_undef_and_fill(ary, 1011:1020) - ccall(:jl_array_del_end, Void, (Any, Csize_t), ary, 10) - ccall(:jl_array_grow_beg, Void, (Any, Csize_t), ary, 10) + ccall(:jl_array_del_end, Cvoid, (Any, Csize_t), ary, 10) + ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), ary, 10) check_undef_and_fill(ary, 1:10) # Make sure newly malloc'd buffers are filled with 0 @@ -3965,22 +3965,22 @@ let ary = Vector{Any}(uninitialized, 10) gc() gc() gc() - ccall(:jl_array_grow_beg, Void, (Any, Csize_t), ary, 4) - ccall(:jl_array_del_beg, Void, (Any, Csize_t), ary, 4) - ccall(:jl_array_grow_end, Void, (Any, Csize_t), ary, n) - ccall(:jl_array_grow_beg, Void, (Any, Csize_t), ary, 4) + ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), ary, 4) + ccall(:jl_array_del_beg, Cvoid, (Any, Csize_t), ary, 4) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), ary, n) + ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), ary, 4) check_undef_and_fill(ary, 1:(2n + 4)) end ary = Vector{Any}(uninitialized, 100) - ccall(:jl_array_grow_end, Void, (Any, Csize_t), ary, 10000) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), ary, 10000) ary[:] = 1:length(ary) - ccall(:jl_array_del_beg, Void, (Any, Csize_t), ary, 10000) + ccall(:jl_array_del_beg, Cvoid, (Any, Csize_t), ary, 10000) # grow on the back until a buffer reallocation happens cur_ptr = pointer(ary) while cur_ptr == pointer(ary) len = length(ary) - ccall(:jl_array_grow_end, Void, (Any, Csize_t), ary, 10) + ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), ary, 10) for i in (len + 1):(len + 10) @test !isassigned(ary, i) end @@ -3988,7 +3988,7 @@ let ary = Vector{Any}(uninitialized, 10) ary = Vector{Any}(uninitialized, 100) ary[:] = 1:length(ary) - ccall(:jl_array_grow_at, Void, (Any, Csize_t, Csize_t), ary, 50, 10) + ccall(:jl_array_grow_at, Cvoid, (Any, Csize_t, Csize_t), ary, 50, 10) for i in 51:60 @test !isassigned(ary, i) end @@ -4083,16 +4083,16 @@ function test_shared_array_resize(::Type{T}) where T @test pointer(a) != pointer(a′) end - test_unshare(a->ccall(:jl_array_del_end, Void, (Any, Csize_t), a, 0)) - test_unshare(a->ccall(:jl_array_del_end, Void, (Any, Csize_t), a, 1)) - test_unshare(a->ccall(:jl_array_del_beg, Void, (Any, Csize_t), a, 0)) - test_unshare(a->ccall(:jl_array_del_beg, Void, (Any, Csize_t), a, 1)) + test_unshare(a->ccall(:jl_array_del_end, Cvoid, (Any, Csize_t), a, 0)) + test_unshare(a->ccall(:jl_array_del_end, Cvoid, (Any, Csize_t), a, 1)) + test_unshare(a->ccall(:jl_array_del_beg, Cvoid, (Any, Csize_t), a, 0)) + test_unshare(a->ccall(:jl_array_del_beg, Cvoid, (Any, Csize_t), a, 1)) test_unshare(a->deleteat!(a, 10)) test_unshare(a->deleteat!(a, 90)) - test_unshare(a->ccall(:jl_array_grow_end, Void, (Any, Csize_t), a, 0)) - test_unshare(a->ccall(:jl_array_grow_end, Void, (Any, Csize_t), a, 1)) - test_unshare(a->ccall(:jl_array_grow_beg, Void, (Any, Csize_t), a, 0)) - test_unshare(a->ccall(:jl_array_grow_beg, Void, (Any, Csize_t), a, 1)) + test_unshare(a->ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), a, 0)) + test_unshare(a->ccall(:jl_array_grow_end, Cvoid, (Any, Csize_t), a, 1)) + test_unshare(a->ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), a, 0)) + test_unshare(a->ccall(:jl_array_grow_beg, Cvoid, (Any, Csize_t), a, 1)) test_unshare(a->insert!(a, 10, 10)) test_unshare(a->insert!(a, 90, 90)) end @@ -4122,19 +4122,19 @@ push!(d, 0x3) @test check_nul(d) push!(d, 0x3) @test check_nul(d) -ccall(:jl_array_del_end, Void, (Any, UInt), d, 2) +ccall(:jl_array_del_end, Cvoid, (Any, UInt), d, 2) @test check_nul(d) -ccall(:jl_array_grow_end, Void, (Any, UInt), d, 1) +ccall(:jl_array_grow_end, Cvoid, (Any, UInt), d, 1) @test check_nul(d) -ccall(:jl_array_grow_end, Void, (Any, UInt), d, 1) +ccall(:jl_array_grow_end, Cvoid, (Any, UInt), d, 1) @test check_nul(d) -ccall(:jl_array_grow_end, Void, (Any, UInt), d, 10) +ccall(:jl_array_grow_end, Cvoid, (Any, UInt), d, 10) @test check_nul(d) -ccall(:jl_array_del_beg, Void, (Any, UInt), d, 8) +ccall(:jl_array_del_beg, Cvoid, (Any, UInt), d, 8) @test check_nul(d) -ccall(:jl_array_grow_beg, Void, (Any, UInt), d, 8) +ccall(:jl_array_grow_beg, Cvoid, (Any, UInt), d, 8) @test check_nul(d) -ccall(:jl_array_grow_beg, Void, (Any, UInt), d, 8) +ccall(:jl_array_grow_beg, Cvoid, (Any, UInt), d, 8) @test check_nul(d) f = unsafe_wrap(Array, pointer(d), length(d)) @test !check_nul(f) @@ -4373,7 +4373,7 @@ function f4(a, p) end b[1] end -code_llvm(DevNull, f4, Tuple{Bool,Ptr{Void}}) +code_llvm(DevNull, f4, Tuple{Bool,Ptr{Cvoid}}) @test f4(true, C_NULL) == 2 @test_throws UndefRefError f4(false, C_NULL) @@ -4494,11 +4494,11 @@ let a = Val{Val{TypeVar(:_, Int)}}, @test Base._isleaftype(b) end -# A return type widened to Type{Union{T,Void}} should not confuse +# A return type widened to Type{Union{T,Nothing}} should not confuse # codegen -@noinline MaybeFunc(T) = Union{T, Void} +@noinline MaybeFunc(T) = Union{T, Nothing} fMaybeFunc() = MaybeFunc(Int64) -@test fMaybeFunc() == Union{Int64, Void} +@test fMaybeFunc() == Union{Int64, Nothing} # issue #16431 function f16431(x) @@ -4568,7 +4568,7 @@ f1090()::Int = A1090() @test_throws TypeError f1090() # issue #19106 -function f19106()::Void end +function f19106()::Nothing end @test f19106() === nothing # issue #16783 @@ -4609,7 +4609,7 @@ try catch end @test isa(T16793, Type) -@test isa(abstract type T16793_2 end, Void) +@test isa(abstract type T16793_2 end, Nothing) # issue #17147 f17147(::Tuple) = 1 @@ -4678,8 +4678,8 @@ cfunction(f18054, Cint, Tuple{}) # issue #18986: the ccall optimization of cfunction leaves JL_TRY stack in bad state dummy18996() = return nothing function main18986() - cfunction(dummy18986, Void, ()) - ccall((:dummy2, "this_is_a_nonexisting_library"), Void, ()) + cfunction(dummy18986, Cvoid, ()) + ccall((:dummy2, "this_is_a_nonexisting_library"), Cvoid, ()) end @test_throws ErrorException main18986() @@ -4698,7 +4698,7 @@ ptr18236 = cfunction(identity, VecElement{Float64}, Tuple{VecElement{Float64}}) @eval @noinline f18236(ptr) = ccall(ptr, VecElement{Float64}, (VecElement{Float64},), $v18236) @test f18236(ptr18236) === v18236 -@test !contains(sprint(code_llvm, f18236, Tuple{Ptr{Void}}), "double undef") +@test !contains(sprint(code_llvm, f18236, Tuple{Ptr{Cvoid}}), "double undef") # VecElement of struct, not necessarily useful but does have special # ABI so should be handled correctly # This struct should be small enough to be passed by value in C ABI @@ -4756,7 +4756,7 @@ end @test f18173() == false let _true = Ref(true), f, g, h - @noinline f() = ccall((:time, "error_library_doesnt_exist\0"), Void, ()) # some expression that throws an error in codegen + @noinline f() = ccall((:time, "error_library_doesnt_exist\0"), Cvoid, ()) # some expression that throws an error in codegen @noinline g() = _true[] ? 0 : h() @noinline h() = (g(); f()) @test_throws ErrorException @code_native h() # due to a failure to compile f() @@ -4990,12 +4990,12 @@ end # module SOE # issue #15240 @test_nowarn begin local p15240 - p15240 = ccall(:jl_realloc, Ptr{Void}, (Ptr{Void}, Csize_t), C_NULL, 10) - ccall(:jl_free, Void, (Ptr{Void},), p15240) + p15240 = ccall(:jl_realloc, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), C_NULL, 10) + ccall(:jl_free, Cvoid, (Ptr{Cvoid},), p15240) end # issue #19963 -@test_nowarn ccall(:jl_free, Void, (Ptr{Void},), C_NULL) +@test_nowarn ccall(:jl_free, Cvoid, (Ptr{Cvoid},), C_NULL) # Wrong string size on 64bits for large string. if Sys.WORD_SIZE == 64 @@ -5437,10 +5437,10 @@ m22929_2.x = m22929_1 # Union type sorting for T in ( - (Void, Int8), - (Void, Int64), - (Void, Tuple{Int64, String}), - (Void, Array), + (Nothing, Int8), + (Nothing, Int64), + (Nothing, Tuple{Int64, String}), + (Nothing, Array), (Float64, Int64), (Float64, String), (Float64, Array), @@ -5451,7 +5451,7 @@ for T in ( @test Base.uniontypes(Union{T...}) == collect(T) @test Base.uniontypes(Union{reverse(T)...}) == collect(T) end -@test Base.uniontypes(Union{Void, Union{Int64, Float64}}) == Any[Void, Float64, Int64] +@test Base.uniontypes(Union{Nothing, Union{Int64, Float64}}) == Any[Nothing, Float64, Int64] module AlternativeIntModule struct Int64 val::UInt64 @@ -5521,9 +5521,9 @@ module UnionOptimizations using Test using Dates -const boxedunions = [Union{}, Union{String, Void}] -const unboxedunions = [Union{Int8, Void}, - Union{Int8, Float16, Void}, +const boxedunions = [Union{}, Union{String, Nothing}] +const unboxedunions = [Union{Int8, Nothing}, + Union{Int8, Float16, Nothing}, Union{Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128}, Union{Char, Date, Int}] @@ -5543,12 +5543,12 @@ const unboxedunions = [Union{Int8, Void}, @test sizeof(unboxedunions[3]) == 16 @test sizeof(unboxedunions[4]) == 8 -initvalue(::Type{Void}) = nothing +initvalue(::Type{Nothing}) = nothing initvalue(::Type{Char}) = '\0' initvalue(::Type{Date}) = Date(0, 12, 31) initvalue(::Type{T}) where {T <: Number} = T(0) -initvalue2(::Type{Void}) = nothing +initvalue2(::Type{Nothing}) = nothing initvalue2(::Type{Char}) = Char(0x01) initvalue2(::Type{Date}) = Date(1) initvalue2(::Type{T}) where {T <: Number} = T(1) @@ -5567,20 +5567,20 @@ x.u = initvalue(Base.uniontypes(U)[2]) @test x.u === initvalue(Base.uniontypes(U)[2]) mutable struct UnionField2 - x::Union{Void, Int} + x::Union{Nothing, Int} @noinline UnionField2() = new() end @test UnionField2().x === nothing struct UnionField3 - x::Union{Void, Int} + x::Union{Nothing, Int} @noinline UnionField3() = new() end @test UnionField3().x === nothing mutable struct UnionField4 - x::Union{Void, Float64} - y::Union{Void, Int8} + x::Union{Nothing, Float64} + y::Union{Nothing, Int8} z::NTuple{8, UInt8} @noinline UnionField4() = new() @noinline UnionField4(x, y) = new(x, y, (0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88)) @@ -5599,8 +5599,8 @@ let x4 = UnionField4(nothing, Int8(3)) end struct UnionField5 - x::Union{Void, Float64} - y::Union{Void, Int8} + x::Union{Nothing, Float64} + y::Union{Nothing, Int8} z::NTuple{8, UInt8} @noinline UnionField5() = new() @noinline UnionField5(x, y) = new(x, y, (0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88)) @@ -5623,7 +5623,7 @@ end # PR #23367 struct A23367 - x::Union{Int8, Int16, NTuple{7, Int8}, Void} + x::Union{Int8, Int16, NTuple{7, Int8}, Nothing} end struct B23367 x::Int8 @@ -5681,14 +5681,14 @@ end # unsafe_wrap let A4 = [1, 2, 3] - @test_throws ArgumentError unsafe_wrap(Array, convert(Ptr{Union{Int, Void}}, pointer(A4)), 3) + @test_throws ArgumentError unsafe_wrap(Array, convert(Ptr{Union{Int, Nothing}}, pointer(A4)), 3) A5 = [1 2 3; 4 5 6] - @test_throws ArgumentError unsafe_wrap(Array, convert(Ptr{Union{Int, Void}}, pointer(A5)), 6) + @test_throws ArgumentError unsafe_wrap(Array, convert(Ptr{Union{Int, Nothing}}, pointer(A5)), 6) end # copyto! -A23567 = Vector{Union{Float64, Void}}(uninitialized, 5) -B23567 = collect(Union{Float64, Void}, 1.0:3.0) +A23567 = Vector{Union{Float64, Nothing}}(uninitialized, 5) +B23567 = collect(Union{Float64, Nothing}, 1.0:3.0) copyto!(A23567, 2, B23567) @test A23567[1] === nothing @test A23567[2] === 1.0 @@ -5907,7 +5907,7 @@ handle_on_m22098 = getfield(@__MODULE__, Symbol("@m22098")) # issue 24363 mutable struct A24363 - x::Union{Int,Void} + x::Union{Int,Nothing} end int24363 = A24363(65535) diff --git a/test/deprecation_exec.jl b/test/deprecation_exec.jl index f5bdc352b6ba6..3a30e7ec0e9cd 100644 --- a/test/deprecation_exec.jl +++ b/test/deprecation_exec.jl @@ -79,5 +79,5 @@ depwarn24658() = Base.firstcaller(backtrace(), :_func_not_found_) @testset "firstcaller" begin # issue #24658 - @test eval(:(if true; f24658(); end)) == (Ptr{Void}(0),StackTraces.UNKNOWN) + @test eval(:(if true; f24658(); end)) == (Ptr{Cvoid}(0),StackTraces.UNKNOWN) end diff --git a/test/docs.jl b/test/docs.jl index 48a9d77a24d4c..a2edd4f064997 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -955,7 +955,7 @@ for (line, expr) in Pair[ ] @test Docs.helpmode(line) == Expr(:macrocall, Expr(:., Expr(:., :Base, QuoteNode(:Docs)), QuoteNode(Symbol("@repl"))), LineNumberNode(118, doc_util_path), STDOUT, expr) buf = IOBuffer() - @test eval(Base, Docs.helpmode(buf, line)) isa Union{Base.Markdown.MD,Void} + @test eval(Base, Docs.helpmode(buf, line)) isa Union{Base.Markdown.MD,Nothing} end @test sprint(Base.Docs.repl_latex, "√") == "\"√\" can be typed by \\sqrt\n\n" diff --git a/test/file.jl b/test/file.jl index 1d3a690e6fb97..e5db8bbf3ab7e 100644 --- a/test/file.jl +++ b/test/file.jl @@ -817,7 +817,7 @@ end function test_LibcFILE(FILEp) buf = Vector{UInt8}(uninitialized, 8) - str = ccall(:fread, Csize_t, (Ptr{Void}, Csize_t, Csize_t, Ptr{Void}), buf, 1, 8, FILEp) + str = ccall(:fread, Csize_t, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{Cvoid}), buf, 1, 8, FILEp) @test String(buf) == "Hello, w" @test position(FILEp) == 8 seek(FILEp, 5) diff --git a/test/inference.jl b/test/inference.jl index 800f5228cbb96..f8bee75a125af 100644 --- a/test/inference.jl +++ b/test/inference.jl @@ -299,7 +299,7 @@ end # === with singleton constants let f(x) = (x===nothing) ? 1 : 1.0 - @test Base.return_types(f, (Void,)) == Any[Int] + @test Base.return_types(f, (Nothing,)) == Any[Int] end # issue #16530 @@ -614,7 +614,7 @@ function f_inferred_union() return f_inferred_union_int(b) end end -f_inferred_union_nothing(::Void) = 1 +f_inferred_union_nothing(::Nothing) = 1 f_inferred_union_nothing(::Any) = "broken" f_inferred_union_float(::Float64) = 2 f_inferred_union_float(::Any) = "broken" @@ -855,10 +855,10 @@ end # issue #21848 @test Core.Inference.limit_type_depth(Ref{Complex{T} where T}, 0) == Ref -let T = Tuple{Tuple{Int64, Void}, - Tuple{Tuple{Int64, Void}, - Tuple{Int64, Tuple{Tuple{Int64, Void}, - Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple, Tuple}}}}}}}} +let T = Tuple{Tuple{Int64, Nothing}, + Tuple{Tuple{Int64, Nothing}, + Tuple{Int64, Tuple{Tuple{Int64, Nothing}, + Tuple{Tuple{Int64, Nothing}, Tuple{Int64, Tuple{Tuple{Int64, Nothing}, Tuple{Tuple, Tuple}}}}}}}} @test Core.Inference.limit_type_depth(T, 0) >: T @test Core.Inference.limit_type_depth(T, 1) >: T @test Core.Inference.limit_type_depth(T, 2) >: T diff --git a/test/intfuncs.jl b/test/intfuncs.jl index 062d1103c530f..918febfde41ca 100644 --- a/test/intfuncs.jl +++ b/test/intfuncs.jl @@ -214,10 +214,10 @@ end end end # issue #9786 -let ptr = Ptr{Void}(typemax(UInt)) +let ptr = Ptr{Cvoid}(typemax(UInt)) for T in (Int, Cssize_t) @test T(ptr) == -1 - @test ptr == Ptr{Void}(T(ptr)) + @test ptr == Ptr{Cvoid}(T(ptr)) @test typeof(Ptr{Float64}(T(ptr))) == Ptr{Float64} end end diff --git a/test/libdl.jl b/test/libdl.jl index 7958883edd61c..1cc1b19dd351b 100644 --- a/test/libdl.jl +++ b/test/libdl.jl @@ -187,7 +187,7 @@ end # If dl is NULL, jl_dlclose should return -1 and dlclose should return false # dlclose should return true on success and false on failure let dl = C_NULL - @test -1 == ccall(:jl_dlclose, Cint, (Ptr{Void},), dl) + @test -1 == ccall(:jl_dlclose, Cint, (Ptr{Cvoid},), dl) @test !Libdl.dlclose(dl) dl = Libdl.dlopen_e("libccalltest") @@ -198,7 +198,7 @@ let dl = C_NULL end if Sys.KERNEL in (:Linux, :FreeBSD) - ccall(:jl_read_sonames, Void, ()) + ccall(:jl_read_sonames, Cvoid, ()) end end diff --git a/test/libgit2-helpers.jl b/test/libgit2-helpers.jl index ff43d5524aeca..8b7758944d47c 100644 --- a/test/libgit2-helpers.jl +++ b/test/libgit2-helpers.jl @@ -13,12 +13,12 @@ without having to authenticate against a real server. function credential_loop( valid_credential::AbstractCredential, url::AbstractString, - user::Union{AbstractString, Void}, + user::Union{AbstractString, Nothing}, allowed_types::UInt32, payload::CredentialPayload; shred::Bool=true) cb = Base.LibGit2.credentials_cb() - libgitcred_ptr_ptr = Ref{Ptr{Void}}(C_NULL) + libgitcred_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL) # Number of times credentials were authenticated against. With the real LibGit2 # credential loop this would be how many times we sent credentials to the remote. @@ -28,7 +28,7 @@ function credential_loop( # until we find valid credentials or an exception is raised. err = Cint(0) while err == 0 - err = ccall(cb, Cint, (Ptr{Ptr{Void}}, Cstring, Cstring, Cuint, Any), + err = ccall(cb, Cint, (Ptr{Ptr{Cvoid}}, Cstring, Cstring, Cuint, Any), libgitcred_ptr_ptr, url, coalesce(user, C_NULL), allowed_types, payload) num_authentications += 1 @@ -62,7 +62,7 @@ end function credential_loop( valid_credential::UserPasswordCredential, url::AbstractString, - user::Union{AbstractString, Void}=nothing, + user::Union{AbstractString, Nothing}=nothing, payload::CredentialPayload=DEFAULT_PAYLOAD; shred::Bool=true) credential_loop(valid_credential, url, user, 0x000001, payload, shred=shred) @@ -71,8 +71,8 @@ end function credential_loop( valid_credential::SSHCredential, url::AbstractString, - user::Union{AbstractString, Void}=nothing, + user::Union{AbstractString, Nothing}=nothing, payload::CredentialPayload=DEFAULT_PAYLOAD; shred::Bool=true) credential_loop(valid_credential, url, user, 0x000046, payload, shred=shred) -end \ No newline at end of file +end diff --git a/test/linalg/generic.jl b/test/linalg/generic.jl index 638a3c8d88478..aea5dc2bf7a6d 100644 --- a/test/linalg/generic.jl +++ b/test/linalg/generic.jl @@ -436,4 +436,4 @@ end @test !isdiag(lbidiag) @test isdiag(adiag) end -end \ No newline at end of file +end diff --git a/test/llvmcall.jl b/test/llvmcall.jl index 0bb4f710b8652..926ed739ed601 100644 --- a/test/llvmcall.jl +++ b/test/llvmcall.jl @@ -139,7 +139,7 @@ function confuse_declname_parsing() llvmcall( ("""declare i64 addrspace(0)* @foobar()""", """ret void"""), - Void, Tuple{}) + Cvoid, Tuple{}) end confuse_declname_parsing() @@ -158,7 +158,7 @@ module ObjLoadTest using Base: llvmcall, @ccallable using Test didcall = false - @ccallable Void function jl_the_callback() + @ccallable Cvoid function jl_the_callback() global didcall didcall = true nothing @@ -171,7 +171,7 @@ module ObjLoadTest """ call void @jl_the_callback() ret void - """),Void,Tuple{}) + """),Cvoid,Tuple{}) end do_the_call() @test didcall @@ -186,7 +186,7 @@ if Base.libllvm_version >= v"3.6" # llvm 3.6 changed the syntax for a gep, so ju Base.llvmcall( """%1 = getelementptr i64, i64* null, i64 1 ret void""", - Void, Tuple{}) + Cvoid, Tuple{}) end code_llvm(DevNull, foo, ()) else diff --git a/test/llvmpasses/.gitignore b/test/llvmpasses/.gitignore index 0e62bc85774ee..aa144c71f85f8 100644 --- a/test/llvmpasses/.gitignore +++ b/test/llvmpasses/.gitignore @@ -1 +1 @@ -/Output/ \ No newline at end of file +/Output/ diff --git a/test/misc.jl b/test/misc.jl index fccc13d555a62..04992d90261b8 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -568,7 +568,7 @@ let a = [1,2,3] @test unsafe_securezero!(pointer(a), length(a)) == pointer(a) @test a == [0,0,0] a[:] = 1:3 - @test unsafe_securezero!(Ptr{Void}(pointer(a)), sizeof(a)) == Ptr{Void}(pointer(a)) + @test unsafe_securezero!(Ptr{Cvoid}(pointer(a)), sizeof(a)) == Ptr{Cvoid}(pointer(a)) @test a == [0,0,0] end let cache = Base.LibGit2.CachedCredentials() @@ -588,7 +588,7 @@ if Sys.iswindows() PAGE_EXECUTE_READWRITE = 0x40 oldPerm = Ref{UInt32}() err18083 = ccall(:VirtualProtect,stdcall,Cint, - (Ptr{Void}, Csize_t, UInt32, Ptr{UInt32}), + (Ptr{Cvoid}, Csize_t, UInt32, Ptr{UInt32}), addr, 4096, PAGE_EXECUTE_READWRITE, oldPerm) err18083 == 0 && error(Libc.GetLastError()) end diff --git a/test/missing.jl b/test/missing.jl index c1855b8ecd825..093b6e39cff18 100644 --- a/test/missing.jl +++ b/test/missing.jl @@ -13,11 +13,11 @@ end @testset "convert" begin @test convert(Union{Int, Missing}, 1) === 1 @test convert(Union{Int, Missing}, 1.0) === 1 - @test convert(Union{Void, Missing}, missing) === missing - @test convert(Union{Void, Missing}, nothing) === nothing + @test convert(Union{Nothing, Missing}, missing) === missing + @test convert(Union{Nothing, Missing}, nothing) === nothing @test_throws MethodError convert(Missing, 1) - @test_throws MethodError convert(Union{Void, Missing}, 1) + @test_throws MethodError convert(Union{Nothing, Missing}, 1) @test_throws MethodError convert(Union{Int, Missing}, "a") end @@ -37,7 +37,7 @@ end @test promote_type(Union{Int, Missing}, Union{Int, Missing}) == Union{Int, Missing} @test promote_type(Union{Float64, Missing}, Union{String, Missing}) == Any @test promote_type(Union{Float64, Missing}, Union{Int, Missing}) == Union{Float64, Missing} - @test_broken promote_type(Union{Void, Missing, Int}, Float64) == Any + @test_broken promote_type(Union{Nothing, Missing, Int}, Float64) == Any end @testset "comparison operators" begin @@ -327,4 +327,4 @@ end @test eltype(x) === Any @test collect(x) == [1, 2, 4] @test collect(x) isa Vector{Int} -end \ No newline at end of file +end diff --git a/test/namedtuple.jl b/test/namedtuple.jl index 01eeb671ba1c4..5b2c2179a05a5 100644 --- a/test/namedtuple.jl +++ b/test/namedtuple.jl @@ -51,8 +51,8 @@ let NT = NamedTuple{(:a,:b),Tuple{Int8,Int16}}, nt = (x=3,y=4) end @test NamedTuple{(:a,:c)}((b=1,z=2,c=3,aa=4,a=5)) === (a=5, c=3) -@test NamedTuple{(:a,)}(NamedTuple{(:b, :a), Tuple{Int, Union{Int,Void}}}((1, 2))) === - NamedTuple{(:a,), Tuple{Union{Int,Void}}}((2,)) +@test NamedTuple{(:a,)}(NamedTuple{(:b, :a), Tuple{Int, Union{Int,Nothing}}}((1, 2))) === + NamedTuple{(:a,), Tuple{Union{Int,Nothing}}}((2,)) @test eltype((a=[1,2], b=[3,4])) === Vector{Int} @@ -81,10 +81,10 @@ end @test merge((a=2, b=1), NamedTuple()) == (a=2, b=1) @test merge(NamedTuple(), NamedTuple()) == NamedTuple() # `merge` should preserve element types -let nt = merge(NamedTuple{(:a,:b),Tuple{Int32,Union{Int32,Void}}}((1,Int32(2))), - NamedTuple{(:a,:c),Tuple{Union{Int8,Void},Float64}}((nothing,1.0))) - @test typeof(nt) == NamedTuple{(:a,:b,:c),Tuple{Union{Int8,Void},Union{Int32,Void},Float64}} - @test repr(nt) == "NamedTuple{(:a, :b, :c),Tuple{Union{Void, Int8},Union{Void, Int32},Float64}}((nothing, 2, 1.0))" +let nt = merge(NamedTuple{(:a,:b),Tuple{Int32,Union{Int32,Nothing}}}((1,Int32(2))), + NamedTuple{(:a,:c),Tuple{Union{Int8,Nothing},Float64}}((nothing,1.0))) + @test typeof(nt) == NamedTuple{(:a,:b,:c),Tuple{Union{Int8,Nothing},Union{Int32,Nothing},Float64}} + @test repr(nt) == "NamedTuple{(:a, :b, :c),Tuple{Union{Nothing, Int8},Union{Nothing, Int32},Float64}}((nothing, 2, 1.0))" end @test merge(NamedTuple(), [:a=>1, :b=>2, :c=>3, :a=>4, :c=>5]) == (a=4, b=2, c=5) @@ -157,7 +157,7 @@ function nt_from_abstractly_typed_array() end @test nt_from_abstractly_typed_array() === (3,5) -let T = NamedTuple{(:a, :b), Tuple{Int64, Union{Float64, Void}}}, nt = T((1, nothing)) +let T = NamedTuple{(:a, :b), Tuple{Int64, Union{Float64, Nothing}}}, nt = T((1, nothing)) @test nt == (a=1, b=nothing) @test typeof(nt) == T @test convert(T, (a=1, b=nothing)) == nt @@ -206,5 +206,5 @@ abstr_nt_22194_3() @test Base.structdiff((a=1, b=2, z=20), (b=3, q=20, z=1)) == (a=1,) @test Base.structdiff((a=1, b=2, z=20), (b=3, q=20, z=1, a=0)) == NamedTuple() @test Base.structdiff((a=1, b=2, z=20), NamedTuple{(:b,)}) == (a=1, z=20) -@test typeof(Base.structdiff(NamedTuple{(:a, :b), Tuple{Int32, Union{Int32, Void}}}((1, Int32(2))), - (a=0,))) === NamedTuple{(:b,), Tuple{Union{Int32, Void}}} +@test typeof(Base.structdiff(NamedTuple{(:a, :b), Tuple{Int32, Union{Int32, Nothing}}}((1, Int32(2))), + (a=0,))) === NamedTuple{(:b,), Tuple{Union{Int32, Nothing}}} diff --git a/test/netload/memtest.jl b/test/netload/memtest.jl index 160af87fbc3f7..78a203b314202 100644 --- a/test/netload/memtest.jl +++ b/test/netload/memtest.jl @@ -23,7 +23,7 @@ end function get_vmsize() ru = Vector{RUsage}(uninitialized, 1) - ccall(:getrusage, Cint, (Cint, Ptr{Void}), 0, ru) + ccall(:getrusage, Cint, (Cint, Ptr{Cvoid}), 0, ru) return ru[1].ru_maxrss end diff --git a/test/perf/perfutil.jl b/test/perf/perfutil.jl index e28f7f0fbb8c0..69a6a85f2ad83 100644 --- a/test/perf/perfutil.jl +++ b/test/perf/perfutil.jl @@ -105,7 +105,7 @@ function maxrss(name) @static if Sys.islinux() rus = Vector{Int64}(uninitialized, div(144,8)) fill!(rus, 0x0) - res = ccall(:getrusage, Int32, (Int32, Ptr{Void}), 0, rus) + res = ccall(:getrusage, Int32, (Int32, Ptr{Cvoid}), 0, rus) if res == 0 mx = rus[5]/1024 @printf "julia,%s.mem,%f,%f,%f,%f\n" name mx mx mx 0 diff --git a/test/perf/threads/laplace3d/laplace3d.jl b/test/perf/threads/laplace3d/laplace3d.jl index f559daedff51e..7bf7164c4de6d 100644 --- a/test/perf/threads/laplace3d/laplace3d.jl +++ b/test/perf/threads/laplace3d/laplace3d.jl @@ -100,7 +100,7 @@ function laplace3d(nx=290, ny=290, nz=290; iters=1000, verify=false) l3d_threadfor(u1, u3, nx, ny, nz) # @threads all l3d_threadfun(u1, u3, nx, ny, nz) # l3d_threadblock(u1, u3, nx, ny, nz) - # ccall(:jl_threading_run, Void, (Any, Any), l3d_threadfun, (u1, u3, nx, ny, nz)) + # ccall(:jl_threading_run, Cvoid, (Any, Any), l3d_threadfun, (u1, u3, nx, ny, nz)) foo = u1 u1 = u3 u3 = foo @@ -132,4 +132,4 @@ function laplace3d(nx=290, ny=290, nz=290; iters=1000, verify=false) end @time laplace3d() -#ccall(:jl_threading_profile, Void, ()) +#ccall(:jl_threading_profile, Cvoid, ()) diff --git a/test/perf/threads/lbm3d/lbm3d.jl b/test/perf/threads/lbm3d/lbm3d.jl index d553a626e48e4..047044d2ac3e0 100644 --- a/test/perf/threads/lbm3d/lbm3d.jl +++ b/test/perf/threads/lbm3d/lbm3d.jl @@ -216,4 +216,4 @@ function lbm3d(n) end @time lbm3d(36) -#ccall(:jl_threading_profile, Void, ()) +#ccall(:jl_threading_profile, Cvoid, ()) diff --git a/test/perf/threads/stockcorr/pstockcorr.jl b/test/perf/threads/stockcorr/pstockcorr.jl index a049cb7b6f02f..a14a42b6447bc 100644 --- a/test/perf/threads/stockcorr/pstockcorr.jl +++ b/test/perf/threads/stockcorr/pstockcorr.jl @@ -107,4 +107,4 @@ function pstockcorr(n) end @time pstockcorr(1000000) -#ccall(:jl_threading_profile, Void, ()) +#ccall(:jl_threading_profile, Cvoid, ()) diff --git a/test/reflection.jl b/test/reflection.jl index 7b0d170f1ebe7..263ad8a3a425b 100644 --- a/test/reflection.jl +++ b/test/reflection.jl @@ -166,7 +166,7 @@ struct AlwaysHasLayout{T} end @test !isconcrete(AlwaysHasLayout) && !isconcrete(AlwaysHasLayout.body) @test isconcrete(AlwaysHasLayout{Any}) -@test isconcrete(Ptr{Void}) +@test isconcrete(Ptr{Cvoid}) @test !isconcrete(Ptr) && !isconcrete(Ptr.body) # issue #10165 @@ -384,9 +384,9 @@ for (f, t) in Any[(definitely_not_in_sysimg, Tuple{}), world = typemax(UInt) linfo = ccall(:jl_specializations_get_linfo, Ref{Core.MethodInstance}, (Any, Any, Any, UInt), meth, tt, env, world) params = Base.CodegenParams() - llvmf = ccall(:jl_get_llvmf_decl, Ptr{Void}, (Any, UInt, Bool, Base.CodegenParams), linfo::Core.MethodInstance, world, true, params) + llvmf = ccall(:jl_get_llvmf_decl, Ptr{Cvoid}, (Any, UInt, Bool, Base.CodegenParams), linfo::Core.MethodInstance, world, true, params) @test llvmf != C_NULL - @test ccall(:jl_get_llvm_fptr, Ptr{Void}, (Ptr{Void},), llvmf) != C_NULL + @test ccall(:jl_get_llvm_fptr, Ptr{Cvoid}, (Ptr{Cvoid},), llvmf) != C_NULL end module MacroTest @@ -519,28 +519,28 @@ end # Linfo Tracing test tracefoo(x, y) = x+y didtrace = false -tracer(x::Ptr{Void}) = (@test isa(unsafe_pointer_to_objref(x), Core.MethodInstance); global didtrace = true; nothing) -ccall(:jl_register_method_tracer, Void, (Ptr{Void},), cfunction(tracer, Void, Tuple{Ptr{Void}})) +tracer(x::Ptr{Cvoid}) = (@test isa(unsafe_pointer_to_objref(x), Core.MethodInstance); global didtrace = true; nothing) +ccall(:jl_register_method_tracer, Cvoid, (Ptr{Cvoid},), cfunction(tracer, Cvoid, Tuple{Ptr{Cvoid}})) meth = which(tracefoo,Tuple{Any,Any}) -ccall(:jl_trace_method, Void, (Any,), meth) +ccall(:jl_trace_method, Cvoid, (Any,), meth) @test tracefoo(1, 2) == 3 -ccall(:jl_untrace_method, Void, (Any,), meth) +ccall(:jl_untrace_method, Cvoid, (Any,), meth) @test didtrace didtrace = false @test tracefoo(1.0, 2.0) == 3.0 @test !didtrace -ccall(:jl_register_method_tracer, Void, (Ptr{Void},), C_NULL) +ccall(:jl_register_method_tracer, Cvoid, (Ptr{Cvoid},), C_NULL) # Method Tracing test -methtracer(x::Ptr{Void}) = (@test isa(unsafe_pointer_to_objref(x), Method); global didtrace = true; nothing) -ccall(:jl_register_newmeth_tracer, Void, (Ptr{Void},), cfunction(methtracer, Void, Tuple{Ptr{Void}})) +methtracer(x::Ptr{Cvoid}) = (@test isa(unsafe_pointer_to_objref(x), Method); global didtrace = true; nothing) +ccall(:jl_register_newmeth_tracer, Cvoid, (Ptr{Cvoid},), cfunction(methtracer, Cvoid, Tuple{Ptr{Cvoid}})) tracefoo2(x, y) = x*y @test didtrace didtrace = false tracefoo(x::Int64, y::Int64) = x*y @test didtrace didtrace = false -ccall(:jl_register_newmeth_tracer, Void, (Ptr{Void},), C_NULL) +ccall(:jl_register_newmeth_tracer, Cvoid, (Ptr{Cvoid},), C_NULL) # test for reflection over large method tables for i = 1:100; @eval fLargeTable(::Val{$i}, ::Any) = 1; end @@ -733,7 +733,7 @@ end @test nfields((1,2)) == 2 @test nfields(()) == 0 -@test nfields(nothing) == fieldcount(Void) == 0 +@test nfields(nothing) == fieldcount(Nothing) == 0 @test nfields(1) == 0 @test fieldcount(Union{}) == 0 @test fieldcount(Tuple{Any,Any,T} where T) == 3 diff --git a/test/repl.jl b/test/repl.jl index e50cae7727910..8af0d19b4dd13 100644 --- a/test/repl.jl +++ b/test/repl.jl @@ -35,7 +35,7 @@ function fake_repl(f; options::REPL.Options=REPL.Options(confirm_exit=false)) end # Writing ^C to the repl will cause sigint, so let's not die on that -ccall(:jl_exit_on_sigint, Void, (Cint,), 0) +ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 0) # These are integration tests. If you want to unit test test e.g. completion, or # exact LineEdit behavior, put them in the appropriate test files. # Furthermore since we are emulating an entire terminal, there may be control characters @@ -643,7 +643,7 @@ fake_repl() do stdin_write, stdout_read, repl wait(repltask) end -ccall(:jl_exit_on_sigint, Void, (Cint,), 1) +ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 1) let exename = Base.julia_cmd() # Test REPL in dumb mode diff --git a/test/show.jl b/test/show.jl index 146888c9072e4..1c8c6ae19ab5a 100644 --- a/test/show.jl +++ b/test/show.jl @@ -19,7 +19,7 @@ end @test replstr(Meta.parse("mutable struct X end")) == ":(mutable struct X\n #= none:1 =#\n end)" @test replstr(Meta.parse("struct X end")) == ":(struct X\n #= none:1 =#\n end)" -let s = "ccall(:f, Int, (Ptr{Void},), &x)" +let s = "ccall(:f, Int, (Ptr{Cvoid},), &x)" @test replstr(Meta.parse(s)) == ":($s)" end @@ -737,7 +737,7 @@ let repr = sprint(dump, Int64) @test repr == "Int64 <: Signed\n" end # Make sure a `TypeVar` in a `Union` doesn't break subtype dump. -BreakDump17529{T} = Union{T, Void} +BreakDump17529{T} = Union{T, Nothing} # make sure dependent parameters are represented correctly VectorVI{I, VI<:AbstractVector{I}} = Vector{VI} let repr = sprint(dump, Any) @@ -760,7 +760,7 @@ let repr = sprint(dump, Core.svec()) end let sv = Core.svec(:a, :b, :c) # unsafe replacement of :c with #undef to test handling of incomplete SimpleVectors - unsafe_store!(convert(Ptr{Ptr{Void}}, Base.data_pointer_from_objref(sv)) + 3 * sizeof(Ptr), C_NULL) + unsafe_store!(convert(Ptr{Ptr{Cvoid}}, Base.data_pointer_from_objref(sv)) + 3 * sizeof(Ptr), C_NULL) repr = sprint(dump, sv) @test repr == "SimpleVector\n 1: Symbol a\n 2: Symbol b\n 3: #undef\n" end @@ -862,7 +862,7 @@ end function static_shown(x) p = Pipe() Base.link_pipe(p; julia_only_read=true, julia_only_write=true) - ccall(:jl_static_show, Void, (Ptr{Void}, Any), p.in, x) + ccall(:jl_static_show, Cvoid, (Ptr{Cvoid}, Any), p.in, x) @async close(p.in) return read(p.out, String) end diff --git a/test/socket.jl b/test/socket.jl index 99a6ebcffcc3a..fddde93284e4b 100644 --- a/test/socket.jl +++ b/test/socket.jl @@ -411,7 +411,7 @@ end @testset "TCPServer constructor" begin s = Base.TCPServer(; delay=false) if ccall(:jl_has_so_reuseport, Int32, ()) == 1 - @test 0 == ccall(:jl_tcp_reuseport, Int32, (Ptr{Void},), s.handle) + @test 0 == ccall(:jl_tcp_reuseport, Int32, (Ptr{Cvoid},), s.handle) end end diff --git a/test/some.jl b/test/some.jl index 4816f791513d4..a4d37d8df0389 100644 --- a/test/some.jl +++ b/test/some.jl @@ -7,31 +7,31 @@ ## convert() # These conversions must fail to prevent ambiguities -# when a value to wrap is already a Some or a Void +# when a value to wrap is already a Some or a Nothing @test_throws MethodError convert(Some, 1) -@test_throws MethodError convert(Union{Some, Void}, 1) +@test_throws MethodError convert(Union{Some, Nothing}, 1) @test_throws MethodError convert(Some{Int}, 1) -@test_throws MethodError convert(Union{Some{Int}, Void}, 1) +@test_throws MethodError convert(Union{Some{Int}, Nothing}, 1) -@test convert(Some, Some(1)) === convert(Union{Some, Void}, Some(1)) === Some(1) -@test convert(Some{Int}, Some(1)) === convert(Union{Some{Int}, Void}, Some(1)) === Some(1) +@test convert(Some, Some(1)) === convert(Union{Some, Nothing}, Some(1)) === Some(1) +@test convert(Some{Int}, Some(1)) === convert(Union{Some{Int}, Nothing}, Some(1)) === Some(1) @test convert(Some{Int}, Some(1.0)) === Some(1) -@test convert(Union{Some{Int}, Void}, Some(1.0)) === Some(1) +@test convert(Union{Some{Int}, Nothing}, Some(1.0)) === Some(1) @test_throws MethodError convert(Some, nothing) @test_throws MethodError convert(Some{Int}, nothing) @test convert(Some, Some(nothing)) === Some(nothing) -@test convert(Some{Void}, Some(nothing)) === Some(nothing) +@test convert(Some{Nothing}, Some(nothing)) === Some(nothing) -@test convert(Union{Some, Void}, nothing) === nothing -@test convert(Union{Some{Int}, Void}, nothing) === nothing +@test convert(Union{Some, Nothing}, nothing) === nothing +@test convert(Union{Some{Int}, Nothing}, nothing) === nothing -@test convert(Union{Int, Void}, nothing) === nothing -@test convert(Union{Int, Void}, 1) === 1 -@test convert(Union{Int, Void}, 1.0) === 1 -@test convert(Void, nothing) === nothing -@test_throws MethodError convert(Void, 1) +@test convert(Union{Int, Nothing}, nothing) === nothing +@test convert(Union{Int, Nothing}, 1) === 1 +@test convert(Union{Int, Nothing}, 1.0) === 1 +@test convert(Nothing, nothing) === nothing +@test_throws MethodError convert(Nothing, 1) ## show() @@ -81,4 +81,4 @@ end using Base: notnothing @test notnothing(1) === 1 -@test_throws ArgumentError notnothing(nothing) \ No newline at end of file +@test_throws ArgumentError notnothing(nothing) diff --git a/test/spawn.jl b/test/spawn.jl index 30b615f29016c..06ec5881fcdb9 100644 --- a/test/spawn.jl +++ b/test/spawn.jl @@ -246,11 +246,11 @@ let fname = tempname(), p cmd = """ # Overwrite libuv memory before freeing it, to make sure that a use after free # triggers an assertion. - function thrash(handle::Ptr{Void}) + function thrash(handle::Ptr{Cvoid}) # Kill the memory, but write a nice low value in the libuv type field to # trigger the right code path - ccall(:memset, Ptr{Void}, (Ptr{Void}, Cint, Csize_t), handle, 0xee, 3 * sizeof(Ptr{Void})) - unsafe_store!(convert(Ptr{Cint}, handle + 2 * sizeof(Ptr{Void})), 15) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), handle, 0xee, 3 * sizeof(Ptr{Cvoid})) + unsafe_store!(convert(Ptr{Cint}, handle + 2 * sizeof(Ptr{Cvoid})), 15) nothing end OLD_STDERR = STDERR @@ -260,7 +260,7 @@ let fname = tempname(), p oldhandle = OLD_STDERR.handle OLD_STDERR.status = Base.StatusClosing OLD_STDERR.handle = C_NULL - ccall(:uv_close, Void, (Ptr{Void}, Ptr{Void}), oldhandle, cfunction(thrash, Void, Tuple{Ptr{Void}})) + ccall(:uv_close, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), oldhandle, cfunction(thrash, Cvoid, Tuple{Ptr{Cvoid}})) sleep(1) import Base.zzzInvalidIdentifier """ diff --git a/test/staged.jl b/test/staged.jl index 703688acf054d..7b7cf929d5f00 100644 --- a/test/staged.jl +++ b/test/staged.jl @@ -149,7 +149,7 @@ module TestGeneratedThrow foo() = (bar(rand() > 0.5 ? 1 : 1.0); error("foo")) function __init__() code_typed(foo,(); optimize = false) - cfunction(foo,Void,Tuple{}) + cfunction(foo,Cvoid,Tuple{}) end end diff --git a/test/strings/basic.jl b/test/strings/basic.jl index dd4623be6c958..f6be02e8e6725 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -255,7 +255,7 @@ end end @testset "issue #10307" begin - @test typeof(map(x -> parse(Int16, x), AbstractString[])) == Vector{Union{Int16, Void}} + @test typeof(map(x -> parse(Int16, x), AbstractString[])) == Vector{Union{Int16, Nothing}} for T in [Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128] for i in [typemax(T), typemin(T)] diff --git a/test/strings/io.jl b/test/strings/io.jl index 8a25819898fb3..79476810c3329 100644 --- a/test/strings/io.jl +++ b/test/strings/io.jl @@ -54,9 +54,9 @@ ] buf = IOBuffer() - @test typeof(escape_string(buf, "test")) == Void + @test typeof(escape_string(buf, "test")) == Nothing @test String(take!(buf)) == "test" - @test typeof(escape_string(buf, "hello", "l")) == Void + @test typeof(escape_string(buf, "hello", "l")) == Nothing @test String(take!(buf)) == "he\\l\\lo" @test typeof(escape_string("test", "t")) == String diff --git a/test/strings/types.jl b/test/strings/types.jl index b849ddac07573..7db39722a5349 100644 --- a/test/strings/types.jl +++ b/test/strings/types.jl @@ -273,7 +273,7 @@ let @test ptr == cstring @test cstring == ptr - # convenient NULL string creation from Ptr{Void} + # convenient NULL string creation from Ptr{Cvoid} nullstr = Cstring(C_NULL) # Comparisons against NULL strings diff --git a/test/subtype.jl b/test/subtype.jl index 80eec5317f656..f88a4badbb0e0 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -539,7 +539,7 @@ function test_old() @test isequal_type(Tuple, Tuple{Vararg}) #@test (Array{Tuple{Vararg{Any}}} <: Array{NTuple}) #@test (Array{Tuple{Vararg}} <: Array{NTuple}) - @test !(Type{Tuple{Void}} <: Tuple{Type{Void}}) + @test !(Type{Tuple{Nothing}} <: Tuple{Type{Nothing}}) end const menagerie = @@ -924,13 +924,13 @@ function test_intersection() # issue #21118 A = Tuple{Ref, Vararg{Any}} - B = Tuple{Vararg{Union{Z,Ref,Void}}} where Z<:Union{Ref,Void} + B = Tuple{Vararg{Union{Z,Ref,Nothing}}} where Z<:Union{Ref,Nothing} @test B <: _type_intersect(A, B) # TODO: this would be a better version of that test: #let T = _type_intersect(A, B) # @test T <: A # @test T <: B - # @test Tuple{Ref, Vararg{Union{Ref,Void}}} <: T + # @test Tuple{Ref, Vararg{Union{Ref,Nothing}}} <: T #end @testintersect(Tuple{Int,Any,Vararg{A}} where A>:Integer, Tuple{Any,Int,Vararg{A}} where A>:Integer, @@ -1208,8 +1208,8 @@ end # issue #23908 @test Array{Union{Int128, Int16, Int32, Int8}, 1} <: Array{Union{Int128, Int32, Int8, _1}, 1} where _1 -let A = Pair{Void, Pair{Array{Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}, 1}, Void}}, - B = Pair{Void, Pair{Array{Union{Int8, UInt128, UInt16, UInt32, UInt64, UInt8, _1}, 1}, Void}} where _1 +let A = Pair{Nothing, Pair{Array{Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}, 1}, Nothing}}, + B = Pair{Nothing, Pair{Array{Union{Int8, UInt128, UInt16, UInt32, UInt64, UInt8, _1}, 1}, Nothing}} where _1 @test A <: B @test !(B <: A) end @@ -1233,8 +1233,8 @@ end struct A23764{T, N, S} <: AbstractArray{Union{T, S}, N}; end @test Tuple{A23764{Int, 1, T} where T} <: Tuple{AbstractArray{T,N}} where {T,N} struct A23764_2{T, N, S} <: AbstractArray{Union{Ref{T}, S}, N}; end -@test Tuple{A23764_2{T, 1, Void} where T} <: Tuple{AbstractArray{T,N}} where {T,N} -@test Tuple{A23764_2{T, 1, Void} where T} <: Tuple{AbstractArray{T,N} where {T,N}} +@test Tuple{A23764_2{T, 1, Nothing} where T} <: Tuple{AbstractArray{T,N}} where {T,N} +@test Tuple{A23764_2{T, 1, Nothing} where T} <: Tuple{AbstractArray{T,N} where {T,N}} # issue #24305 f24305(x) = [g24305(x) g24305(x) g24305(x) g24305(x); g24305(x) g24305(x) 0 0]; diff --git a/test/threads.jl b/test/threads.jl index 96d3b1dcfe803..12b3cffd0454e 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -200,7 +200,7 @@ function test_atomic_read(commbuf::CommBuf, n::Int) correct &= var1 >= var2 var1 == n && break # Temporary solution before we have gc transition support in codegen. - ccall(:jl_gc_safepoint, Void, ()) + ccall(:jl_gc_safepoint, Cvoid, ()) end commbuf.correct_read = correct end @@ -245,7 +245,7 @@ function test_fence(p::Peterson, id::Int, n::Int) while p.flag[otherid][] != 0 && p.turn[] == otherid # busy wait # Temporary solution before we have gc transition support in codegen. - ccall(:jl_gc_safepoint, Void, ()) + ccall(:jl_gc_safepoint, Cvoid, ()) end # critical section p.critical[id][] = 1 @@ -302,7 +302,7 @@ function test_atomic_cas!(var::Atomic{T}, range::StepRange{Int,Int}) where T old = atomic_cas!(var, T(i-1), T(i)) old == T(i-1) && break # Temporary solution before we have gc transition support in codegen. - ccall(:jl_gc_safepoint, Void, ()) + ccall(:jl_gc_safepoint, Cvoid, ()) end end end @@ -357,12 +357,12 @@ for period in (0.06, Dates.Millisecond(60)) wait(c) t = Timer(period) wait(t) - ccall(:uv_async_send, Void, (Ptr{Void},), async) - ccall(:uv_async_send, Void, (Ptr{Void},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) wait(c) sleep(period) - ccall(:uv_async_send, Void, (Ptr{Void},), async) - ccall(:uv_async_send, Void, (Ptr{Void},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) + ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), async) end)) wait(c) notify(c) @@ -394,7 +394,7 @@ function test_thread_cfunction() @threads for i in 1:1000 # Make sure this is not inferrable # and a runtime call to `jl_function_ptr` will be created - ccall(:jl_function_ptr, Ptr{Void}, (Any, Any, Any), + ccall(:jl_function_ptr, Ptr{Cvoid}, (Any, Any, Any), complex_cfunction, Float64, Tuple{Ref{Vector{Float64}}}) end end @@ -428,7 +428,7 @@ function test_load_and_lookup_18020(n) @threads for i in 1:n try ccall(:jl_load_and_lookup, - Ptr{Void}, (Cstring, Cstring, Ref{Ptr{Void}}), + Ptr{Cvoid}, (Cstring, Cstring, Ref{Ptr{Cvoid}}), "$i", :f, C_NULL) end end @@ -460,7 +460,7 @@ test_nested_loops() %ptr = inttoptr i$(Sys.WORD_SIZE) %0 to i128* store atomic i128 %1, i128* %ptr release, align 8 ret void - \"\"\", Void, Tuple{Ptr{UInt128}, UInt128}, unsafe_convert(Ptr{UInt128}, x), v) + \"\"\", Cvoid, Tuple{Ptr{UInt128}, UInt128}, unsafe_convert(Ptr{UInt128}, x), v) end code_native(STDOUT, unaligned_setindex!, Tuple{Atomic{UInt128}, UInt128}) """ diff --git a/test/tuple.jl b/test/tuple.jl index d913a91532ec5..c5b3d1ba65b0b 100644 --- a/test/tuple.jl +++ b/test/tuple.jl @@ -363,4 +363,4 @@ end @testset "issue 24707" begin @test eltype(Tuple{Vararg{T}} where T<:Integer) >: Integer -end \ No newline at end of file +end diff --git a/test/worlds.jl b/test/worlds.jl index 1dfea7f6fe8d9..b67b419a4c656 100644 --- a/test/worlds.jl +++ b/test/worlds.jl @@ -66,10 +66,10 @@ A265(fld::Int) = A265(Float64(fld)) mutable struct B265{T} field1::T # dummy arg is present to prevent (::Type{T}){T}(arg) from matching the test calls - B265{T}(field1::Any, dummy::Void) where T = new(field1) # prevent generation of outer ctor + B265{T}(field1::Any, dummy::Nothing) where T = new(field1) # prevent generation of outer ctor end # define some constructors -B265(x::Int, dummy::Void) = B265{Int}(x, dummy) +B265(x::Int, dummy::Nothing) = B265{Int}(x, dummy) let ty = Any[1, 2.0e0, 3.0f0] global B265_(i::Int) = B265(ty[i], nothing) end @@ -81,8 +81,8 @@ end @test Core.Inference.return_type(B265_, (Int,)) == B265{Int} # add new constructors -B265(x::Float64, dummy::Void) = B265{Float64}(x, dummy) -B265(x::Any, dummy::Void) = B265{UInt8}(x, dummy) +B265(x::Float64, dummy::Nothing) = B265{Float64}(x, dummy) +B265(x::Any, dummy::Nothing) = B265{UInt8}(x, dummy) # make sure answers are updated @test (B265_(1)::B265{Int}).field1 === 1 From 0f4d5db114b10916e0a152415598dc3358ddf066 Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Mon, 18 Dec 2017 13:06:27 -0500 Subject: [PATCH 3/3] NEWS and deprecation for Void => Nothing rename --- NEWS.md | 13 ++++++++----- base/deprecated.jl | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4d16466c89a62..c4c6ba11ee152 100644 --- a/NEWS.md +++ b/NEWS.md @@ -309,7 +309,7 @@ This section lists changes that do not have deprecation warnings. finalized as its second (rather than the reverse). For the majority of use cases deprecation warnings will be triggered. However, deprecation warnings will not trigger where (1) the callable argument is not a subtype of `Function`; or (2) both arguments are - `Function`s or `Ptr{Void}`s ([#24605]). + `Function`s or `Ptr{Cvoid}`s ([#24605]). * The `kill` function now throws errors on user error (e.g. on permission errors), but returns successfully if the process had previously exited. @@ -844,10 +844,13 @@ Deprecated or removed * `Associative` has been deprecated in favor of `AbstractDict` ([#25012]). - * `Nullable{T}` has been deprecated and moved to the Nullables package ([#23642]). - Use `Union{T, Void}` instead, or `Union{Some{T}, Void}` if `nothing` is a possible value - (i.e. `Void <: T`). `isnull(x)` can be replaced with `x === nothing` - and `unsafe_get`/`get` can be dropped or replaced with `coalesce`. + * `Void` has been renamed back to `Nothing` with an alias `Cvoid` for use when calling C + with a return type of `Cvoid` or a return or argument type of `Ptr{Cvoid}` ([#25162]). + + * `Nullable{T}` has been deprecated and moved to the Nullables package ([#23642]). Use + `Union{T, Nothing}` instead, or `Union{Some{T}, Nothing}` if `nothing` is a possible + value (i.e. `Nothing <: T`). `isnull(x)` can be replaced with `x === nothing` and + `unsafe_get`/`get` can be dropped or replaced with `coalesce`. `NullException` has been removed. * `CartesianRange` has been renamed `CartesianIndices` ([#24715]). diff --git a/base/deprecated.jl b/base/deprecated.jl index 9234a91cd3802..26494dcc66822 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -3320,6 +3320,9 @@ info(io::IO, err::Exception; prefix="ERROR: ", kw...) = info(err::Exception; prefix="ERROR: ", kw...) = info(STDERR, err, prefix=prefix; kw...) +# issue #25082 +@deprecate_binding Void Nothing + # #24844 @deprecate copy!(dest::AbstractSet, src) union!(dest, src) @deprecate copy!(dest::AbstractDict, src) foldl(push!, dest, src)