Skip to content

Commit cce6515

Browse files
authored
Merge pull request #128 from SciML/staticptr
Remove static pointer arithmetic
2 parents 1a93e30 + 7c4cf7b commit cce6515

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/Static.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,6 @@ Base.:(*)(::StaticInteger{X}, ::StaticInteger{Y}) where {X, Y} = static(X * Y)
438438
Base.:(/)(::StaticInteger{X}, ::StaticInteger{Y}) where {X, Y} = static(X / Y)
439439
Base.:(-)(::StaticInteger{X}, ::StaticInteger{Y}) where {X, Y} = static(X - Y)
440440
Base.:(+)(::StaticInteger{X}, ::StaticInteger{Y}) where {X, Y} = static(X + Y)
441-
Base.:(-)(x::Ptr, ::StaticInt{N}) where {N} = x - N
442-
Base.:(-)(::StaticInt{N}, y::Ptr) where {N} = y - N
443-
Base.:(+)(x::Ptr, ::StaticInt{N}) where {N} = x + N
444-
Base.:(+)(::StaticInt{N}, y::Ptr) where {N} = y + N
445441

446442
@generated Base.sqrt(::StaticNumber{N}) where {N} = :($(static(sqrt(N))))
447443

test/runtests.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ end
108108
@test isless(static(1), static(2))
109109

110110
v = rand(3)
111-
GC.@preserve v begin
112-
p = pointer(v)
113-
@test +(p, static(1)) == +(static(1), p) == +(p, 1)
114-
@test -(p, static(1)) == -(static(1), p) == -(p, 1)
115-
end
116-
117111
@test real(static(3)) === static(3)
118112
@test imag(static(3)) === static(0)
119113

0 commit comments

Comments
 (0)