Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Jun 23, 2022
1 parent 2807331 commit 372ab99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StrideArraysCore"
uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da"
authors = ["Chris Elrod <[email protected]> and contributors"]
version = "0.3.12"
version = "0.3.13"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
7 changes: 7 additions & 0 deletions src/reshape.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@ end
@assert all(D) "All dimensions must be dense for a reshaped view. Try `reshape(copy(A),...)` instead."
PtrArray(pointer(A), dims)
end
if !(StaticInt <: Integer)
@inline function Base.reshape(A::PtrArray{S,D}, dims::Tuple{Vararg{Base.Integer}}) where {S,D}
@assert all(D) "All dimensions must be dense for a reshaped view. Try `reshape(copy(A),...)` instead."
PtrArray(pointer(A), dims)
end
end

@inline function Base.reshape(
A::PtrArray{S,D},
dims::Tuple{Integer,Vararg{Integer}},
) where {S,D}
@assert all(D) "All dimensions must be dense for a reshaped view. Try `reshape(copy(A),...)` instead."
PtrArray(pointer(A), dims)
end
if !(StaticInt <: Integer)
@inline function Base.reshape(
A::PtrArray{S,D},
dims::Tuple{Base.Integer,Vararg{Base.Integer}},
) where {S,D}
@assert all(D) "All dimensions must be dense for a reshaped view. Try `reshape(copy(A),...)` instead."
PtrArray(pointer(A), dims)
end
end
@inline function Base.reshape(A::PtrArray{S,D}, dims::Tuple{Vararg{Int}}) where {S,D}
@assert all(D) "All dimensions must be dense for a reshaped view. Try `reshape(copy(A),...)` instead."
PtrArray(pointer(A), dims)
Expand All @@ -42,12 +47,14 @@ end
@inline function Base.reshape(A::StrideArray, dims::Tuple{Integer,Vararg{Integer}})
StrideArray(reshape(PtrArray(A), dims), preserve_buffer(A))
end
if !(StaticInt <: Integer)
@inline function Base.reshape(A::StrideArray, dims::Tuple{Vararg{Base.Integer}})
StrideArray(reshape(PtrArray(A), dims), preserve_buffer(A))
end
@inline function Base.reshape(A::StrideArray, dims::Tuple{Base.Integer,Vararg{Base.Integer}})
StrideArray(reshape(PtrArray(A), dims), preserve_buffer(A))
end
end
@inline function Base.reshape(A::StrideArray, dims::Tuple{Vararg{Int}})
StrideArray(reshape(PtrArray(A), dims), preserve_buffer(A))
end

2 comments on commit 372ab99

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/62939

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.13 -m "<description of version>" 372ab99c022c18240e7598126f6bbc95443f07cc
git push origin v0.3.13

Please sign in to comment.