Skip to content

Commit 972246e

Browse files
committed
Remove rest of deprecations.
1 parent d20d707 commit 972246e

10 files changed

+51
-97
lines changed

src/MArray.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ end
114114

115115
@inline Tuple(v::MArray) = v.data
116116

117-
if isdefined(Base, :dataids) # v0.7-
118-
Base.dataids(ma::MArray) = (UInt(pointer(ma)),)
119-
end
117+
Base.dataids(ma::MArray) = (UInt(pointer(ma)),)
120118

121119
@inline function Base.unsafe_convert(::Type{Ptr{T}}, a::MArray{S,T}) where {S,T}
122120
Base.unsafe_convert(Ptr{T}, pointer_from_objref(a))

src/SArray.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ end
7272

7373
@inline Tuple(v::SArray) = v.data
7474

75-
if isdefined(Base, :dataids) # v0.7-
76-
Base.dataids(::SArray) = ()
77-
end
75+
Base.dataids(::SArray) = ()
7876

7977
# See #53
8078
Base.cconvert(::Type{Ptr{T}}, a::SArray) where {T} = Base.RefValue(a)

src/SizedArray.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ SizedMatrix{S1,S2,T,M} = SizedArray{Tuple{S1,S2},T,2,M}
7272
@inline SizedMatrix{S1,S2}(a::Array{T,M}) where {S1,S2,T,M} = SizedArray{Tuple{S1,S2},T,2,M}(a)
7373
@inline SizedMatrix{S1,S2}(x::NTuple{L,T}) where {S1,S2,T,L} = SizedArray{Tuple{S1,S2},T,2,2}(x)
7474

75-
if isdefined(Base, :dataids) # v0.7-
76-
Base.dataids(sa::SizedArray) = Base.dataids(sa.data)
77-
end
75+
Base.dataids(sa::SizedArray) = Base.dataids(sa.data)
7876

7977
"""
8078
Size(dims)(array)

src/matrix_multiply.jl

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -303,30 +303,16 @@ end
303303
gemm = :cgemm_
304304
end
305305

306-
if VERSION < v"0.7-"
307-
blascall = quote
308-
ccall((Base.BLAS.@blasfunc($gemm), Base.BLAS.libblas), Nothing,
309-
(Ref{UInt8}, Ref{UInt8}, Ref{Base.BLAS.BlasInt}, Ref{Base.BLAS.BlasInt},
310-
Ref{Base.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{Base.BLAS.BlasInt},
311-
Ptr{$T}, Ref{Base.BLAS.BlasInt}, Ref{$T}, Ptr{$T},
312-
Ref{Base.BLAS.BlasInt}),
313-
transA, transB, m, n,
314-
ka, alpha, a, strideA,
315-
b, strideB, beta, c,
316-
strideC)
317-
end
318-
else
319-
blascall = quote
320-
ccall((LinearAlgebra.BLAS.@blasfunc($gemm), LinearAlgebra.BLAS.libblas), Nothing,
321-
(Ref{UInt8}, Ref{UInt8}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt},
322-
Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt},
323-
Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T},
324-
Ref{LinearAlgebra.BLAS.BlasInt}),
325-
transA, transB, m, n,
326-
ka, alpha, a, strideA,
327-
b, strideB, beta, c,
328-
strideC)
329-
end
306+
blascall = quote
307+
ccall((LinearAlgebra.BLAS.@blasfunc($gemm), LinearAlgebra.BLAS.libblas), Nothing,
308+
(Ref{UInt8}, Ref{UInt8}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt},
309+
Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt},
310+
Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T},
311+
Ref{LinearAlgebra.BLAS.BlasInt}),
312+
transA, transB, m, n,
313+
ka, alpha, a, strideA,
314+
b, strideB, beta, c,
315+
strideC)
330316
end
331317

332318
return quote

test/MArray.jl

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,11 @@
116116

117117
@test length(m) === 4
118118

119-
if isdefined(Base, :mightalias) # v0.7-
120-
@test Base.mightalias(m, m)
121-
@test !Base.mightalias(m, copy(m))
122-
@test Base.mightalias(m, view(m, :, 1))
123-
end
124-
125-
if isdefined(Base, :dataids) # v0.7-
126-
@test Base.dataids(m) == (UInt(pointer(m)),)
127-
end
119+
@test Base.mightalias(m, m)
120+
@test !Base.mightalias(m, copy(m))
121+
@test Base.mightalias(m, view(m, :, 1))
122+
123+
@test Base.dataids(m) == (UInt(pointer(m)),)
128124
end
129125

130126
@testset "setindex!" begin

test/SArray.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@
113113

114114
@test_throws Exception m[1] = 1
115115

116-
if isdefined(Base, :dataids) # v0.7-
117-
@test Base.dataids(m) === ()
118-
end
116+
@test Base.dataids(m) === ()
119117
end
120118

121119
@testset "promotion" begin

test/SizedArray.jl

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,18 @@
6060
sa[1] = 2
6161
@test sa.data == [2, 4]
6262

63-
if isdefined(Base, :mightalias) # v0.7-
64-
@testset "aliasing" begin
65-
a1 = rand(4)
66-
a2 = copy(a1)
67-
sa1 = SizedVector{4}(a1)
68-
sa2 = SizedVector{4}(a2)
69-
@test Base.mightalias(a1, sa1)
70-
@test Base.mightalias(sa1, SizedVector{4}(a1))
71-
@test !Base.mightalias(a2, sa1)
72-
@test !Base.mightalias(sa1, SizedVector{4}(a2))
73-
@test Base.mightalias(sa1, view(sa1, 1:2))
74-
@test Base.mightalias(a1, view(sa1, 1:2))
75-
@test Base.mightalias(sa1, view(a1, 1:2))
76-
end
63+
@testset "aliasing" begin
64+
a1 = rand(4)
65+
a2 = copy(a1)
66+
sa1 = SizedVector{4}(a1)
67+
sa2 = SizedVector{4}(a2)
68+
@test Base.mightalias(a1, sa1)
69+
@test Base.mightalias(sa1, SizedVector{4}(a1))
70+
@test !Base.mightalias(a2, sa1)
71+
@test !Base.mightalias(sa1, SizedVector{4}(a2))
72+
@test Base.mightalias(sa1, view(sa1, 1:2))
73+
@test Base.mightalias(a1, view(sa1, 1:2))
74+
@test Base.mightalias(sa1, view(a1, 1:2))
7775
end
7876

7977
@testset "back to Array" begin

test/linalg.jl

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -168,31 +168,21 @@ using StaticArrays, Test, LinearAlgebra
168168

169169
# issue #388
170170
let x = SVector(1, 2, 3)
171-
if VERSION >= v"0.7.0-beta.47"
172-
# current limit: 34 arguments
173-
hcat(
174-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
175-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
176-
allocs = @allocated hcat(
177-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
178-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
179-
@test allocs == 0
180-
vcat(
181-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
182-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
183-
allocs = @allocated vcat(
184-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
185-
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
186-
@test allocs == 0
187-
else
188-
# current limit: 14 arguments
189-
hcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
190-
allocs = @allocated hcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
191-
@test allocs == 0
192-
vcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
193-
allocs = @allocated vcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
194-
@test allocs == 0
195-
end
171+
# current limit: 34 arguments
172+
hcat(
173+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
174+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
175+
allocs = @allocated hcat(
176+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
177+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
178+
@test allocs == 0
179+
vcat(
180+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
181+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
182+
allocs = @allocated vcat(
183+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
184+
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
185+
@test allocs == 0
196186
end
197187

198188
# issue #561

test/mapreduce.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using StaticArrays, Test
2-
if VERSION >= v"0.7.0-beta.85"
3-
import Statistics: mean
4-
end
2+
using Statistics: mean
53

64
@testset "Map, reduce, mapreduce, broadcast" begin
75
@testset "map and map!" begin

test/triangular.jl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,9 @@ end
6464
@test (transpose(SA)*SB)::SMatrix{n,n} transpose(A)*transpose(B)
6565
@test (transpose(SA)*transpose(SB))::SVector{n} transpose(A)*B
6666
@test (transpose(SA)*SB')::SVector{n} transpose(A)*conj(B)
67-
if VERSION < v"0.7-"
68-
@test (SB*SA)::RowVector{<:Any,<:SVector{n}} transpose(B)*A
69-
@test (SB*SA')::RowVector{<:Any,<:SVector{n}} transpose(B)*A'
70-
@test (SB*transpose(SA))::RowVector{<:Any,<:SVector{n}} transpose(B)*transpose(A)
71-
else
72-
@test (SB*SA)::Transpose{<:Any,<:SVector{n}} transpose(B)*A
73-
@test (SB*SA')::Transpose{<:Any,<:SVector{n}} transpose(B)*A'
74-
@test (SB*transpose(SA))::Transpose{<:Any,<:SVector{n}} transpose(B)*transpose(A)
75-
end
67+
@test (SB*SA)::Transpose{<:Any,<:SVector{n}} transpose(B)*A
68+
@test (SB*SA')::Transpose{<:Any,<:SVector{n}} transpose(B)*A'
69+
@test (SB*transpose(SA))::Transpose{<:Any,<:SVector{n}} transpose(B)*transpose(A)
7670
@test (transpose(SB)*SA)::SMatrix{n,n} B*A
7771
@test (SB'*SA)::SMatrix{n,n} conj(B)*A
7872
@test (transpose(SB)*transpose(SA))::SMatrix{n,n} B*transpose(A)
@@ -88,7 +82,7 @@ end
8882
eltyB in (Float64, ComplexF64, Int),
8983
(ta, uploa) in ((UpperTriangular, :U), (LowerTriangular, :L)),
9084
(tb, uplob) in ((UpperTriangular, :U), (LowerTriangular, :L))
91-
85+
9286
A = ta(eltyA == Int ? rand(1:7, n, n) : rand(eltyA, n, n))
9387
B = tb(eltyB == Int ? rand(1:7, n, n) : rand(eltyB, n, n))
9488

0 commit comments

Comments
 (0)